[PATCH 1 of 3] bundle2: use "else" instead of checking condition again

Martin von Zweigbergk martinvonz at google.com
Fri Jun 16 21:26:37 UTC 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1497634603 25200
#      Fri Jun 16 10:36:43 2017 -0700
# Node ID 01e43f5ed3b796c8eeb629efc0a2dc2cc2be23b4
# Parent  a3a36bcf122e2ea4edbbe4ac44da59446cf0ee07
bundle2: use "else" instead of checking condition again

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -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)
diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -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',


More information about the Mercurial-devel mailing list