Patchwork D3659: graft: reuse --user and --date values in `hg graft --continue` (BC)

login
register
mail settings
Submitter phabricator
Date May 25, 2018, 9:14 p.m.
Message ID <0043092592ec1f41086a86805dd3969c@localhost.localdomain>
Download mbox | patch
Permalink /patch/31874/
State Not Applicable
Headers show

Comments

phabricator - May 25, 2018, 9:14 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdecdb587ea12: graft: reuse --user and --date values in `hg graft --continue` (BC) (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3659?vs=8899&id=8905

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-graft.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -1468,17 +1468,16 @@ 
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
-XXX: the user of 6 and 7 should be batman
   $ hg log -Gr 3::
-  @  changeset:   7:89f377552d81
+  @  changeset:   7:11a36ffaacf2
   |  tag:         tip
-  |  user:        test
+  |  user:        batman
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     added c
   |
-  o  changeset:   6:393512ff89b9
+  o  changeset:   6:76803afc6511
   |  parent:      3:9e887f7a939c
-  |  user:        test
+  |  user:        batman
   |  date:        Thu Jan 01 00:00:00 1970 +0000
   |  summary:     added b
   |
@@ -1518,18 +1517,17 @@ 
   grafting 1:80e6d2c47cfe "added b"
   grafting 2:8be98ac1a569 "added c"
 
-XXX: 8 and 9 show have the date we passed
   $ hg log -Gr '.^^::.'
-  @  changeset:   9:7ee8d3496b19
+  @  changeset:   9:1896b76e007a
   |  tag:         tip
   |  user:        test
-  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  date:        Fri Feb 13 21:18:00 2009 -0002
   |  summary:     added c
   |
-  o  changeset:   8:802f1eae3af3
+  o  changeset:   8:ce2b4f1632af
   |  parent:      3:9e887f7a939c
   |  user:        test
-  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  date:        Fri Feb 13 21:18:00 2009 -0002
   |  summary:     added b
   |
   o  changeset:   3:9e887f7a939c
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2226,7 +2226,12 @@ 
             raise error.Abort(_("can't specify --continue and revisions"))
         # read in unfinished revisions
         if graftstate.exists():
-            nodes = _readgraftstate(repo, graftstate)['nodes']
+            statedata = _readgraftstate(repo, graftstate)
+            if statedata.get('date'):
+                opts['date'] = statedata['date']
+            if statedata.get('user'):
+                opts['user'] = statedata['user']
+            nodes = statedata['nodes']
             revs = [repo[node].rev() for node in nodes]
         else:
             cmdutil.wrongtooltocontinue(repo, _('graft'))