Mercurial > hg-stable
changeset 35712:a1a5c3842b6f
bookmarks: display the obsfate of hidden revision we create a bookmark on
Display the same message we added recently to the filtered error message
create a bookmark on an hidden revision.
Differential Revision: https://phab.mercurial-scm.org/D1870
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 16 Jan 2018 14:28:57 +0100 |
parents | 35a0f6f31eef |
children | 7ffbd911dbc9 |
files | mercurial/bookmarks.py tests/test-directaccess.t tests/test-log.t tests/test-obsolete.t tests/test-rebase-obsolete.t |
diffstat | 5 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/bookmarks.py Tue Jan 16 14:08:54 2018 +0100 +++ b/mercurial/bookmarks.py Tue Jan 16 14:28:57 2018 +0100 @@ -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)
--- a/tests/test-directaccess.t Tue Jan 16 14:08:54 2018 +0100 +++ b/tests/test-directaccess.t Tue Jan 16 14:28:57 2018 +0100 @@ -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
--- a/tests/test-log.t Tue Jan 16 14:08:54 2018 +0100 +++ b/tests/test-log.t Tue Jan 16 14:28:57 2018 +0100 @@ -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
--- a/tests/test-obsolete.t Tue Jan 16 14:08:54 2018 +0100 +++ b/tests/test-obsolete.t Tue Jan 16 14:28:57 2018 +0100 @@ -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
--- a/tests/test-rebase-obsolete.t Tue Jan 16 14:08:54 2018 +0100 +++ b/tests/test-rebase-obsolete.t Tue Jan 16 14:28:57 2018 +0100 @@ -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)