##// END OF EJS Templates
py3: port ext-phase-report.py extension...
Gregory Szorc -
r36061:3b4d14be default
parent child Browse files
Show More
@@ -1,22 +1,22 b''
1 # tiny extension to report phase changes during transaction
1 # tiny extension to report phase changes during transaction
2
2
3 from __future__ import absolute_import
3 from __future__ import absolute_import
4
4
5 def reposetup(ui, repo):
5 def reposetup(ui, repo):
6
6
7 def reportphasemove(tr):
7 def reportphasemove(tr):
8 for rev, move in sorted(tr.changes['phases'].iteritems()):
8 for rev, move in sorted(tr.changes[b'phases'].items()):
9 if move[0] is None:
9 if move[0] is None:
10 ui.write(('test-debug-phase: new rev %d: x -> %d\n'
10 ui.write((b'test-debug-phase: new rev %d: x -> %d\n'
11 % (rev, move[1])))
11 % (rev, move[1])))
12 else:
12 else:
13 ui.write(('test-debug-phase: move rev %d: %s -> %d\n'
13 ui.write((b'test-debug-phase: move rev %d: %d -> %d\n'
14 % (rev, move[0], move[1])))
14 % (rev, move[0], move[1])))
15
15
16 class reportphaserepo(repo.__class__):
16 class reportphaserepo(repo.__class__):
17 def transaction(self, *args, **kwargs):
17 def transaction(self, *args, **kwargs):
18 tr = super(reportphaserepo, self).transaction(*args, **kwargs)
18 tr = super(reportphaserepo, self).transaction(*args, **kwargs)
19 tr.addpostclose('report-phase', reportphasemove)
19 tr.addpostclose(b'report-phase', reportphasemove)
20 return tr
20 return tr
21
21
22 repo.__class__ = reportphaserepo
22 repo.__class__ = reportphaserepo
General Comments 0
You need to be logged in to leave comments. Login now