# HG changeset patch # User Yuya Nishihara # Date 2018-01-16 12:51:27 # Node ID e29823c6d3e85511e9071a945a15ba772f1a20e3 # Parent 077ee15b8493f42b7a86b34d1d67c8097b5c4a65 update: fix crash on bare update when directaccess is enabled 'rev' may be None. An empty 'rev' string shouldn't also be passed to unhidehashlikerevs(). 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