[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    Re: How check if committing the result of a branch merge?
From:       Pierre-Yves David <pierre-yves.david () logilab ! fr>
Date:       2012-03-30 13:55:43
Message-ID: 20120330135543.GA30906 () crater2 ! logilab ! fr
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Fri, Mar 30, 2012 at 03:52:16PM +0200, Alan Franzoni wrote:
> In my extension I'm currently doing something like that:
> 
> def wrapped_commit(orig, ui, repo, *args, **kwargs):
>    ....
> 
> def extsetup():
>     extensions.wrapcommand(commands.table, "commit", wrapped_commit)
> 
> 
> in order to intercept a commit call.
> 
> I'd need to differentiate whether it's a "normal" commit or whether
> we're committing the result of a merge - that's because I can't add
> excludes/includes/parameter in such an event, and I'd just like to
> disable my extension.
> 
> Is there any way to achieve that?

You can check that the second parent of the working directory is nullrev. and their branch otherwise.

repo[None].p1().branch()
repo[None].p2().branch()



> 
> -- 
> Latest blog post: Deploying WAR on Heroku http://t.co/M4krW2Mu
> contact me at public@[mysurname].eu
> _______________________________________________
> Mercurial mailing list
> Mercurial@selenic.com
> http://selenic.com/mailman/listinfo/mercurial

-- 
Pierre-Yves David

http://www.logilab.fr/


["signature.asc" (application/pgp-signature)]

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic