[PATCH 3 of 3 STABLE?] cmdutil: delay examination of dirstate parents until editor invocation

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Tue Nov 24 10:32:55 CST 2015


At Sun, 22 Nov 2015 17:13:44 -0800,
Pierre-Yves David wrote:
> 
> 
> 
> On 11/17/2015 07:26 AM, FUJIWARA Katsunori wrote:
> > On the other hand, patch #1 is still useful for 3rd party extensions,
> > which invoke 'repo.commit()' directly without acquisition of
> > wlock/(s)lock and expect it to refer recent 'dirstate.parents()'
> > correctly.
> >
> > Of course, ignoring such case is also reasonable, because Python API
> > is non-official and no-warranty :-)
> 
> What are the actual cost and consequence of patch #1

I'll post revised patches below:

  - #1: surround whole 'commands.commit()' with wlock and (s)lock to
        ensure consistency between working parents, changelog, head
        detection and so on

        this fixes almost all of issue4368, except for "overlooking
        changes of .hg/dirstate".

        (STABLE)

  - #2: acquire also (s)lock at the beginning of 'repo.commit()' to
        ensure consistency between working parents and changelog

        This is replacement of #1 in V1 series, and avoids
        issue4368-like ones for extensions using 'repo.commit()'
        without (s)lock.

        (DEFAULT, maybe)


> -- 
> Pierre-Yves David
> 

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list