Mercurial > hg-git
comparison hggit/git_handler.py @ 1135:c4703246f350
compat: mark all compat-checking locations outside hggit.compat with "COMPAT:"
The format is:
# COMPAT: hg X.Y - description of change that affects this block
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Fri, 02 Feb 2018 13:41:42 -0600 |
parents | 6141895a53c9 |
children | 7fd9ee0f7b66 |
comparison
equal
deleted
inserted
replaced
1134:d75d704772d1 | 1135:c4703246f350 |
---|---|
322 changes = [(rhead + suffix, rnode)] | 322 changes = [(rhead + suffix, rnode)] |
323 util.updatebookmarks(self.repo, changes) | 323 util.updatebookmarks(self.repo, changes) |
324 bms = [rhead + suffix] | 324 bms = [rhead + suffix] |
325 | 325 |
326 if bms: | 326 if bms: |
327 # COMPAT: hg 3.5 - bookmarks.setcurrent renamed to activate | |
327 try: | 328 try: |
328 bookmarks.activate(self.repo, bms[0]) | 329 bookmarks.activate(self.repo, bms[0]) |
329 except AttributeError: | 330 except AttributeError: |
330 # hg < 3.5 | |
331 bookmarks.setcurrent(self.repo, bms[0]) | 331 bookmarks.setcurrent(self.repo, bms[0]) |
332 | 332 |
333 self.save_map(self.map_file) | 333 self.save_map(self.map_file) |
334 | 334 |
335 # also mark public any branches the user specified | 335 # also mark public any branches the user specified |
340 | 340 |
341 if blist: | 341 if blist: |
342 lock = self.repo.lock() | 342 lock = self.repo.lock() |
343 try: | 343 try: |
344 tr = self.repo.transaction("phase") | 344 tr = self.repo.transaction("phase") |
345 # COMPAT: hg 3.2 - advanceboundary uses transaction | |
345 try: | 346 try: |
346 phases.advanceboundary(self.repo, tr, phases.public, | 347 phases.advanceboundary(self.repo, tr, phases.public, |
347 blist) | 348 blist) |
348 except TypeError: | 349 except TypeError: |
349 # hg < 3.2 | |
350 phases.advanceboundary(self.repo, phases.public, | 350 phases.advanceboundary(self.repo, phases.public, |
351 blist) | 351 blist) |
352 tr.close() | 352 tr.close() |
353 finally: | 353 finally: |
354 if tr is not None: | 354 if tr is not None: |
968 info = files.get(f) | 968 info = files.get(f) |
969 if info is not None: | 969 if info is not None: |
970 # it's a file reported as modified from Git | 970 # it's a file reported as modified from Git |
971 delete, mode, sha = info | 971 delete, mode, sha = info |
972 if delete: | 972 if delete: |
973 # COMPAT: hg 3.2 - expects this function to return | |
974 # None for missing files | |
973 if getattr(memctx, '_returnnoneformissingfiles', False): | 975 if getattr(memctx, '_returnnoneformissingfiles', False): |
974 return None | 976 return None |
975 else: # Mercurial < 3.2 | 977 else: # Mercurial < 3.2 |
976 raise IOError | 978 raise IOError |
977 | 979 |
1150 tip = self.repo.lookup('tip') | 1152 tip = self.repo.lookup('tip') |
1151 if tip != nullid: | 1153 if tip != nullid: |
1152 if 'capabilities^{}' in new_refs: | 1154 if 'capabilities^{}' in new_refs: |
1153 del new_refs['capabilities^{}'] | 1155 del new_refs['capabilities^{}'] |
1154 tip = hex(tip) | 1156 tip = hex(tip) |
1157 # COMPAT: hg 1.8 - bookmarks extension moved to core | |
1155 try: | 1158 try: |
1156 commands.bookmark(self.ui, self.repo, 'master', | 1159 commands.bookmark(self.ui, self.repo, 'master', |
1157 rev=tip, force=True) | 1160 rev=tip, force=True) |
1158 except NameError: | 1161 except NameError: |
1159 bookmarks.bookmark(self.ui, self.repo, 'master', | 1162 bookmarks.bookmark(self.ui, self.repo, 'master', |
1160 rev=tip, force=True) | 1163 rev=tip, force=True) |
1164 # COMPAT: hg 3.5 - bookmarks.setcurrent renamed to activate | |
1161 try: | 1165 try: |
1162 bookmarks.activate(self.repo, 'master') | 1166 bookmarks.activate(self.repo, 'master') |
1163 except AttributeError: | 1167 except AttributeError: |
1164 # hg < 3.5 | |
1165 bookmarks.setcurrent(self.repo, 'master') | 1168 bookmarks.setcurrent(self.repo, 'master') |
1166 new_refs['refs/heads/master'] = self.map_git_get(tip) | 1169 new_refs['refs/heads/master'] = self.map_git_get(tip) |
1167 | 1170 |
1168 # mapped nodes might be hidden | 1171 # mapped nodes might be hidden |
1169 unfiltered = self.repo.unfiltered() | 1172 unfiltered = self.repo.unfiltered() |