[PATCH 2 of 3] summary: simplify handling of active bookmark

Kevin Bullock kbullock+mercurial at ringworld.org
Sat Feb 9 11:54:33 CST 2013


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1359309226 21600
# Node ID 04f1a301c90a00480839f8ee86c7e550a7e98f87
# Parent  501b0d5829a15fbf4d79c665c280ae4f7898ecfe
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')


More information about the Mercurial-devel mailing list