hgext3rd/topic/__init__.py
changeset 3902 9c4847b93d3c
parent 3880 28dadd024299
parent 3836 b91db6989231
child 3922 9839463088ac
--- a/hgext3rd/topic/__init__.py	Fri May 25 17:17:56 2018 +0200
+++ b/hgext3rd/topic/__init__.py	Tue Jul 31 09:03:35 2018 +0200
@@ -364,7 +364,7 @@
         def commit(self, *args, **kwargs):
             backup = self.ui.backupconfig('ui', 'allowemptycommit')
             try:
-                if repo.currenttopic != repo['.'].topic():
+                if self.currenttopic != self['.'].topic():
                     # bypass the core "nothing changed" logic
                     self.ui.setconfig('ui', 'allowemptycommit', True)
                 return super(topicrepo, self).commit(*args, **kwargs)
@@ -374,7 +374,7 @@
         def commitctx(self, ctx, error=None):
             topicfilter = topicmap.topicfilter(self.filtername)
             if topicfilter != self.filtername:
-                other = repo.filtered(topicmap.topicfilter(repo.filtername))
+                other = self.filtered(topicmap.topicfilter(self.filtername))
                 other.commitctx(ctx, error=error)
 
             if isinstance(ctx, context.workingcommitctx):
@@ -409,7 +409,7 @@
 
         def branchmap(self, topic=None):
             if topic is None:
-                topic = getattr(repo, '_autobranchmaptopic', False)
+                topic = getattr(self, '_autobranchmaptopic', False)
             topicfilter = topicmap.topicfilter(self.filtername)
             if not topic or topicfilter == self.filtername:
                 return super(topicrepo, self).branchmap()
@@ -437,7 +437,7 @@
                 return tr
 
             reporef = weakref.ref(self)
-            if repo.ui.configbool('experimental', 'enforce-single-head'):
+            if self.ui.configbool('experimental', 'enforce-single-head'):
                 origvalidator = tr.validator
 
                 def validator(tr2):
@@ -446,7 +446,7 @@
                     origvalidator(tr2)
                 tr.validator = validator
 
-            topicmodeserver = repo.ui.config('experimental',
+            topicmodeserver = self.ui.config('experimental',
                                              'topic-mode.server', 'ignore')
             ispush = (desc.startswith('push') or desc.startswith('serve'))
             if (topicmodeserver != 'ignore' and ispush):
@@ -458,7 +458,7 @@
                     return origvalidator(tr2)
                 tr.validator = validator
 
-            elif (repo.ui.configbool('experimental', 'topic.publish-bare-branch')
+            elif (self.ui.configbool('experimental', 'topic.publish-bare-branch')
                     and (desc.startswith('push')
                          or desc.startswith('serve'))
                     ):