# HG changeset patch # User Anton Shestakov # Date 1616142204 -28800 # Node ID ad7c9c0b7a635d5df725a1f1dac41a20a12bbb18 # Parent af778697074902ff9f2af1d543c4e3c4a8c402b6 topic: compatibility for branchcache having a repo argument in 5.8 diff -r af7786970749 -r ad7c9c0b7a63 hgext3rd/serverminitopic.py --- 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 diff -r af7786970749 -r ad7c9c0b7a63 hgext3rd/topic/topicmap.py --- a/hgext3rd/topic/topicmap.py Fri Mar 12 19:04:11 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