changeset 52140:c33734fbcd4b

branching: merge stable into default
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 28 Oct 2024 11:45:02 +0100
parents cf8d029a480b (current diff) f730ee8a7ae0 (diff)
children b53ab03e2d1a d57593030416
files mercurial/obsolete.py
diffstat 6 files changed, 100 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsigs	Sun Oct 27 17:29:18 2024 -0400
+++ b/.hgsigs	Mon Oct 28 11:45:02 2024 +0100
@@ -265,3 +265,4 @@
 6454c117c6a4003f07d8f4281dd90038955123e4 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmZ5VPwZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZViKTDACHBmM/CIGubatSitQIqne6mdlMya2iOYnOjV/G718WbndpV2jPNoLVMtjWQVGPbjxDvHSgFSeatXAl/6ucwEIunf+nUuuzM/LD+Di9ScXGOB1NJwEQXaYy1owHElfljotLho5ADL1QeHk04/bDR8WXZvAWvHzXZBHC884Vptbb9H5gnt2AiwcOPoZieq2bAiXLjWcNHazcrp+3e7w4Bw2hXmAMB8h5VKLkL3v3ozJwVfaOP0AHoO6vQNRNswo/Ozo4jriGhLJWs/rHRNJ8lRkwAUv3orH9TfDs47YClfFxEP5nSQHDZsiuDWC+1rh7jVTkoBj2ImzH5346iOz3sR1yAcRI327qRYtwFkXpRrTxxWhUzUV/tb2PO4Y5z/vCPFblJ3qFTMo3r9gFrrm61LJ17csfa1Pr/awIJwcV3A4dV0b2BHYrlxANoaCmRwe59rZwCRLYDwCDXur9Cxc+lzej2MMX6FuRwMlBrmYCdKkzvSBC1jkaEDzIIoSv3jEuYMw=
 11f41248595b6dd7e0fbb434ecbf75c418785a4c 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmaMCxwZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVlMoDACcrbfC4scbkzar7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MbbjQrcSmIkoNwNjHgY88QaWUPExbmuyWYQ+u33usfSv2EIVGZiMb0AADAQw6TezWlkk3hWMYBuhFkSUs6KeNuLitUzSiMogg25ryblTYhMqeylTbbzD+OK/oyBKlC41qB88J/TQb8z1IAHM9WFIBhnCWTjvGGa7TKNQh0YE3tNH3E2FDEif07eDQggB1iJGJg+wtihyFaRK2EF36E7Sql1S+86WiPHUsqjYwxIpgq4R7xv3A==
+eae3ec345e5e62e653de32a87a70f6fa7241afde 0 iQHNBAABCgA3FiEEH2b4zfZU6QXBHaBhoR4BzQ4F2VYFAmcfahkZHGFscGhhcmVAcmFwaGFlbGdvbWVzLmRldgAKCRChHgHNDgXZVvTfC/4+EnMhYrYrPei1fdoVMLCFY9ibXL0ALdzH6HVFzQejc8yHQCMNbnuDXlaVuFpUSwRIt8BhZME5UXra9yVceGrnQO10I+Pz9IfT/Dz6gIE1TUHsmBlMszsTAg28GsD4/5pB9yHPNB/o3u4MoivVryKqBrRWFTF14Lb/vHAVKnupDY1T4gnrs5zGAH50WNBOJ3kOz6Joc62JlPkFrpfBLeisfB+motueCdqxwcb7Uf6jsWcsGK6tdtl1MBohKs8mHc4cYYvIczrP/P7XteX1HblpSSXe3ES61hih39n0Gjg+XCrgWVXMwRSnORkz0gylvk6woj801bifRyBJj5pOaFDjuxTu/fgPFyavtpfQs82bSAHgaHsou/3BUvKDSKxPPIckRIgFLb1Ut1r64Yl91yNsYtx6bcJbpZ03ltEkONxll9bQ0JyAEZyc7sB0tBV/LGHeJ91GIm/gDBpyfc+8Yqqco0Rkd6o+PV9PlH0GkqHNBNUB3rS1tWKq48Dq4gcOjDI=
--- a/.hgtags	Sun Oct 27 17:29:18 2024 -0400
+++ b/.hgtags	Mon Oct 28 11:45:02 2024 +0100
@@ -281,3 +281,4 @@
 6454c117c6a4003f07d8f4281dd90038955123e4 6.8rc0
 11f41248595b6dd7e0fbb434ecbf75c418785a4c 6.8
 11a9e2fc0caf0800625612e374139e4d825349a6 6.8.1
