[patch 2/4] Add log -b to show the branch a specific revision lives in

Chris Mason mason at suse.com
Wed Sep 7 10:03:38 CDT 2005


# HG changeset patch
# User mason at suse.com
Add log -b to show the branch a specific revision lives in

This can be somewhat slow on very large repositories, so I didn't want
to include it in -v

Index: crew/mercurial/commands.py
===================================================================
--- crew.orig/mercurial/commands.py	2005-09-01 08:52:03.000000000 -0400
+++ crew/mercurial/commands.py	2005-09-06 19:42:39.000000000 -0400
@@ -1124,7 +1124,10 @@ def log(ui, repo, *pats, **opts):
             du = dui(ui)
         elif st == 'add':
             du.bump(rev)
-            show_changeset(du, repo, rev)
+            br = None
+            if opts['branch']:
+                br = repo.branchlookup([repo.changelog.node(rev)])
+            show_changeset(du, repo, rev, brinfo=br)
             if opts['patch']:
                 changenode = repo.changelog.node(rev)
                 prev, other = repo.changelog.parents(changenode)
@@ -1655,6 +1658,7 @@ table = {
         (log,
          [('I', 'include', [], 'include path in search'),
           ('X', 'exclude', [], 'exclude path from search'),
+          ('b', 'branch', None, 'show branches'),
           ('r', 'rev', [], 'revision'),
           ('p', 'patch', None, 'show patch')],
          'hg log [-I] [-X] [-r REV]... [-p] [FILE]'),

--


More information about the Mercurial mailing list