changeset 37239:40ee0af04e3a

infinitepush: use bundleoperation.source instead of hacking on tr Previous patches added a soutce attribute to bundle2.bundleoperation class which stores the command which leads to current bundleoperation. Let's use that to decide whether a processing a `hg unbundle` or not instead of hacking on transaction. Differential Revision: https://phab.mercurial-scm.org/D2997
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 31 Mar 2018 14:56:57 +0530
parents 684a6a261f30
children b5caa13d1a73
files hgext/infinitepush/__init__.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/infinitepush/__init__.py	Sat Mar 31 14:54:12 2018 +0530
+++ b/hgext/infinitepush/__init__.py	Sat Mar 31 14:56:57 2018 +0530
@@ -927,10 +927,8 @@
 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 op.source == 'unbundle':
+        return orig(repo, op, unbundler)
 
     # this server routes each push to bundle store
     if repo.ui.configbool('infinitepush', 'pushtobundlestore'):