# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-03-31 09:26:57 # Node ID 40ee0af04e3a66f99075eff75c5b3bb8845e5a2e # Parent 684a6a261f30c16ab1311518c8de577839723489 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 diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py --- a/hgext/infinitepush/__init__.py +++ b/hgext/infinitepush/__init__.py @@ -927,10 +927,8 @@ def storetobundlestore(orig, repo, op, u 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'):