Patchwork D1812: archive: add support to specify hidden revs if directaccess config is set

login
register
mail settings
Submitter phabricator
Date Jan. 6, 2018, 2:53 a.m.
Message ID <886c63dafc8dc21be569e0601f7e442d@localhost.localdomain>
Download mbox | patch
Permalink /patch/26577/
State Not Applicable
Headers show

Comments

phabricator - Jan. 6, 2018, 2:53 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGffd7b7cd309b: archive: add support to specify hidden revs if directaccess config is set (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1812?vs=4708&id=4728

REVISION DETAIL
  https://phab.mercurial-scm.org/D1812

AFFECTED FILES
  mercurial/commands.py
  tests/test-directaccess.t

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t
--- a/tests/test-directaccess.t
+++ b/tests/test-directaccess.t
@@ -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
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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()