archive: add support to specify hidden revs if directaccess config is set
Differential Revision: https://phab.mercurial-scm.org/D1812
--- 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