Patchwork [2,of,3] summary: simplify handling of active bookmark

login
register
mail settings
Submitter Kevin Bullock
Date Feb. 9, 2013, 5:54 p.m.
Message ID <04f1a301c90a00480839.1360432473@s0-0.paconsult7.bbnplanet.net>
Download mbox | patch
Permalink /patch/902/
State Accepted
Commit b1e949f6c17d8de5b145fa1e3f9d4de80f2039d0
Headers show

Comments

Kevin Bullock - Feb. 9, 2013, 5:54 p.m.
# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1359309226 21600
# Node ID 04f1a301c90a00480839f8ee86c7e550a7e98f87
# Parent  501b0d5829a15fbf4d79c665c280ae4f7898ecfe
summary: simplify handling of active bookmark

Patch

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')