destination: make sure 'setupdest' is the latest function in the module
Let's introduce some consistency, end of module seems fine.
--- a/hgext3rd/topic/destination.py Wed Mar 30 03:45:29 2016 -0700
+++ b/hgext3rd/topic/destination.py Wed Mar 30 03:12:43 2016 -0700
@@ -68,21 +68,6 @@
return revs.min()
return None
-def setupdest():
- if util.safehasattr(destutil, '_destmergebranch'):
- extensions.wrapfunction(destutil, '_destmergebranch', _destmergebranch)
- rebase = extensions.find('rebase')
- if (util.safehasattr(rebase, '_destrebase')
- # logic not shared with merge yet < hg-3.8
- and not util.safehasattr(rebase, '_definesets')):
- extensions.wrapfunction(rebase, '_destrebase', _destmergebranch)
- if util.safehasattr(destutil, 'destupdatesteps'):
- bridx = destutil.destupdatesteps.index('branch')
- destutil.destupdatesteps.insert(bridx, 'topic')
- destutil.destupdatestepmap['topic'] = _destupdatetopic
- if util.safehasattr(destutil, 'desthistedit'):
- extensions.wrapfunction(destutil, 'desthistedit', desthistedit)
-
def ngtip(repo, branch, all=False):
"""tip new generation"""
## search for untopiced heads of branch
@@ -100,3 +85,18 @@
if not all:
subquery = 'max(%s)' % subquery
return repo.revs(subquery, branch, branch, branch)
+
+def setupdest():
+ if util.safehasattr(destutil, '_destmergebranch'):
+ extensions.wrapfunction(destutil, '_destmergebranch', _destmergebranch)
+ rebase = extensions.find('rebase')
+ if (util.safehasattr(rebase, '_destrebase')
+ # logic not shared with merge yet < hg-3.8
+ and not util.safehasattr(rebase, '_definesets')):
+ extensions.wrapfunction(rebase, '_destrebase', _destmergebranch)
+ if util.safehasattr(destutil, 'destupdatesteps'):
+ bridx = destutil.destupdatesteps.index('branch')
+ destutil.destupdatesteps.insert(bridx, 'topic')
+ destutil.destupdatestepmap['topic'] = _destupdatetopic
+ if util.safehasattr(destutil, 'desthistedit'):
+ extensions.wrapfunction(destutil, 'desthistedit', desthistedit)