# HG changeset patch # User Kevin Bullock # Date 1518064648 21600 # Node ID 583ac3ddd54b02a0d69b86d743887bfdb99e457f # Parent 8e03a8ba04afc1ebeb65e307c5345e3dec56ebd1 compat: extract function for differing phases.advanceboundary args diff -r 8e03a8ba04af -r 583ac3ddd54b hggit/compat.py --- a/hggit/compat.py Wed Feb 07 22:30:17 2018 -0600 +++ b/hggit/compat.py Wed Feb 07 22:37:28 2018 -0600 @@ -1,6 +1,7 @@ from mercurial import ( bookmarks, context, + phases, url, util as hgutil, ) @@ -75,6 +76,13 @@ else: activatebookmark = bookmarks.setcurrent +def advancephaseboundary(repo, tr, targetphase, nodes): + # hg 3.2 - advanceboundary uses transaction + try: + phases.advanceboundary(repo, tr, targetphase, nodes) + except TypeError: + phases.advanceboundary(repo, targetphase, nodes) + try: import dulwich.client diff -r 8e03a8ba04af -r 583ac3ddd54b hggit/git_handler.py --- a/hggit/git_handler.py Wed Feb 07 22:30:17 2018 -0600 +++ b/hggit/git_handler.py Wed Feb 07 22:37:28 2018 -0600 @@ -337,13 +337,8 @@ lock = self.repo.lock() try: tr = self.repo.transaction("phase") - # COMPAT: hg 3.2 - advanceboundary uses transaction - try: - phases.advanceboundary(self.repo, tr, phases.public, - blist) - except TypeError: - phases.advanceboundary(self.repo, phases.public, - blist) + compat.advancephaseboundary(self.repo, tr, phases.public, + blist) tr.close() finally: if tr is not None: