D1813: bookmarks: add support to specify hidden revs if directaccess config is set
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Fri Jan 5 17:14:50 UTC 2018
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This patch adds support to pass hidden revs as `--rev` without using an
unfiltered repo. Warning is not shown while accessing hidden changeset for
writing bookmark on it. The behaviour is copied from directaccess extension.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1813
AFFECTED FILES
mercurial/commands.py
tests/test-directaccess.t
CHANGE DETAILS
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
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:
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list