Mercurial > evolve
comparison hgext3rd/topic/destination.py @ 3142:28e501581dc7
compat: drop support for 3.8's '_destrebase' function
We no longer support this version.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 24 Oct 2017 14:12:37 +0200 |
parents | b18d2b2f18a6 |
children | f7f8fcbed02c |
comparison
equal
deleted
inserted
replaced
3141:f9faa5b6f937 | 3142:28e501581dc7 |
---|---|
4 from mercurial import ( | 4 from mercurial import ( |
5 bookmarks, | 5 bookmarks, |
6 destutil, | 6 destutil, |
7 error, | 7 error, |
8 extensions, | 8 extensions, |
9 util, | |
10 ) | 9 ) |
11 from . import topicmap | 10 from . import topicmap |
12 from .evolvebits import builddependencies | 11 from .evolvebits import builddependencies |
13 | 12 |
14 def _destmergebranch(orig, repo, action='merge', sourceset=None, | 13 def _destmergebranch(orig, repo, action='merge', sourceset=None, |
98 else: | 97 else: |
99 return [tmap.branchtip(branch)] | 98 return [tmap.branchtip(branch)] |
100 | 99 |
101 def modsetup(ui): | 100 def modsetup(ui): |
102 """run a uisetup time to install all destinations wrapping""" | 101 """run a uisetup time to install all destinations wrapping""" |
103 if util.safehasattr(destutil, '_destmergebranch'): | 102 extensions.wrapfunction(destutil, '_destmergebranch', _destmergebranch) |
104 extensions.wrapfunction(destutil, '_destmergebranch', _destmergebranch) | 103 bridx = destutil.destupdatesteps.index('branch') |
105 try: | 104 destutil.destupdatesteps.insert(bridx, 'topic') |
106 rebase = extensions.find('rebase') | 105 destutil.destupdatestepmap['topic'] = _destupdatetopic |
107 except KeyError: | 106 extensions.wrapfunction(destutil, 'desthistedit', desthistedit) |
108 rebase = None | |
109 | |
110 # Mercurial 4.4 rename _definesets into _definedestmap | |
111 rebasebefore38 = not util.safehasattr(rebase, '_definesets') | |
112 rebasebefore44 = not util.safehasattr(rebase, '_definedestmap') | |
113 | |
114 if (util.safehasattr(rebase, '_destrebase') | |
115 # logic not shared with merge yet < hg-3.8 | |
116 and rebasebefore38 and rebasebefore44): | |
117 extensions.wrapfunction(rebase, '_destrebase', _destmergebranch) | |
118 if util.safehasattr(destutil, 'destupdatesteps'): | |
119 bridx = destutil.destupdatesteps.index('branch') | |
120 destutil.destupdatesteps.insert(bridx, 'topic') | |
121 destutil.destupdatestepmap['topic'] = _destupdatetopic | |
122 if util.safehasattr(destutil, 'desthistedit'): | |
123 extensions.wrapfunction(destutil, 'desthistedit', desthistedit) |