# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1465932697 -7200 # Node ID 1a4d0f1563d0b2935c981e81d519479ad3d914e1 # Parent 86ae03f889a44cac64a7ca42468fdd0e2e598d93 test_util: add utility function for logging the Subversion repository This is useful when pushing non-trivial manipulations to Subversion, as it allows you to see the actual result. diff --git a/tests/test_util.py b/tests/test_util.py --- a/tests/test_util.py +++ b/tests/test_util.py @@ -28,6 +28,7 @@ from mercurial import util as hgutil from mercurial import extensions from hgsubversion import compathacks +from hgsubversion import svnrepo from hgsubversion import svnwrap try: @@ -782,5 +783,21 @@ files: {files} commands.log(_ui, repo, rev=None, template=templ, graph=True) return _ui.popbuffer() + def svnlog(self, repo=None): + '''log of the remote Subversion repository corresponding to repo + + In order to make the format suitable for direct comparison in + tests, we exclude dates and convert the path operations into + a tuple. + ''' + + if repo is None: + repo = self.repo + + return [(r.revnum, r.message, + dict((p, (op.action, op.copyfrom_path, int(op.copyfrom_rev))) + for (p, op) in r.paths.items())) + for r in svnrepo.svnremoterepo(repo.ui).svn.revisions()] + def draw(self, repo): sys.stdout.write(self.getgraph(repo))