[PATCH 1 of 2] rebase: drop redundant functions to keep branch and graft source explicitly

Yuya Nishihara yuya at tcha.org
Sun Dec 6 15:24:24 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1449326902 -32400
#      Sat Dec 05 23:48:22 2015 +0900
# Node ID 0b93ef8a1c3e8f9394776ecada576fb608162dc3
# Parent  95adb7bad8aa2d7bee699aeaacf0372ed23041b5
rebase: drop redundant functions to keep branch and graft source explicitly

All entries in extra dict are propagated by default since 88fde8db5307.

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -47,17 +47,6 @@ testedwith = 'internal'
 def _nothingtorebase():
     return 1
 
-def _savegraft(ctx, extra):
-    s = ctx.extra().get('source', None)
-    if s is not None:
-        extra['source'] = s
-    s = ctx.extra().get('intermediate-source', None)
-    if s is not None:
-        extra['intermediate-source'] = s
-
-def _savebranch(ctx, extra):
-    extra['branch'] = ctx.branch()
-
 def _makeextrafn(copiers):
     """make an extrafn out of the given copy-functions.
 
@@ -228,7 +217,7 @@ def rebase(ui, repo, **opts):
         collapsemsg = cmdutil.logmessage(ui, opts)
         date = opts.get('date', None)
         e = opts.get('extrafn') # internal, used by e.g. hgsubversion
-        extrafns = [_savegraft]
+        extrafns = []
         if e:
             extrafns = [e]
         keepf = opts.get('keep', False)
@@ -398,10 +387,6 @@ def rebase(ui, repo, **opts):
                 ui.status(_('reopening closed branch head %s\n') % dest)
 
         if keepbranchesf:
-            # insert _savebranch at the start of extrafns so if
-            # there's a user-provided extrafn it can clobber branch if
-            # desired
-            extrafns.insert(0, _savebranch)
             if collapsef:
                 branches = set()
                 for rev in state:


More information about the Mercurial-devel mailing list