changeset 2288:b6ea9049693d

topic: directly use "super" call That is how one is supposed to do it.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 28 Apr 2017 15:29:32 +0200
parents a4c5744a7b93
children 61d073590fb7
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):