mercurial/node.py
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
--- hg.orig/mercurial/commands.py 2005-09-13 14:21:57.000000000 -0500
+++ hg/mercurial/commands.py 2005-09-13 18:55:52.000000000 -0500
@@ -1161,7 +1161,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)
@@ -1743,6 +1746,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]'),
1089
|
1 |
"""
|
|
2 |
node.py - basic nodeid manipulation for mercurial
|
|
3 |
|
|
4 |
Copyright 2005 Matt Mackall <mpm@selenic.com>
|
|
5 |
|
|
6 |
This software may be used and distributed according to the terms
|
|
7 |
of the GNU General Public License, incorporated herein by reference.
|
|
8 |
"""
|
|
9 |
|
|
10 |
import sha, binascii
|
|
11 |
|
|
12 |
nullid = "\0" * 20
|
|
13 |
|
|
14 |
def hex(node):
|
|
15 |
return binascii.hexlify(node)
|
|
16 |
|
|
17 |
def bin(node):
|
|
18 |
return binascii.unhexlify(node)
|
|
19 |
|
|
20 |
def short(node):
|
|
21 |
return hex(node[:6])
|