2017-07-12 23:39:48 +03:00
|
|
|
# tiny extension to report phase changes during transaction
|
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2020-02-05 02:26:09 +03:00
|
|
|
from edenscm.mercurial import pycompat
|
|
|
|
|
2017-07-12 23:39:48 +03:00
|
|
|
|
2018-05-30 12:16:33 +03:00
|
|
|
def reposetup(ui, repo):
|
2017-07-12 23:39:48 +03:00
|
|
|
def reportphasemove(tr):
|
2020-02-05 02:26:09 +03:00
|
|
|
for rev, move in sorted(pycompat.iteritems(tr.changes["phases"])):
|
2017-07-12 23:39:48 +03:00
|
|
|
if move[0] is None:
|
2018-05-30 12:16:33 +03:00
|
|
|
ui.write(("test-debug-phase: new rev %d: x -> %d\n" % (rev, move[1])))
|
2017-07-12 23:39:48 +03:00
|
|
|
else:
|
2018-05-30 12:16:33 +03:00
|
|
|
ui.write(
|
|
|
|
(
|
|
|
|
"test-debug-phase: move rev %d: %s -> %d\n"
|
|
|
|
% (rev, move[0], move[1])
|
|
|
|
)
|
|
|
|
)
|
2017-07-12 23:39:48 +03:00
|
|
|
|
|
|
|
class reportphaserepo(repo.__class__):
|
|
|
|
def transaction(self, *args, **kwargs):
|
|
|
|
tr = super(reportphaserepo, self).transaction(*args, **kwargs)
|
2018-05-30 12:16:33 +03:00
|
|
|
tr.addpostclose("report-phase", reportphasemove)
|
2017-07-12 23:39:48 +03:00
|
|
|
return tr
|
|
|
|
|
|
|
|
repo.__class__ = reportphaserepo
|