summary: show active bookmark even if not at current changeset
authorKevin Bullock <kbullock@ringworld.org>
Fri, 08 Feb 2013 21:47:22 +0000
changeset 18622 f9eebf5629fa
parent 18621 b1e949f6c17d
child 18623 0027a5cec9d0
child 18630 9b9e2d9e83a1
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)
mercurial/commands.py
tests/test-bookmarks.t
--- 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')
--- a/tests/test-bookmarks.t	Sun Jan 27 11:53:46 2013 -0600
+++ b/tests/test-bookmarks.t	Fri Feb 08 21:47:22 2013 +0000
@@ -471,7 +471,7 @@
   parent: 2:db815d6d32e6 
    2
   branch: default
-  bookmarks: Y x  y
+  bookmarks:[Z] Y x  y
   commit: 1 added, 1 unknown (new branch head)
   update: 2 new changesets (update)
   $ hg update