diff -r 3993eb47ea49 -r 03c84c966ef5 mercurial/bookmarks.py --- 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()