[PATCH 1 of 2] summary: simplify handling of active bookmark
Kevin Bullock
kbullock+mercurial at ringworld.org
Sun Jan 27 12:09:54 CST 2013
# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1359309226 21600
# Branch stable
# Node ID a367f06d8c96c2279c500a688ab4ff65ac278b16
# Parent 5ef3c7081008f7befb57b10b2fa67c0d8a5e4a23
summary: simplify handling of active bookmark
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5574,13 +5574,9 @@ def summary(ui, repo, **opts):
current = repo._bookmarkcurrent
# i18n: column positioning for "hg summary"
ui.write(_('bookmarks:'), label='log.bookmark')
- if current is not None:
- try:
- marks.remove(current)
- ui.write(' *' + current, label='bookmarks.current')
- except ValueError:
- # current bookmark not in parent ctx marks
- pass
+ if current is not None and current in marks:
+ ui.write(' *' + current, label='bookmarks.current')
+ marks.remove(current)
for m in marks:
ui.write(' ' + m, label='log.bookmark')
ui.write('\n', label='log.bookmark')
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -461,6 +461,13 @@ create bundle with two heads
update to current bookmark if it's not the parent
+ $ hg summary
+ parent: 2:db815d6d32e6
+ 2
+ branch: default
+ bookmarks: Y x y
+ commit: 1 added, 1 unknown (new branch head)
+ update: 2 new changesets (update)
$ hg update
updating to active bookmark Z
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
More information about the Mercurial-devel
mailing list