diff mercurial/commands.py @ 18622:f9eebf5629fa

summary: show active bookmark even if not at current changeset Before this change, 'hg summary' would not show the active bookmark unless it pointed to the working directory parent. After this change, it will show it in parentheses, like so: parent: 18581:f0ff45fe6700 tip summary: simplify handling of active bookmark branch: default bookmarks: [crew] commit: (clean) update: (current)
author Kevin Bullock <kbullock@ringworld.org>
date Fri, 08 Feb 2013 21:47:22 +0000
parents b1e949f6c17d
children 0027a5cec9d0
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Jan 27 11:53:46 2013 -0600
+++ b/mercurial/commands.py	Fri Feb 08 21:47:22 2013 +0000
@@ -5574,9 +5574,12 @@
         current = repo._bookmarkcurrent
         # i18n: column positioning for "hg summary"
         ui.write(_('bookmarks:'), label='log.bookmark')
-        if current is not None and current in marks:
-            ui.write(' *' + current, label='bookmarks.current')
-            marks.remove(current)
+        if current is not None:
+            if current in marks:
+                ui.write(' *' + current, label='bookmarks.current')
+                marks.remove(current)
+            else:
+                ui.write('[%s]' % current, label='bookmarks.current')
         for m in marks:
             ui.write(' ' + m, label='log.bookmark')
         ui.write('\n', label='log.bookmark')