topic: add the changelog argument to branchinfo() stable
authorPulkit Goyal <pulkit@yandex-team.ru>
Sun, 21 Oct 2018 00:08:27 +0300
branchstable
changeset 4192 e527df0f2a68
parent 4191 5c734be63c3e
child 4193 19c35a340741
child 4194 cae466b70bf1
child 4195 4803bfe8db17
topic: add the changelog argument to branchinfo() 47c03042cd1d in core added a changelog argument to revbranchcache.branchinfo() and we wrap that function in topic extension. So let's add this optional argument in topic extension too.
CHANGELOG
hgext3rd/serverminitopic.py
hgext3rd/topic/discovery.py
hgext3rd/topic/topicmap.py
--- a/CHANGELOG	Thu Oct 18 22:11:43 2018 -0700
+++ b/CHANGELOG	Sun Oct 21 00:08:27 2018 +0300
@@ -7,7 +7,7 @@
 
   * evolve+topic: fix possible crash during content-divergence evolution
   * use "new" unstabilities vocabulary in help
-  * compat: compat with coming 4.8 release
+  * compat: compatibility with Mercurial 4.8rc0
 
 8.3.0 -- 2018-10-12
 -------------------
--- a/hgext3rd/serverminitopic.py	Thu Oct 18 22:11:43 2018 -0700
+++ b/hgext3rd/serverminitopic.py	Sun Oct 21 00:08:27 2018 +0300
@@ -67,7 +67,7 @@
         if 'branchinfo' in vars(self):
             del self.branchinfo
 
-    def branchinfo(self, rev):
+    def branchinfo(self, rev, changelog=None):
         """return branch name and close flag for rev, using and updating
         persistent cache."""
         phase = self._repo._phasecache.phase(self._repo, rev)
--- a/hgext3rd/topic/discovery.py	Thu Oct 18 22:11:43 2018 -0700
+++ b/hgext3rd/topic/discovery.py	Sun Oct 21 00:08:27 2018 +0300
@@ -81,9 +81,11 @@
 
         def revbranchcache(self):
             rbc = super(repocls, self).revbranchcache()
-            changelog = self.changelog
+            localchangelog = self.changelog
 
-            def branchinfo(rev):
+            def branchinfo(rev, changelog=None):
+                if changelog is None:
+                    changelog = localchangelog
                 branch, close = changelog.branchinfo(rev)
                 if rev in publishedset:
                     return branch, close
--- a/hgext3rd/topic/topicmap.py	Thu Oct 18 22:11:43 2018 -0700
+++ b/hgext3rd/topic/topicmap.py	Sun Oct 21 00:08:27 2018 +0300
@@ -203,7 +203,7 @@
         unfi = repo.unfiltered()
         oldgetbranchinfo = unfi.revbranchcache().branchinfo
 
-        def branchinfo(r):
+        def branchinfo(r, changelog=None):
             info = oldgetbranchinfo(r)
             topic = ''
             ctx = unfi[r]