diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3705,6 +3705,8 @@ def summary(ui, repo, **opts): 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 @@ def summary(ui, repo, **opts): 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))) diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t --- a/tests/test-bookmarks.t +++ b/tests/test-bookmarks.t @@ -225,3 +225,12 @@ invalid bookmark 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) +