evolve: make sure div resolution don't replace the initial author (issue6113) stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Wed, 10 Apr 2019 15:37:29 +0200
branchstable
changeset 4483 7978230faa32
parent 4482 ee7e4e05ce44
child 4484 302cd64f71e1
evolve: make sure div resolution don't replace the initial author (issue6113) Before this patch, divergence resolution logic taking the current user who is running the resolution command as the author of commit that will be created after merging the two divergent csets. This patch make sure that we preserve the initial author. Changes in test file reflect the fixed behaviour.
CHANGELOG
hgext3rd/evolve/evolvecmd.py
tests/test-evolve-content-divergence-meta.t
tests/test-sharing.t
--- a/CHANGELOG	Wed Apr 10 15:26:41 2019 +0200
+++ b/CHANGELOG	Wed Apr 10 15:37:29 2019 +0200
@@ -10,6 +10,8 @@
   * touch: fix error message when touching public changesets
   * evolve: make sure the extensions are only active on repository that
             enables it. Double check your server configuration (issue6057)
+  * evolve: make sure divergence resolution don't replace the initial author
+            (issue6113)
 
 8.4.0 -- 2019-12-22
 -------------------
--- a/hgext3rd/evolve/evolvecmd.py	Wed Apr 10 15:26:41 2019 +0200
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Apr 10 15:37:29 2019 +0200
@@ -560,7 +560,7 @@
 
         mergehook(repo, base, divergent, other)
 
-        newnode = repo.commit(text=desc, user=repo.ui.username())
+        newnode = repo.commit(text=desc, user=other.user())
         if newnode == divergent.node() or newnode is None:
             # no changes
             new = divergent
--- a/tests/test-evolve-content-divergence-meta.t	Wed Apr 10 15:26:41 2019 +0200
+++ b/tests/test-evolve-content-divergence-meta.t	Wed Apr 10 15:37:29 2019 +0200
@@ -89,14 +89,14 @@
   updating to "local" side of the conflict: 0c9267e23c9d
   merging "other" content-divergent changeset '6c06cda6dc99'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 7d41fb83d892
+  working directory is now at 443bd2972210
 
 Make sure resultant cset don't replace the initial user with user running the command:
   $ hg log -r tip
-  changeset:   5:7d41fb83d892
+  changeset:   5:443bd2972210
   tag:         tip
   parent:      1:1740ad2a1eda
-  user:        bar <bar@test.com>
+  user:        foo <foo@test.com>
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     added c e
   
--- a/tests/test-sharing.t	Wed Apr 10 15:26:41 2019 +0200
+++ b/tests/test-sharing.t	Wed Apr 10 15:37:29 2019 +0200
@@ -517,12 +517,12 @@
   base: [4] fix bug 24 (v1)
   merging "other" content-divergent changeset 'e3f99ce9d9cd'
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 711ede2d7a26
+  working directory is now at b1499b0f03ca
   $ hg log -q -r 'contentdivergent()'
 
 Figure SG10: Bob's repository after fixing divergence.
   $ hg --hidden shortlog -G -r 3::
-  @  7:711ede2d7a26  draft  fix bug 24 (v2 by bob)
+  @  7:b1499b0f03ca  draft  fix bug 24 (v2 by bob)
   |
   | x  6:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
   |/
@@ -533,7 +533,7 @@
   o  3:a06ec1bf97bd  public  fix bug 15 (v2)
   |
   ~
-  $ hg --hidden shortlog -r 'precursors(711ede2d7a26)'
+  $ hg --hidden shortlog -r 'precursors(b1499b0f03ca)'
   5:a360947f6faf  draft  fix bug 24 (v2 by bob)
   6:e3f99ce9d9cd  draft  fix bug 24 (v2 by alice)
   $ cat file1