branchcache: explicitly assert that copy is always about inheritance
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 08 Mar 2024 16:52:08 +0100
changeset 51490 18c2753434f2
parent 51489 659f766629c8
child 51491 dd5b5f99940d
branchcache: explicitly assert that copy is always about inheritance This would catch cases where copy is used for something else if any existed.
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Sat Mar 09 02:07:15 2024 +0100
+++ b/mercurial/branchmap.py	Fri Mar 08 16:52:08 2024 +0100
@@ -556,6 +556,7 @@
 
     def copy(self, repo):
         """return a deep copy of the branchcache object"""
+        assert repo.filtername != self._filtername
         other = type(self)(
             repo=repo,
             # we always do a shally copy of self._entries, and the values is