changeset 1938:7e31d3e79806

destination: make sure 'setupdest' is the latest function in the module Let's introduce some consistency, end of module seems fine.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 30 Mar 2016 03:12:43 -0700
parents 60b7de2b3dd1
children 4268fdd11b74
files hgext3rd/topic/destination.py
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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)