# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-01-05 14:00:37 # Node ID ffd7b7cd309ba75d977b9c1f6f6b7103f5f3a2ef # Parent b6ce3568771dcbc6a70bf0d4ddda26451bc48541 archive: add support to specify hidden revs if directaccess config is set Differential Revision: https://phab.mercurial-scm.org/D1812 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -467,7 +467,10 @@ def archive(ui, repo, dest, **opts): ''' 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() 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 @@ Testing with hash $ hg status --change 28ad74 A c +`hg archive` + +This should not throw error + $ hg archive -r 28ad74 foo + `hg update` $ hg up 28ad74