diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -974,6 +974,9 @@ if not names and (delete or rev): raise error.Abort(_("bookmark name required")) + if rev: + repo = scmutil.unhidehashlikerevs(repo, [rev], 'nowarn') + if delete or rename or names or inactive: with repo.wlock(), repo.lock(), repo.transaction('bookmark') as tr: if delete: diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t --- a/tests/test-directaccess.t +++ b/tests/test-directaccess.t @@ -186,3 +186,10 @@ abort: hidden revision '2'! (use --hidden to access hidden revisions) [255] + +Setting a bookmark will make that changeset unhidden, so this should come in end + + $ hg bookmarks -r 28ad74 book + + $ hg bookmarks + book 2:28ad74487de9