+eae3ec345e5e62e653de32a87a70f6fa7241afde 6.8.2
--- a/mercurial/obsolete.py	Sun Oct 27 17:29:18 2024 -0400
+++ b/mercurial/obsolete.py	Mon Oct 28 11:45:02 2024 +0100
@@ -1053,7 +1053,9 @@
             if prec not in newermap:
                 obsutil.successorssets(repo, prec, cache=newermap)
             newer = [n for n in newermap[prec] if n]
-            if len(newer) > 1:
+            # Strickly speaking, the len(newer) is not needed, but it speeds
+            # things up.
+            if len(newer) > 1 and any(n for n in newer if node not in n):
                 divergent.add(rev)
                 break
             toprocess.update(obsstore.predecessors.get(prec, ()))
--- a/relnotes/6.8	Sun Oct 27 17:29:18 2024 -0400
+++ b/relnotes/6.8	Mon Oct 28 11:45:02 2024 +0100
@@ -1,3 +1,25 @@
+= Mercurial 6.8.2 =
+
+This is the last version that supports Python 3.6 and 3.7.
+
+ * Compatibility for Python 3.12 and 3.13
+ * evolution: stop wrongly flagging unrelated part of a split as divergent
+ * histedit: create state and acquire locks earlier
+ * copytracing: fix a bug in an edge case in metadata.compute_all_files_changes
+ * rhg: ignore readonly FS error when saving dirstate
+ * merge: sort filemap only if requested by the caller
+ * windows: implement `util.cachestat` to fix numerous dirstate problems
+ * subrepo: propagate non-default path on outgoing
+ * import: fix erroneous comparison of str with bytes
+ * largefiles: fix check that ensures that --all-largefiles is only used locally
+ * profiling: improve 3.12 error message for calling lsprof twice
+ * profiling: use "stat" profiler to profile individual request
+ * module-policy: ignore empty module policy
+ * relnotes: skip the test if the source repository is not readable
+ * wireprototypes: fix exception handling code with a bad pytype suppression
+ * Many more type fixes and improvements
+ * Improvements to the test suite
+
 = Mercurial 6.8.1 =
 
  * Python 3.12: fix an issue between `threading` and `demandimport`
--- a/tests/test-obsmarker-template.t	Sun Oct 27 17:29:18 2024 -0400
+++ b/tests/test-obsmarker-template.t	Mon Oct 28 11:45:02 2024 +0100
@@ -2304,7 +2304,7 @@
   $ hg up 6 --hidden
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg commit --amend -m "Add B only"
-  4 new content-divergent changesets
+  2 new content-divergent changesets
 
   $ hg log -G
   @  changeset:   9:0b997eb7ceee
@@ -2325,7 +2325,7 @@
   | *  changeset:   7:ba2ed02b0c9a
   | |  user:        test
   | |  date:        Thu Jan 01 00:00:00 1970 +0000
-  | |  instability: orphan, content-divergent
+  | |  instability: orphan
   | |  summary:     Add A,B,C
   | |
   | x  changeset:   6:4a004186e638
@@ -2335,11 +2335,10 @@
   |    obsolete:    rewritten using amend as 9:0b997eb7ceee
   |    summary:     Add A,B,C
   |
-  *  changeset:   5:dd800401bd8c
+  o  changeset:   5:dd800401bd8c
   |  parent:      3:f897c6137566
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  instability: content-divergent
   |  summary:     Add A,B,C
   |
   o  changeset:   3:f897c6137566
