changeset 33831:b3a41f4d837b

bundle2: relax the condition to update transaction.hookargs This is just a micro optimization. If hookargs is empty, nothing should be necessary.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 Aug 2017 11:10:35 +0900
parents 1bf5c5507614
children dabe1f11ae3a
files mercurial/bundle2.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sun Aug 13 11:05:56 2017 +0900
+++ b/mercurial/bundle2.py	Sun Aug 13 11:10:35 2017 +0900
@@ -304,15 +304,15 @@
     def gettransaction(self):
         transaction = self._gettransaction()
 
-        if self.hookargs is not None:
+        if self.hookargs:
             # the ones added to the transaction supercede those added
             # to the operation.
             self.hookargs.update(transaction.hookargs)
             transaction.hookargs = self.hookargs
 
-            # mark the hookargs as flushed.  further attempts to add to
-            # hookargs will result in an abort.
-            self.hookargs = None
+        # mark the hookargs as flushed.  further attempts to add to
+        # hookargs will result in an abort.
+        self.hookargs = None
 
         return transaction