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() 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