mercurial/bookmarks.py
changeset 24400 03c84c966ef5
parent 24399 3993eb47ea49
child 24657 3d7c512b258d
--- a/mercurial/bookmarks.py	Thu Mar 19 23:36:05 2015 +0900
+++ b/mercurial/bookmarks.py	Thu Mar 19 23:36:06 2015 +0900
@@ -498,6 +498,16 @@
 
     return 0
 
+def summary(repo, other):
+    '''Compare bookmarks between repo and other for "hg summary" output
+
+    This returns "(# of incoming, # of outgoing)" tuple.
+    '''
+    r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
+                dsthex=hex)
+    addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
+    return (len(addsrc), len(adddst))
+
 def validdest(repo, old, new):
     """Is the new bookmark destination a valid update from the old one"""
     repo = repo.unfiltered()