[PATCH] Have verbose flag print the changeset hash when committing

Douglas Philips dgou at mac.com
Fri Aug 22 09:08:24 CDT 2008


On or about 2008 Aug 22, at 8:30 AM, Adrian Buehlmann indite:
> Good idea. Just two things:
>
> 1) Why not using ui.status right away instead of ui.note? I think  
> having that
> 'committed changeset xx' output line even without specifying -v  
> would be fine.

I'm indifferent, and if it always comes out, won't that put a huge  
monkey wrench in the test scripts?
Even as it is with coming out on -v... which is not why I wanted a  
separate switch, but in retrospect
a separate switch would minimize the test script impact...

> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -590,11 +590,13 @@
>     parents = cl.parentrevs(rev)
>     if rev - 1 in parents:
>         # one of the parents was the old tip
> -        return
> -    if (parents == (nullrev, nullrev) or
> -        len(cl.heads(cl.node(parents[0]))) > 1 and
> -        (parents[1] == nullrev or  
> len(cl.heads(cl.node(parents[1]))) > 1)):
> -        ui.status(_('created new head\n'))
> +        pass
> +    else:
> +        if (parents == (nullrev, nullrev) or
> +            len(cl.heads(cl.node(parents[0]))) > 1 and
> +            (parents[1] == nullrev or  
> len(cl.heads(cl.node(parents[1]))) > 1)):
> +            ui.status(_('created new head\n'))
> +    ui.status(_('committed changeset %s\n') % short(node))

Making an if clause of "pass" to me indicates the test should just be  
inverted:
if rev - 1 not in parents:
     ....


--Doug



More information about the Mercurial-devel mailing list