changeset 4159:328450f2de56

branching: merge stable into default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 12 Oct 2018 11:33:30 +0200
parents 5dd45784a8e0 (current diff) f996596d8ccc (diff)
children 44133463372f
files hgext3rd/evolve/utility.py tests/test-discovery-obshashrange.t
diffstat 3 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obsdiscovery.py	Fri Oct 12 02:12:23 2018 +0300
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri Oct 12 11:33:30 2018 +0200
@@ -696,7 +696,14 @@
         def destroyed(self):
             if 'obsstore' in vars(self):
                 self.obsstore.rangeobshashcache.clear()
-            super(obshashrepo, self).destroyed()
+            toplevel = not util.safehasattr(self, '_destroying')
+            if toplevel:
+                self._destroying = True
+            try:
+                super(obshashrepo, self).destroyed()
+            finally:
+                if toplevel:
+                    del self._destroying
 
         @localrepo.unfilteredmethod
         def updatecaches(self, tr=None, **kwargs):
--- a/hgext3rd/evolve/utility.py	Fri Oct 12 02:12:23 2018 +0300
+++ b/hgext3rd/evolve/utility.py	Fri Oct 12 11:33:30 2018 +0200
@@ -50,7 +50,7 @@
     desc = getattr(tr, 'desc', '')
 
     autocase = False
-    if tr is None:
+    if tr is None and not getattr(repo, '_destroying', False):
         autocase = True
     elif desc.startswith('serve'):
         autocase = True
@@ -64,7 +64,6 @@
     else:
         # note: we should not get to the default case
         warm = configbool('experimental', 'obshashrange.warm-cache', True)
-
     if not configbool('experimental', 'obshashrange', True):
         return False
     if not warm:
--- a/tests/test-discovery-obshashrange.t	Fri Oct 12 02:12:23 2018 +0300
+++ b/tests/test-discovery-obshashrange.t	Fri Oct 12 11:33:30 2018 +0200
@@ -1068,16 +1068,6 @@
   * @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-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)
-  1970/01/01 00:00:00 * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-obshashrange in *.???? seconds (8r, 11o) (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)
@@ -1086,6 +1076,16 @@
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> writing .hg/cache/tags2-visible with 0 tags (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> log -G exited 0 after *.?? seconds (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> pull (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablerange-mergepoint cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-depthcache cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-depthcache in *.???? seconds (8r) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablerange-mergepoint in *.???? seconds (8r) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-obshashrange cache reset (glob)
+  1970/01/01 00:00:00 * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-obshashrange in *.???? seconds (8r, 11o) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-stablesort cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-stablesort in *.???? seconds (8r) (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> strip detected, evo-ext-firstmerge cache reset (glob)
+  * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated evo-ext-firstmerge in *.???? seconds (8r) (glob)
   * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> obsdiscovery, 1/8 mismatch - 1 obshashrange queries in *.???? seconds (glob)
   1970/01/01 00:00:00 * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> updated base branch cache in *.???? seconds (glob)
   1970/01/01 00:00:00 * @bebd167eb94d257ace0e814aeb98e6972ed2970d (*)> wrote base branch cache with 1 labels and 2 nodes (glob)
@@ -1146,3 +1146,11 @@
   .hg/cache/evoext-stablesortcache-00: size=100
   .hg/cache/evoext_obshashrange_v2.sqlite: size=??* (glob)
   .hg/cache/evoext_stablerange_v2.sqlite: size=??* (glob)
+
+  $ rm -f .hg/cache/evoext*
+  $ ls -1 .hg/cache/ | grep evoext
+  [1]
+  $ hg strip -r 5 --config extensions.strip=
+  saved backup bundle to $TESTTMP/client/.hg/strip-backup/c8d03c1b5e94-b257442b-backup.hg
+  $ f -s .hg/cache/evoext*
+  .hg/cache/evoext-obscache-00: size=70