# HG changeset patch # User Pierre-Yves David # Date 1499004038 -7200 # Node ID b4824e169f18a422a465f7a2037dd76847920723 # Parent 8a222745a71c9b002bb94c160b6d4755d2759a4e topic: cleanup the repository wrapping logic in topic discovery We are know overriding the class so we do not need to update and restore the pushop itself. diff -r 8a222745a71c -r b4824e169f18 hgext3rd/topic/discovery.py --- 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__