##// END OF EJS Templates
commands: add more robust support for 'hg log -b' (issue2078)...
commands: add more robust support for 'hg log -b' (issue2078) Fixes issue2078 and adds tests to cover various 'hg log -b' uses. This change adds a localrepo.lookupbranch(key, remote=None) function. This will look up the branch of the revision with the given key. The algorithm works like this: * If a remote repo is given and KEY is the name of a branch in that repo, return KEY. * If no remote repo is given and KEY is the name of a branch in the local repo object, return KEY. * Otherwise look up the revision with the identifier KEY in the local repo and return its branch. This change also makes 'hg log -b' use this new functionality and adds a few tests for it.

File last commit:

r10263:25e57239 stable
r10960:ca739acf default
Show More
node.py
18 lines | 449 B | text/x-python | PythonLexer
# node.py - basic nodeid manipulation for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import binascii
nullrev = -1
nullid = "\0" * 20
# This ugly style has a noticeable effect in manifest parsing
hex = binascii.hexlify
bin = binascii.unhexlify
def short(node):
return hex(node[:6])