hgext3rd/topic/discovery.py
changeset 2695 b4824e169f18
parent 2676 10dedac0d82e
child 2696 a32afe67e8a6
--- a/hgext3rd/topic/discovery.py	Sun Jul 02 15:02:51 2017 +0200
+++ b/hgext3rd/topic/discovery.py	Sun Jul 02 16:00:38 2017 +0200
@@ -49,17 +49,14 @@
             ctx.branch = branch
             return ctx
 
-    oldrepo = repo.__class__
+    oldrepocls = repo.__class__
     try:
         repo.__class__ = repocls
         unxx = repo.filtered('unfiltered-topic')
         repo.unfiltered = lambda: unxx
         if pushoparg:
-            try:
-                pushop.repo = repo
-                summary = orig(pushop)
-            finally:
-                pushop.repo = repo
+            pushop.repo = repo
+            summary = orig(pushop)
         else:
             summary = orig(repo, remote, outgoing)
         for key, value in summary.iteritems():
@@ -70,7 +67,7 @@
     finally:
         if 'unfiltered' in vars(repo):
             del repo.unfiltered
-        repo.__class__ = oldrepo
+        repo.__class__ = oldrepocls
 
 def wireprotobranchmap(orig, repo, proto):
     oldrepo = repo.__class__