rebase: backout changeset
d755a9531fce
This is a dependency for a future backout of
88fde8db5307.
See the previous patches for why.
--- a/hgext/rebase.py Wed Feb 03 09:23:52 2016 -0800
+++ b/hgext/rebase.py Wed Feb 03 09:24:47 2016 -0800
@@ -47,6 +47,17 @@
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.
@@ -208,7 +219,7 @@
collapsemsg = cmdutil.logmessage(ui, opts)
date = opts.get('date', None)
e = opts.get('extrafn') # internal, used by e.g. hgsubversion
- extrafns = []
+ extrafns = [_savegraft]
if e:
extrafns = [e]
keepf = opts.get('keep', False)
@@ -398,6 +409,10 @@
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: