comparison hggit/compat.py @ 1140:583ac3ddd54b

compat: extract function for differing phases.advanceboundary args
author Kevin Bullock <kbullock@ringworld.org>
date Wed, 07 Feb 2018 22:37:28 -0600
parents 8e03a8ba04af
children 56a3fc2086b3
comparison
equal deleted inserted replaced
1139:8e03a8ba04af 1140:583ac3ddd54b
1 from mercurial import ( 1 from mercurial import (
2 bookmarks, 2 bookmarks,
3 context, 3 context,
4 phases,
4 url, 5 url,
5 util as hgutil, 6 util as hgutil,
6 ) 7 )
7 8
8 try: 9 try:
72 # bookmarks.setcurrent was renamed to activate in hg 3.5 73 # bookmarks.setcurrent was renamed to activate in hg 3.5
73 if hgutil.safehasattr(bookmarks, 'activate'): 74 if hgutil.safehasattr(bookmarks, 'activate'):
74 activatebookmark = bookmarks.activate 75 activatebookmark = bookmarks.activate
75 else: 76 else:
76 activatebookmark = bookmarks.setcurrent 77 activatebookmark = bookmarks.setcurrent
78
79 def advancephaseboundary(repo, tr, targetphase, nodes):
80 # hg 3.2 - advanceboundary uses transaction
81 try:
82 phases.advanceboundary(repo, tr, targetphase, nodes)
83 except TypeError:
84 phases.advanceboundary(repo, targetphase, nodes)
77 85
78 86
79 try: 87 try:
80 import dulwich.client 88 import dulwich.client
81 FetchPackResult = dulwich.client.FetchPackResult 89 FetchPackResult = dulwich.client.FetchPackResult