Possible to filter branch by name?

Matt Mackall mpm at selenic.com
Wed Nov 6 15:52:21 CST 2013


On Wed, 2013-11-06 at 17:46 +0100, Mads Kiilerich wrote:
> On 11/06/2013 05:01 PM, Matthias Tietz wrote:
> >
> > Hi,
> >
> > Is it possible to search for a branch name via command line by using 
> > pattern? We are using named branches for every official release. After 
> > releasing the named branch will be closed.
> >
> > We have a naming convention for our branches. Something like 
> > "1.0.0_CustomerA". I am just interested on all branches from "customer 
> > A" which are not closed.
> >
> 
> No. Named branches were designed to have a small and static amount of 
> branches, and adding search functionality for that would be a bit odd.

Yes, we have lots of crazy features buried in revsets:

$ hg help revsets
...
    "branch(string or set)"
      All changesets belonging to the given branch or the branches of the
      given changesets.

      If "string" starts with "re:", the remainder of the name is treated as a
      regular expression. To match a branch that actually starts with "re:",
      use the prefix "literal:".

$ hg log -r "heads(branch('re:CustomerA'))"



> So the best solution is something like:
> hg branches -q | grep CustomerA
> 
> /Mads
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list