infinitepush: don't wrap bundle2.processparts while calling `hg unbundle`
authorPulkit Goyal <7895pulkit@gmail.com>
Tue, 27 Mar 2018 17:19:02 +0530
changeset 37207 e5cd0ef5c362
parent 37206 0d6c12668691
child 37208 571f25dae740
infinitepush: don't wrap bundle2.processparts while calling `hg unbundle` This patch adds dirty logic to check whether we are processing `hg unbundle` instead of an `hg incoming` to prevent the wrapping of bundle2.processparts function. Differential Revision: https://phab.mercurial-scm.org/D2957
hgext/infinitepush/__init__.py
--- a/hgext/infinitepush/__init__.py	Tue Mar 27 14:15:42 2018 +0530
+++ b/hgext/infinitepush/__init__.py	Tue Mar 27 17:19:02 2018 +0530
@@ -869,6 +869,13 @@
     return logger
 
 def processparts(orig, repo, op, unbundler):
+
+    # make sure we don't wrap processparts in case of `hg unbundle`
+    tr = repo.currenttransaction()
+    if tr:
+        if tr.names[0].startswith('unbundle'):
+            return orig(repo, op, unbundler)
+
     if unbundler.params.get('infinitepush') != 'True':
         return orig(repo, op, unbundler)