changeset 13454:afc84a879ac8 stable

summary: add bookmarks to summary
author David Soria Parra <dsp@php.net>
date Mon, 21 Feb 2011 23:27:45 +0100
parents c1b808020819
children 053c042118bc
files mercurial/commands.py tests/test-bookmarks.t
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Feb 21 22:22:12 2011 +0100
+++ b/mercurial/commands.py	Mon Feb 21 23:27:45 2011 +0100
@@ -3705,6 +3705,8 @@
         ui.write(_('parent: %d:%s ') % (p.rev(), str(p)),
                  label='log.changeset')
         ui.write(' '.join(p.tags()), label='log.tag')
+        if p.bookmarks():
+            ui.write(' ' + ' '.join(p.bookmarks()), label='log.bookmark')
         if p.rev() == -1:
             if not len(repo):
                 ui.write(_(' (empty repository)'))
@@ -3824,6 +3826,15 @@
         o = repo.changelog.nodesbetween(o, None)[0]
         if o:
             t.append(_('%d outgoing') % len(o))
+        if 'bookmarks' in other.listkeys('namespaces'):
+            lmarks = repo.listkeys('bookmarks')
+            rmarks = other.listkeys('bookmarks')
+            diff = set(rmarks) - set(lmarks)
+            if len(diff) > 0:
+                t.append(_('%d incoming bookmarks') % len(diff))
+            diff = set(lmarks) - set(rmarks)
+            if len(diff) > 0:
+                t.append(_('%d outgoing bookmarks') % len(diff))
 
         if t:
             ui.write(_('remote: %s\n') % (', '.join(t)))
--- a/tests/test-bookmarks.t	Mon Feb 21 22:22:12 2011 +0100
+++ b/tests/test-bookmarks.t	Mon Feb 21 23:27:45 2011 +0100
@@ -225,3 +225,12 @@
   abort: bookmark 'foo:bar' contains illegal character
   [255]
 
+test summary
+
+  $ hg summary
+  parent: 2:db815d6d32e6 tip Y Z x  y
+   2
+  branch: default
+  commit: (clean)
+  update: 1 new changesets, 2 branch heads (merge)
+