@@ -2391,7 +2390,7 @@
   |      multi-line: 8:b18bc8331526
   |      multi-line: 9:0b997eb7ceee
   |      json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
-  *  dd800401bd8c
+  o  dd800401bd8c
   |    Predecessors:
   |    semi-colon:
   |    json: []
@@ -2424,7 +2423,7 @@
   | |
   | x  4a004186e638
   |/     Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   o  f897c6137566
   |
@@ -2464,7 +2463,7 @@
   |      multi-line: 8:b18bc8331526
   |      multi-line: 9:0b997eb7ceee
   |      json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]]
-  *  dd800401bd8c
+  o  dd800401bd8c
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
   |    json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2522,7 +2521,7 @@
   | |
   | x  4a004186e638
   |/     Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000);
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | x  9bd10a0775e4
   |/     Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000);
@@ -2543,7 +2542,7 @@
   | |
   | x  4a004186e638
   |/     Obsfate: [{"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["b18bc8331526a22cbb1801022bd1555bf291c48b"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b18bc8331526a22cbb1801022bd1555bf291c48b"]}, {"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["0b997eb7ceeee06200a02f8aab185979092d514e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["0b997eb7ceeee06200a02f8aab185979092d514e"]}]
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | x  9bd10a0775e4
   |/     Obsfate: [{"markers": [["9bd10a0775e478708cada5f176ec6de654359ce7", ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]}]
@@ -2562,7 +2561,7 @@
   $ hg rebase -r 7 -d 8 --config extensions.rebase=
   rebasing 7:ba2ed02b0c9a "Add A,B,C"
   $ hg tlog
-  *  eceed8f98ffc
+  o  eceed8f98ffc
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
   |    json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2586,7 +2585,7 @@
   |      Successors:
   |      multi-line:
   |      json: []
-  *  dd800401bd8c
+  o  dd800401bd8c
   |    Predecessors: 4:9bd10a0775e4
   |    semi-colon: 4:9bd10a0775e4
   |    json: ["9bd10a0775e478708cada5f176ec6de654359ce7"]
@@ -2621,13 +2620,13 @@
        json: []
 
   $ hg fatelog
-  *  eceed8f98ffc
+  o  eceed8f98ffc
   |
   | *  0b997eb7ceee
   | |
   * |  b18bc8331526
   |/
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | @  9bd10a0775e4
   |/     Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000);
@@ -2639,7 +2638,7 @@
 -----------------------------------
 
   $ hg fatelogkw --hidden -q
-  *  eceed8f98ffc
+  o  eceed8f98ffc
   |
   | *  0b997eb7ceee
   | |
@@ -2650,7 +2649,7 @@
   | x  4a004186e638
   |/     Obsfate: rewritten using amend as 8:b18bc8331526
   |      Obsfate: rewritten using amend as 9:0b997eb7ceee
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | @  9bd10a0775e4
   |/     Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
@@ -2664,7 +2663,7 @@
   o  ea207398892e
   
   $ hg fatelogkw --hidden
-  *  eceed8f98ffc
+  o  eceed8f98ffc
   |
   | *  0b997eb7ceee
   | |
@@ -2675,7 +2674,7 @@
   | x  4a004186e638
   |/     Obsfate: rewritten using amend as 8:b18bc8331526
   |      Obsfate: rewritten using amend as 9:0b997eb7ceee
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | @  9bd10a0775e4
   |/     Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a
@@ -2689,7 +2688,7 @@
   o  ea207398892e
   
   $ hg fatelogkw --hidden -v
-  *  eceed8f98ffc
+  o  eceed8f98ffc
   |
   | *  0b997eb7ceee
   | |
@@ -2700,7 +2699,7 @@
   | x  4a004186e638
   |/     Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000)
   |      Obsfate: rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000)
-  *  dd800401bd8c
+  o  dd800401bd8c
   |
   | @  9bd10a0775e4
   |/     Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000)
@@ -2714,12 +2713,11 @@
   o  ea207398892e
   
   $ hg log -G -T "default" --hidden
