[PATCH evolve-ext] bump: copy parent manifest before editting it

Durham Goode durham at fb.com
Mon Sep 12 13:42:38 EDT 2016


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1473702060 25200
#      Mon Sep 12 10:41:00 2016 -0700
# Node ID 3ed2adbf132201e44c642bb9811c988046dd3f83
# Parent  346de2c1b0e97e7cdf06597a4708910c0d5b5ba2
bump: copy parent manifest before editting it

Previously, the bump code would access the previous manifest, then edit that
dictionary data structure. Because the manifest was in the mancache at that
time, those edits were persisted to other readers who asked for that manifest.
This caused commits being made during bump to have the wrong file parents in
many situations (hence why the tests need updating).

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2014,7 +2014,7 @@ def _solvebumped(ui, repo, bumped, dryru
     repo.ui.status(_('computing new diff\n'))
     files = set()
     copied = copies.pathcopies(prec, bumped)
-    precmanifest = prec.manifest()
+    precmanifest = prec.manifest().copy()
     # 3.3.2 needs a list.
     # future 3.4 don't detect the size change during iteration
     # this is fishy
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -377,8 +377,8 @@ all solving bumped troubled
   recreate:[8] another feature that rox
   atop:[7] another feature (child of ba0ec09b1bab)
   computing new diff
-  committed as 2d8c5414e9f0
-  working directory is now at 2d8c5414e9f0
+  committed as 6707c5e1c49d
+  working directory is now at 6707c5e1c49d
   $ hg glog
   @  9	feature-B: bumped update to 99833d22b0c6: - test
   |
@@ -437,7 +437,7 @@ test evolve --all
   move:[11] dansk 3!
   atop:[14] dansk 2!
   merging main-file-1
-  working directory is now at 536984593824
+  working directory is now at 68557e4f0048
   $ hg glog
   @  15	: dansk 3! - test
   |
@@ -810,9 +810,9 @@ Test fold with commit messages
   2 changesets folded
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ glog
-  @  16:d1297ecc971f at default(draft) Folding with custom commit message
+  @  16:98cb758db56d at default(draft) Folding with custom commit message
   |
-  o  13:27b934eaf1f9 at default(draft) dansk!
+  o  13:0a2f9b959bb4 at default(draft) dansk!
   |
   o  7:99833d22b0c6 at default(public) another feature (child of ba0ec09b1bab)
   |
@@ -829,7 +829,7 @@ Test fold with commit messages
   2 changesets folded
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg qlog
-  17 - 0b1eca0e871b A longer
+  17 - a00182c58888 A longer
                     commit message (draft)
   7 - 99833d22b0c6 another feature (child of ba0ec09b1bab) (public)
   6 - ba0ec09b1bab a nifty feature (public)
diff --git a/tests/test-stabilize-result.t b/tests/test-stabilize-result.t
--- a/tests/test-stabilize-result.t
+++ b/tests/test-stabilize-result.t
@@ -176,10 +176,10 @@ Stabilize!
   perform evolve? [Ny] y
   rebasing to destination parent: 66719795a494
   computing new diff
-  committed as (a7cabd7bd9c2|671b9d7eeaec) (re)
-  working directory is now at (a7cabd7bd9c2|671b9d7eeaec) (re)
+  committed as c2c1151aa854
+  working directory is now at c2c1151aa854
   $ glog
-  @  14:(a7cabd7bd9c2|671b9d7eeaec)@default\(draft\) bk:\[\] bumped update to 1cf0aacfd363: (re)
+  @  14:c2c1151aa854 at default(draft) bk:[] bumped update to 1cf0aacfd363:
   |
   | o  9:7bc2f5967f5e at default(draft) bk:[] add c
   | |


More information about the Mercurial-devel mailing list