D2957: infinitepush: don't wrap bundle2.processparts while calling `hg unbundle`
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe5cd0ef5c362: infinitepush: dont wrap bundle2.processparts while calling `hg unbundle` (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2957?vs=7340=7429 REVISION DETAIL https://phab.mercurial-scm.org/D2957 AFFECTED FILES hgext/infinitepush/__init__.py CHANGE DETAILS diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py --- a/hgext/infinitepush/__init__.py +++ b/hgext/infinitepush/__init__.py @@ -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) To: pulkit, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2957: infinitepush: don't wrap bundle2.processparts while calling `hg unbundle`
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. The next patch adds test coverage. So I think this is fine. A follow-up to make this less hacky (if possible) would be appreciated, but isn't required. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2957 To: pulkit, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2957: infinitepush: don't wrap bundle2.processparts while calling `hg unbundle`
indygreg requested changes to this revision. indygreg added a comment. This revision now requires changes to proceed. Can the `op` argument be used instead? Also, given the hackiness of this, I'd feel much better if there were test coverage for `hg unbundle` continuing to work with this extension enabled. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2957 To: pulkit, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2957: infinitepush: don't wrap bundle2.processparts while calling `hg unbundle`
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2957 AFFECTED FILES hgext/infinitepush/__init__.py CHANGE DETAILS diff --git a/hgext/infinitepush/__init__.py b/hgext/infinitepush/__init__.py --- a/hgext/infinitepush/__init__.py +++ b/hgext/infinitepush/__init__.py @@ -871,6 +871,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) To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel