[PATCH] commands: add support for 'hg log -b .' (issue2078)

Steve Losh steve at stevelosh.com
Wed Apr 14 20:14:16 CDT 2010


On Apr 14, 2010, at 7:52 AM, Sune Foldager wrote:

> On 14-04-2010 13:49, Benoit Boissinot wrote:
>> On Wed, Apr 14, 2010 at 01:31:56PM +0200, Sune Foldager wrote:
>>> On 14-04-2010 13:27, Benoit Boissinot wrote:
>>>> Could the algorithm be like:
>>>> 
>>>> pull:
>>>> -----
>>>> 
>>>> if b not in remoterepo.branchmap:
>>>>   b = localrepo[b].branch()
>>>> revs = remoterepo.branchmap[b]
>>>> 
>>>> push:
>>>> -----
>>>> 
>>>> if b not in localrepo.branchmap:
>>>>   b = localrepo[b].branch()
>>>> revs = localrepo.branchmap[b]
>>> 
>>> Currently, I believe the algorithm is:
>>> 
>>> if not in branchmap, use directly as rev
>>> 
>>> for both operations. I am not sure I like your pull suggestion
>>> above, since (ignoring the . special case) all lookups are remote.
>> 
>> Is there a useful usecase where you want to know the branch name of a
>> remote rev?
> 
> No... in all honesty, I think I would prefer -b foo to fail for unknown branch foo (but still keep .)

I tend agree with this.  The help for 'log -b' says:

    -b --only-branch   show only changesets within the given named branch

The help for 'push/pull -b' says:

    -b --branch     a specific branch you would like to push/pull

Neither of them says "a revision whose branch you would like to pull."

To me, allowing arbitrary revision numbers/tags/etc complicates things.  The option is '--branch' so it should take a branch (and a simple '.' shortcut that means "the output of 'hg branch'").

On another note, why does log use --only-branch when the others use --branch?

> 
> /Sune
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list