changeset 32899:f65786a02922

bundle2: use "else" instead of checking condition again
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Jun 2017 10:36:43 -0700
parents 4c2a46f89f08
children 0d98b11b8467
files hgext/histedit.py hgext/shelve.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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',