diff hgext3rd/serverminitopic.py @ 5847:ad7c9c0b7a63

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 2c5e4339538a
children 1b57516a9a56
line wrap: on
line diff
--- a/hgext3rd/serverminitopic.py	Fri Mar 12 19:04:11 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