ANN: branchhead extension

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Oct 14 23:37:41 CDT 2009


I was inspired by a conversation on the IRC channel today to write my  
first from-scratch extension. The name is probably horrible, and on  
reflection I maybe should have just wrapped `hg heads` to add a -- 
current-branch option, but here it is.

The branchhead extension shows the head of the branch the current  
working directory is on. This is useful if your repository has  
multiple anonymous branches and you want to update to the head of the  
one you're currently on. It can also show the branch head(s) starting  
from any given revision using the -r/--rev option.

If the line of history diverges after the current revision, hg  
branchhead will show the heads of all subsequent branches.

$ hg help branchhead
hg branchhead [-r REV]

show head(s) of the branch the working directory or given revision is on

     Print the head changeset or changesets of the branch the working  
directory
     parents are on. If revision is given via -r/--rev, the head(s) of  
that
     revision's branch are printed.

     If the working directory is a merge changeset (i.e. it has two  
parents),
     this command will only show the head(s) of the first parent's  
branch. To
     show the head(s) of the second parent's branch, use --switch- 
parent.

options:

  -r --rev            show head of the branch the given revision is on
  -b --brief          only show the changeset hash(es). Equivalent to
                      --template '{node}\n'
     --switch-parent  show head of the branch the working directory's  
second
                      parent is on
     --style          display using template map file
     --template       display with template

use "hg -v help branchhead" to show global options


Pacem in terris / Mir / Shanti / Salaam / Heiwa
Pacem in terris / Mir / Shanti / Salaam / Heiwa
Kevin R. Bullock




More information about the Mercurial mailing list