diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5530,7 +5530,8 @@ def update(ui, repo, node=None, rev=None # if we defined a bookmark, we have to remember the original name brev = rev - repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') + if rev: + repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') ctx = scmutil.revsingle(repo, rev, rev) rev = ctx.rev() if ctx.hidden(): diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t --- a/tests/test-directaccess.t +++ b/tests/test-directaccess.t @@ -162,6 +162,9 @@ This should not throw error $ hg up 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg up + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + `hg revert` $ hg revert -r 28ad74 --all