hgext3rd/evolve/evolvecmd.py
changeset 4610 c54d4c2c2846
parent 4608 fe22c36b5563
child 4611 c3fb96f9c8de
equal deleted inserted replaced
4609:fe2999627556 4610:c54d4c2c2846
    62         bool: a boolean value indicating whether the instability was solved
    62         bool: a boolean value indicating whether the instability was solved
    63         newnode: if bool is True, then the newnode of the resultant commit
    63         newnode: if bool is True, then the newnode of the resultant commit
    64                  formed. newnode can be node, when resolution led to no new
    64                  formed. newnode can be node, when resolution led to no new
    65                  commit. If bool is False, this is ".".
    65                  commit. If bool is False, this is ".".
    66     """
    66     """
       
    67     tr = repo.currenttransaction()
       
    68     assert tr is not None
    67     displayer = None
    69     displayer = None
    68     if stacktmplt:
    70     if stacktmplt:
    69         displayer = compat.changesetdisplayer(ui, repo,
    71         displayer = compat.changesetdisplayer(ui, repo,
    70                                               {'template': stacktemplate})
    72                                               {'template': stacktemplate})
    71     else:
    73     else:
    72         displayer = compat.changesetdisplayer(ui, repo,
    74         displayer = compat.changesetdisplayer(ui, repo,
    73                                               {'template': shorttemplate})
    75                                               {'template': shorttemplate})
    74     with repo.wlock(), repo.lock():
    76     if 'orphan' == category:
    75         tr = repo.transaction("evolve")
    77         result = _solveunstable(ui, repo, ctx, evolvestate, displayer,
    76         with util.acceptintervention(tr):
    78                                 dryrun, confirm, progresscb,
    77             if 'orphan' == category:
    79                                 lastsolved=lastsolved)
    78                 result = _solveunstable(ui, repo, ctx, evolvestate, displayer,
    80     elif 'phasedivergent' == category:
    79                                         dryrun, confirm, progresscb,
    81         result = _solvephasedivergence(ui, repo, ctx, evolvestate,
    80                                         lastsolved=lastsolved)
    82                                        displayer, dryrun, confirm,
    81             elif 'phasedivergent' == category:
    83                                        progresscb)
    82                 result = _solvephasedivergence(ui, repo, ctx, evolvestate,
    84     elif 'contentdivergent' == category:
    83                                                displayer, dryrun, confirm,
    85         result = _solvedivergent(ui, repo, ctx, evolvestate, displayer,
    84                                                progresscb)
    86                                  dryrun, confirm, progresscb)
    85             elif 'contentdivergent' == category:
    87     else:
    86                 result = _solvedivergent(ui, repo, ctx, evolvestate, displayer,
    88         assert False, "unknown trouble category: %s" % (category)
    87                                          dryrun, confirm, progresscb)
    89     return result
    88             else:
       
    89                 assert False, "unknown trouble category: %s" % (category)
       
    90             return result
       
    91 
    90 
    92 def _solveunstable(ui, repo, orig, evolvestate, displayer, dryrun=False,
    91 def _solveunstable(ui, repo, orig, evolvestate, displayer, dryrun=False,
    93                    confirm=False, progresscb=None, lastsolved=None):
    92                    confirm=False, progresscb=None, lastsolved=None):
    94     """ Tries to stabilize the changeset orig which is orphan.
    93     """ Tries to stabilize the changeset orig which is orphan.
    95 
    94