Patchwork D1813: bookmarks: add bookmarks to hidden revs if directaccess config is set

login
register
mail settings
Submitter phabricator
Date Jan. 6, 2018, 6:48 a.m.
Message ID <7f81d78b8f27e1c2017de8a73cf8078d@localhost.localdomain>
Download mbox | patch
Permalink /patch/26581/
State Not Applicable
Headers show

Comments

phabricator - Jan. 6, 2018, 6:48 a.m.
pulkit updated this revision to Diff 4732.
pulkit edited the summary of this revision.
pulkit retitled this revision from "bookmarks: add support to specify hidden revs if directaccess config is set" to "bookmarks: add bookmarks to hidden revs if directaccess config is set".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1813?vs=4709&id=4732

REVISION DETAIL
  https://phab.mercurial-scm.org/D1813

AFFECTED FILES
  mercurial/bookmarks.py
  tests/test-directaccess.t

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

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,11 @@ 
   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
+  adding bookmarks to a hidden changeset 28ad74487de9
+
+  $ hg bookmarks
+     book                      2:28ad74487de9
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -853,6 +853,8 @@ 
             return
         tgt = cur
         if rev:
+            warnm = "adding bookmarks to a hidden changeset"
+            repo = scmutil.unhidehashlikerevs(repo, [rev], 'warn', warnm)
             tgt = scmutil.revsingle(repo, rev).node()
         for bm in marks.checkconflict(mark, force, tgt):
             changes.append((bm, None))