[PATCH topic-ext] compat: tolerate missing rebase extension

timeless timeless at fmr.im
Fri Jul 8 13:01:26 EDT 2016


# HG changeset patch
# User timeless at gmail.com
# Date 1467997183 0
#      Fri Jul 08 16:59:43 2016 +0000
# Node ID 3966e3562da5738339d5a5aad138b9ce33d37734
# Parent  c5d4e856ad0e971e055913269acc5a6a313d3c2e
compat: tolerate missing rebase extension

diff -r c5d4e856ad0e -r 3966e3562da5 hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py	Wed May 11 16:22:52 2016 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Jul 08 16:59:43 2016 +0000
@@ -320,8 +320,11 @@
     def newmakeextrafn(orig, copiers):
         return orig(copiers + [savetopic])
 
-    rebase = extensions.find("rebase")
-    extensions.wrapfunction(rebase, '_makeextrafn', newmakeextrafn)
+    try:
+        rebase = extensions.find("rebase")
+        extensions.wrapfunction(rebase, '_makeextrafn', newmakeextrafn)
+    except KeyError:
+        pass
 
 ## preserve topic during import/export
 
diff -r c5d4e856ad0e -r 3966e3562da5 hgext3rd/topic/destination.py
--- a/hgext3rd/topic/destination.py	Wed May 11 16:22:52 2016 +0200
+++ b/hgext3rd/topic/destination.py	Fri Jul 08 16:59:43 2016 +0000
@@ -94,7 +94,10 @@
     """run a uisetup time to install all destinations wrapping"""
     if util.safehasattr(destutil, '_destmergebranch'):
         extensions.wrapfunction(destutil, '_destmergebranch', _destmergebranch)
-    rebase = extensions.find('rebase')
+    try:
+        rebase = extensions.find('rebase')
+    except KeyError:
+        rebase = None
     if (util.safehasattr(rebase, '_destrebase')
             # logic not shared with merge yet < hg-3.8
             and not util.safehasattr(rebase, '_definesets')):


More information about the Mercurial-devel mailing list