Patchwork D3751: graft: start storing new nodes formed in graftstate

login
register
mail settings
Submitter phabricator
Date June 25, 2018, 3:06 p.m.
Message ID <49c241c902966d8e7bfa37e6f6c460d7@localhost.localdomain>
Download mbox | patch
Permalink /patch/32413/
State Not Applicable
Headers show

Comments

phabricator - June 25, 2018, 3:06 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3c07e0b1f6c6: graft: start storing new nodes formed in graftstate (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3751?vs=9273&id=9280

REVISION DETAIL
  https://phab.mercurial-scm.org/D3751

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2186,6 +2186,8 @@ 
     revs.extend(opts.get('rev'))
     # a dict of data to be stored in state file
     statedata = {}
+    # list of new nodes created by ongoing graft
+    statedata['newnodes'] = []
 
     if not opts.get('user') and opts.get('currentuser'):
         opts['user'] = ui.username()
@@ -2362,6 +2364,9 @@ 
             ui.warn(
                 _('note: graft of %d:%s created no changes to commit\n') %
                 (ctx.rev(), ctx))
+        # checking that newnodes exist because old state files won't have it
+        elif statedata.get('newnodes') is not None:
+            statedata['newnodes'].append(node)
 
     # remove state when we complete successfully
     if not opts.get('dry_run'):