Mercurial > evolve
changeset 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 | af7786970749 |
children | b0b1ab64f6d8 |
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 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
--- 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