changeset 35535:ffd7b7cd309b

archive: add support to specify hidden revs if directaccess config is set Differential Revision: https://phab.mercurial-scm.org/D1812
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 05 Jan 2018 19:30:37 +0530
parents b6ce3568771d
children f04d16bef2c7
files mercurial/commands.py tests/test-directaccess.t
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Jan 05 19:23:30 2018 +0530
+++ b/mercurial/commands.py	Fri Jan 05 19:30:37 2018 +0530
@@ -467,7 +467,10 @@
     '''
 
     opts = pycompat.byteskwargs(opts)
-    ctx = scmutil.revsingle(repo, opts.get('rev'))
+    rev = opts.get('rev')
+    if rev:
+        repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn')
+    ctx = scmutil.revsingle(repo, rev)
     if not ctx:
         raise error.Abort(_('no working directory: please specify a revision'))
     node = ctx.node()
--- a/tests/test-directaccess.t	Fri Jan 05 19:23:30 2018 +0530
+++ b/tests/test-directaccess.t	Fri Jan 05 19:30:37 2018 +0530
@@ -148,6 +148,11 @@
   $ hg status --change 28ad74
   A c
 
+`hg archive`
+
+This should not throw error
+  $ hg archive -r 28ad74 foo
+
 `hg update`
 
   $ hg up 28ad74