discovery: make sure repository wrapping happens in the right order stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 16 Aug 2018 22:19:19 +0200
branchstable
changeset 3952 a7794f5abacd
parent 3950 bfc617cd1ce1
child 3953 2174de498a69
discovery: make sure repository wrapping happens in the right order Otherwise we may end up in situation were cache are not warmed in the right order, crashing.
CHANGELOG
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/stablerange.py
hgext3rd/evolve/stablerangecache.py
hgext3rd/evolve/stablesort.py
tests/test-discovery-obshashrange.t
--- a/CHANGELOG	Thu Aug 16 11:54:30 2018 +0200
+++ b/CHANGELOG	Thu Aug 16 22:19:19 2018 +0200
@@ -5,6 +5,7 @@
 -------------------
 
   * next: fix topic restriction when passing --evolve
+  * clone: fix possible crash when using clone bundle and forcing cache warming
 
 8.1.0 -- 2018-08-03
 -------------------
--- a/hgext3rd/evolve/obsdiscovery.py	Thu Aug 16 11:54:30 2018 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Thu Aug 16 22:19:19 2018 +0200
@@ -65,7 +65,6 @@
 _calcsize = struct.calcsize
 
 eh = exthelper.exthelper()
-eh.merge(stablerangecache.eh)
 obsexcmsg = utility.obsexcmsg
 
 # Config
@@ -1003,3 +1002,6 @@
     else:
         boundaries['common'] = [node.nullid]
     return boundaries
+
+# merge later for outer layer wrapping
+eh.merge(stablerangecache.eh)
--- a/hgext3rd/evolve/stablerange.py	Thu Aug 16 11:54:30 2018 +0200
+++ b/hgext3rd/evolve/stablerange.py	Thu Aug 16 22:19:19 2018 +0200
@@ -32,8 +32,6 @@
 filterparents = utility.filterparents
 
 eh = exthelper.exthelper()
-eh.merge(stablesort.eh)
-eh.merge(firstmergecache.eh)
 
 
 #################################
@@ -864,3 +862,7 @@
         top = (rangeid[0], globalindex)
         result.append(top)
         return result
+
+# merge later for outer layer wrapping
+eh.merge(stablesort.eh)
+eh.merge(firstmergecache.eh)
--- a/hgext3rd/evolve/stablerangecache.py	Thu Aug 16 11:54:30 2018 +0200
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Aug 16 22:19:19 2018 +0200
@@ -29,7 +29,6 @@
 from mercurial.i18n import _
 
 eh = exthelper.exthelper()
-eh.merge(stablerange.eh)
 
 class stablerangeondiskbase(stablerange.stablerangecached,
                             genericcaches.changelogsourcebase):
@@ -391,3 +390,5 @@
                 return tr
 
     repo.__class__ = stablerangerepo
+
+eh.merge(stablerange.eh)
--- a/hgext3rd/evolve/stablesort.py	Thu Aug 16 11:54:30 2018 +0200
+++ b/hgext3rd/evolve/stablesort.py	Thu Aug 16 22:19:19 2018 +0200
@@ -34,7 +34,6 @@
 filterparents = utility.filterparents
 
 eh = exthelper.exthelper()
-eh.merge(depthcache.eh)
 
 def _mergepoint_tie_breaker(repo):
     """the key use to tie break merge parent
@@ -705,3 +704,6 @@
     'headcached': stablesort_mergepoint_head_cached,
     'headondisk': stablesort_mergepoint_head_ondisk,
 }
+
+# merge last so that repo setup wrap after that one.
+eh.merge(depthcache.eh)
--- a/tests/test-discovery-obshashrange.t	Thu Aug 16 11:54:30 2018 +0200
+++ b/tests/test-discovery-obshashrange.t	Thu Aug 16 22:19:19 2018 +0200
@@ -240,13 +240,13 @@
   * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-depthcache cache reset (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (1r) (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (1r, 1o) (glob)
-  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (1r) (glob)
   * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-firstmerge cache reset (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-firstmerge in *.???? seconds (9r) (glob)
+  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-depthcache in *.???? seconds (1r) (glob)
   * @0000000000000000000000000000000000000000 (*)> strip detected, evo-ext-stablesort cache reset (glob)
   * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablesort in *.???? seconds (9r) (glob)
+  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (1r) (glob)
+  * @0000000000000000000000000000000000000000 (*)> updated evo-ext-obshashrange in *.???? seconds (1r, 1o) (glob)
   * @0000000000000000000000000000000000000000 (*)> obscache is out of date, falling back to slower obsstore version (glob)
   * @0000000000000000000000000000000000000000 (*)> updated served branch cache in *.???? seconds (glob)
   * @0000000000000000000000000000000000000000 (*)> wrote served branch cache with 1 labels and 2 nodes (glob)
@@ -656,14 +656,14 @@
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> 1 incoming changes - new heads: 4de32a90b66c (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> pull exited 0 after *.?? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> rollback (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob)
+  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-firstmerge cache reset (glob)
+  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-depthcache cache reset (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-firstmerge cache reset (glob)
-  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablesort cache reset (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
+  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob)
+  * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> updated base branch cache in *.???? seconds (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> wrote base branch cache with 1 labels and 2 nodes (glob)
   * @45f8b879de922f6a6e620ba04205730335b6fc7e (*)> strip detected, evo-ext-obscache cache reset (glob)
@@ -825,16 +825,16 @@
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-obscache cache reset (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-obscache in *.???? seconds (5r, 11o) (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-obscache in *.???? seconds (3r, 0o) (glob)
-  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-obshashrange cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-firstmerge cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-depthcache cache reset (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablesort cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-obshashrange cache reset (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-obshashrange in *.???? seconds (8r, 11o) (glob)
-  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-firstmerge cache reset (glob)
-  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
-  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablesort cache reset (glob)
-  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated base branch cache in *.???? seconds (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> wrote base branch cache with 1 labels and 1 nodes (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> 3 incoming changes - new heads: 4de32a90b66c (glob)