RFC: Fix for issue 1827 (v2)

Benoit Boissinot benoit.boissinot at ens-lyon.org
Mon Feb 15 17:34:37 CST 2010


On Mon, Feb 15, 2010 at 11:30:23PM +0100, Sune Foldager wrote:
> Here is another version which doesn't have the race condition. The
> problem with this one, IMO, is style.. it's a bit annoying to refer to
> variables that aren't set on the same level, but that you semantically
> know are set at this point :-p
> 
> # HG changeset patch
> # User Sune Foldager <cryo at cyanite.org>
> # Date 1266272885 -3600
> # Branch stable
> # Node ID 09b5f6ecea662e89520ca1ce0317367293386942
> # Parent  44b4a2a3162319ef6d21c9e9f191ecf2c42ea609
> run commit and update hooks after command completion (issue1827)
> 
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -862,11 +862,13 @@
>              self.dirstate.setparents(ret)
>              ms.reset()
> 
> -            return ret
> -
>          finally:
>              wlock.release()
> 
> +        self.hook("commit", node=hex(ret), parent1=hex(p1),
> +                  parent2=(p2 != nullid and hex(p2) or ''))
> +        return ret
> +

I don't think we should move the hook up one level, every other commit
related hook is fired on commitctx, why should it be different for this
one?

cheers,

Benoit

-- 
:wq


More information about the Mercurial-devel mailing list