bundle2: use "else" instead of checking condition again
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 16 Jun 2017 10:36:43 -0700
changeset 32881 f65786a02922
parent 32880 4c2a46f89f08
child 32882 0d98b11b8467
bundle2: use "else" instead of checking condition again
hgext/histedit.py
hgext/shelve.py
--- a/hgext/histedit.py	Fri Jun 16 09:37:22 2017 -0700
+++ b/hgext/histedit.py	Fri Jun 16 10:36:43 2017 -0700
@@ -1200,7 +1200,7 @@
             with repo.transaction('histedit.abort') as tr:
                 if not isinstance(gen, bundle2.unbundle20):
                     gen.apply(repo, 'histedit', 'bundle:' + backupfile)
-                if isinstance(gen, bundle2.unbundle20):
+                else:
                     bundle2.applybundle(repo, gen, tr,
                                         source='histedit',
                                         url='bundle:' + backupfile)
--- a/hgext/shelve.py	Fri Jun 16 09:37:22 2017 -0700
+++ b/hgext/shelve.py	Fri Jun 16 10:36:43 2017 -0700
@@ -130,7 +130,7 @@
                 gen.apply(self.repo, 'unshelve',
                           'bundle:' + self.vfs.join(self.fname),
                           targetphase=phases.secret)
-            if isinstance(gen, bundle2.unbundle20):
+            else:
                 bundle2.applybundle(self.repo, gen,
                                     self.repo.currenttransaction(),
                                     source='unshelve',