# HG changeset patch # User Anton Shestakov # Date 1616142204 -28800 # Node ID ee242f4a2d730199e841e78f10c99a0079a2d706 # Parent bdda94ea21957ebe046e0b5720aa787629adc035 topic: compatibility for branchcache having a repo argument in 5.8 diff -r bdda94ea2195 -r ee242f4a2d73 hgext3rd/serverminitopic.py --- 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 diff -r bdda94ea2195 -r ee242f4a2d73 hgext3rd/topic/topicmap.py --- 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