topic: directly use "super" call
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 28 Apr 2017 15:29:32 +0200
changeset 2288 b6ea9049693d
parent 2286 a4c5744a7b93
child 2289 61d073590fb7
topic: directly use "super" call That is how one is supposed to do it.
hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py	Tue Apr 25 10:56:55 2017 +0200
+++ b/hgext3rd/topic/__init__.py	Fri Apr 28 15:29:32 2017 +0200
@@ -154,7 +154,6 @@
 
 
 def reposetup(ui, repo):
-    orig = repo.__class__
     if not isinstance(repo, localrepo.localrepository):
         return # this can be a peer in the ssh case (puzzling)
 
@@ -171,7 +170,7 @@
                 if repo.currenttopic != repo['.'].topic():
                     # bypass the core "nothing changed" logic
                     self.ui.setconfig('ui', 'allowemptycommit', True)
-                return orig.commit(self, *args, **kwargs)
+                return super(topicrepo, self).commit(*args, **kwargs)
             finally:
                 self.ui.restoreconfig(backup)
 
@@ -187,7 +186,7 @@
                 # we are amending and need to remove a topic
                 del ctx.extra()[constants.extrakey]
             with topicmap.usetopicmap(self):
-                return orig.commitctx(self, ctx, error=error)
+                return super(topicrepo, self).commitctx(ctx, error=error)
 
         @property
         def topics(self):