Patchwork D1870: bookmarks: display the obsfate of hidden revision we create a bookmark on

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 1:42 p.m.
Message ID <bdea933a4132df61be26937f78680679@localhost.localdomain>
Download mbox | patch
Permalink /patch/26897/
State Not Applicable
Headers show

Comments

phabricator - Jan. 18, 2018, 1:42 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa1a5c3842b6f: bookmarks: display the obsfate of hidden revision we create a bookmark on (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1870?vs=4848&id=4901

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

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

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -1531,6 +1531,7 @@ 
   3:be1832deae9a b (no-eol)
   $ hg book -r 2 mybook --hidden  # rev 2 has a bookmark on it now
   bookmarking hidden changeset 1e9a3c00cbe9
+  (hidden revision '1e9a3c00cbe9' was rewritten as: be1832deae9a)
   $ hg up 2 && hg log -r .  # working dir is at rev 2 again
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1352,6 +1352,7 @@ 
   $ hg commit --amend -m "message"
   $ hg book bookb -r 13bedc178fce --hidden
   bookmarking hidden changeset 13bedc178fce
+  (hidden revision '13bedc178fce' was rewritten as: a9b1f8652753)
   $ hg log -r 13bedc178fce
   4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
   $ hg book -d bookb
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1959,6 +1959,7 @@ 
 
   $ hg bookmark --hidden -r 1 X
   bookmarking hidden changeset a765632148dc
+  (hidden revision 'a765632148dc' is pruned)
   $ hg log --template '{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
@@ -1968,6 +1969,7 @@ 
 
   $ hg bookmark --hidden -r 1 X@foo
   bookmarking hidden changeset a765632148dc
+  (hidden revision 'a765632148dc' is pruned)
   $ hg log --template '{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
diff --git a/tests/test-directaccess.t b/tests/test-directaccess.t
--- a/tests/test-directaccess.t
+++ b/tests/test-directaccess.t
@@ -195,6 +195,7 @@ 
 
   $ hg bookmarks -r 28ad74 book
   bookmarking hidden changeset 28ad74487de9
+  (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469)
 
   $ hg bookmarks
      book                      2:28ad74487de9
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -861,6 +861,11 @@ 
 
     if hiddenrev:
         repo.ui.warn(_("bookmarking hidden changeset %s\n") % hiddenrev)
+
+        if ctx.obsolete():
+            msg = obsutil._getfilteredreason(repo, "%s" % hiddenrev, ctx)
+            repo.ui.warn("(%s)\n" % msg)
+
     marks.applychanges(repo, tr, changes)
     if not inactive and cur == marks[newact] and not rev:
         activate(repo, newact)