changeset 5873:ee242f4a2d73 stable

topic: compatibility for branchcache having a repo argument in 5.8
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 19 Mar 2021 16:23:24 +0800
parents bdda94ea2195
children 1682b388be13
files hgext3rd/serverminitopic.py hgext3rd/topic/topicmap.py
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/serverminitopic.py	Tue Apr 13 19:46:03 2021 +0800
+++ b/hgext3rd/serverminitopic.py	Fri Mar 19 16:23:24 2021 +0800
@@ -167,8 +167,12 @@
         else:
             # hg <= 4.9 (624d6683c705+b137a6793c51)
             _entries = self
-        new = self.__class__(_entries, self.tipnode, self.tiprev,
-                             self.filteredhash, self._closednodes)
+        args = (_entries, self.tipnode, self.tiprev, self.filteredhash,
+                self._closednodes)
+        if util.safehasattr(self, '_repo'):
+            # hg <= 5.7 (6266d19556ad)
+            args = (self._repo,) + args
+        new = self.__class__(*args)
         new.phaseshash = self.phaseshash
         return new
 
--- a/hgext3rd/topic/topicmap.py	Tue Apr 13 19:46:03 2021 +0800
+++ b/hgext3rd/topic/topicmap.py	Fri Mar 19 16:23:24 2021 +0800
@@ -173,8 +173,12 @@
         else:
             # hg <= 4.9 (624d6683c705+b137a6793c51)
             _entries = self
-        new = self.__class__(_entries, self.tipnode, self.tiprev,
-                             self.filteredhash, self._closednodes)
+        args = (_entries, self.tipnode, self.tiprev, self.filteredhash,
+                self._closednodes)
+        if util.safehasattr(self, '_repo'):
+            # hg <= 5.7 (6266d19556ad)
+            args = (self._repo,) + args
+        new = self.__class__(*args)
         new.phaseshash = self.phaseshash
         return new