tests/testlib/ext-phase-report.py
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 01 Dec 2017 22:40:55 -0500
changeset 35199 80bb15769c73
parent 33459 67a3204c83c1
child 36044 3b4d14beac3d
permissions -rw-r--r--
test-lfs: drop a hack for ignoring convert devel-warnings This was fixed on stable in 281214150561.

# tiny extension to report phase changes during transaction

from __future__ import absolute_import

def reposetup(ui, repo):

    def reportphasemove(tr):
        for rev, move in sorted(tr.changes['phases'].iteritems()):
            if move[0] is None:
                ui.write(('test-debug-phase: new rev %d:  x -> %d\n'
                          % (rev, move[1])))
            else:
                ui.write(('test-debug-phase: move rev %d: %s -> %d\n'
                          % (rev, move[0], move[1])))

    class reportphaserepo(repo.__class__):
        def transaction(self, *args, **kwargs):
            tr = super(reportphaserepo, self).transaction(*args, **kwargs)
            tr.addpostclose('report-phase', reportphasemove)
            return tr

    repo.__class__ = reportphaserepo