Mercurial > public > mercurial-scm > hg-stable
diff hgext/rebase.py @ 42977:43c84b816445
rebase: track new nodes when --keep is set
When --keep is passed with rebase, the new nodes created are not
accessible from templates.
This change enables accessing the newly-created nodes from nodechanges,
just as if --keep was not set.
Differential Revision: https://phab.mercurial-scm.org/D6880
author | Paul Gossman <pgossman@janestreet.com> |
---|---|
date | Wed, 25 Sep 2019 10:59:29 -0400 |
parents | 35ebdbb38efb |
children | 2372284d9457 |
line wrap: on
line diff
--- a/hgext/rebase.py Sat Sep 21 13:42:23 2019 -0400 +++ b/hgext/rebase.py Wed Sep 25 10:59:29 2019 -0400 @@ -1783,20 +1783,18 @@ oldnode = tonode(rev) newnode = collapsedas or tonode(newrev) moves[oldnode] = newnode - if not keepf: - succs = None - if rev in skipped: - if stripcleanup or not repo[rev].obsolete(): - succs = () - elif collapsedas: - collapsednodes.append(oldnode) - else: - succs = (newnode,) - if succs is not None: - replacements[(oldnode,)] = succs + succs = None + if rev in skipped: + if stripcleanup or not repo[rev].obsolete(): + succs = () + elif collapsedas: + collapsednodes.append(oldnode) + else: + succs = (newnode,) + if succs is not None: + replacements[(oldnode,)] = succs if collapsednodes: replacements[tuple(collapsednodes)] = (collapsedas,) - scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup) if fm: hf = fm.hexfunc fl = fm.formatlist @@ -1807,6 +1805,9 @@ changes[hf(oldn)] = fl([hf(n) for n in newn], name='node') nodechanges = fd(changes, key="oldnode", value="newnodes") fm.data(nodechanges=nodechanges) + if keepf: + replacements = {} + scmutil.cleanupnodes(repo, replacements, 'rebase', moves, backup=backup) def pullrebase(orig, ui, repo, *args, **opts): 'Call rebase after pull if the latter has been invoked with --rebase'