summary: add bookmarks to summary stable
authorDavid Soria Parra <dsp@php.net>
Mon, 21 Feb 2011 23:27:45 +0100
branchstable
changeset 13454 afc84a879ac8
parent 13453 c1b808020819
child 13455 053c042118bc
summary: add bookmarks to summary
mercurial/commands.py
tests/test-bookmarks.t
--- 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)
+