[PATCH 1 of 9 STABLE] cmdutil: add the class to restore dirstate at unexpected failure easily

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Mon Oct 6 16:30:17 UTC 2014


At Wed, 01 Oct 2014 13:12:14 -0500,
Matt Mackall wrote:
> 
> On Thu, 2014-10-02 at 01:18 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1412179386 -32400
> > #      Thu Oct 02 01:03:06 2014 +0900
> > # Branch stable
> > # Node ID 91da9ccf1671d004fd4738ea99126acf103294a6
> > # Parent  a111e460318af49aeb6578cf142a63426c5e764d
> > cmdutil: add the class to restore dirstate at unexpected failure easily
> 
> This is interesting, but way too complicated for stable. And way way way
> too complicated for the last day of the release cycle.

I was also worry about complication of the series and close-ness to
the day of the release cycle, but I posted this series as "STABLE"
because of "urgent" priority of this issue.

BTW, is this approach not good, even for "default" ?


> At the sprint, we talked about build a more complex multi-file
> transaction system to address the larger issues here. There are some
> notes about that here:
> 
> https://titanpad.com/mercurial32-sprint (starting at line 123)

This is interesting !

But IMHO, "extending transaction" approach seems not to be suitable to
resolve this problem, because:

  - transaction nesting occurs in some cases (e.g. "shelve => rebase"), and

  - "dirstate" may be already modified since the beginning of outer
    transaction, then

  - dirstate should be backed up into the file other than
    "dirstate.journal" at the beginning of inner transaction, but

  - such "dirstate" backup files are useless for transaction, and
    increases complication of its implementation


"transaction" and "dirstateguard" differ from each other in "what it
should do for dirstate" in cases other than "success".

                | success | fail    | "hg rollback"
  --------------+---------+---------+---------------
  transaction   | keep    | keep    | restore
  dirstateguard | keep    | restore | (not involved)


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



More information about the Mercurial-devel mailing list