-  *  changeset:   10:eceed8f98ffc
+  o  changeset:   10:eceed8f98ffc
   |  tag:         tip
   |  parent:      8:b18bc8331526
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  instability: content-divergent
   |  summary:     Add A,B,C
   |
   | *  changeset:   9:0b997eb7ceee
@@ -2749,11 +2747,10 @@
   |    obsolete:    rewritten using amend as 9:0b997eb7ceee
   |    summary:     Add A,B,C
   |
-  *  changeset:   5:dd800401bd8c
+  o  changeset:   5:dd800401bd8c
   |  parent:      3:f897c6137566
   |  user:        test
   |  date:        Thu Jan 01 00:00:00 1970 +0000
-  |  instability: content-divergent
   |  summary:     Add A,B,C
   |
   | @  changeset:   4:9bd10a0775e4
--- a/tests/test-obsolete-divergent.t	Sun Oct 27 17:29:18 2024 -0400
+++ b/tests/test-obsolete-divergent.t	Mon Oct 28 11:45:02 2024 +0100
@@ -466,7 +466,7 @@
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg debugobsolete `getid A_5` `getid A_9`
   1 new obsolescence markers
-  4 new content-divergent changesets
+  3 new content-divergent changesets
   $ hg log -G --hidden
   *  10:bed64f5d2f5a A_9
   |
@@ -480,7 +480,7 @@
   |/
   | x  5:6a411f0d7a0a A_4 [rewritten as 6:e442cfc57690]
   |/
-  | *  4:01f36c5a8fda A_3
+  | o  4:01f36c5a8fda A_3
   |/
   | x  3:392fd25390da A_2 [rewritten as 5:6a411f0d7a0a]
   |/
@@ -553,7 +553,6 @@
   bed64f5d2f5a
       bed64f5d2f5a
   $ hg log -r 'contentdivergent()'
-  4:01f36c5a8fda A_3
   8:7ae126973a96 A_7
   9:14608b260df8 A_8
   10:bed64f5d2f5a A_9
@@ -719,7 +718,58 @@
 
   $ cd ..
 
+Divergence introduced after a split
+-----------------------------------
+
+Make sure divergence introduced in sucessors of a split does not spill to the
+unrelated part.
+
+  $ newcase split-unrelated-branch
+  $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
+  1 new obsolescence markers
+  obsoleted 1 changesets
+  $ hg up 'desc("A_2")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit --amend -m "A_3"
+  $ hg up 'desc("A_2")' --hidden
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  updated to hidden changeset 392fd25390da
+  (hidden revision '392fd25390da' was rewritten as: 4d672202d2fb)
+  $ hg commit --amend -m "A_4" --config experimental.evolution.allowdivergence=yes
+  2 new content-divergent changesets
+  $ hg log -G --hidden
+  @  5:6730f214b07b A_4
+  |
+  | *  4:4d672202d2fb A_3
+  |/
+  | x  3:392fd25390da A_2 [rewritten using amend as 5:6730f214b07b; rewritten using amend as 4:4d672202d2fb]
+  |/
+  | o  2:82623d38b9ba A_1
+  |/
+  | x  1:007dc284c1f8 A_0 [split as 2:82623d38b9ba, 3:392fd25390da]
+  |/
+  o  0:d20a80d4def3 base
+  
+  $ hg debugsuccessorssets --hidden 'desc('A_0')'
+  007dc284c1f8
+      82623d38b9ba 4d672202d2fb
+      82623d38b9ba 6730f214b07b
+  $ hg debugsuccessorssets --hidden 'desc('A_1')'
+  82623d38b9ba
+      82623d38b9ba
+  $ hg debugsuccessorssets --hidden 'desc('A_2')'
+  392fd25390da
+      6730f214b07b
+      4d672202d2fb
+  $ hg log -r 'contentdivergent()'
+  4:4d672202d2fb A_3
+  5:6730f214b07b A_4
+  $ cd ..
+
+
+
 Use scmutil.cleanupnodes API to create divergence
+=================================================
 
   $ hg init cleanupnodes
   $ cd cleanupnodes