Commit Graph

25 Commits

Author SHA1 Message Date
Durham Goode
3f90727e16 pushrebase: fix pushrebase to match upstream
Summary:
Upstream has removed all the b2x flags, so let's do the same to pushrebase. Also
fixes pushrebase's use of manifest._intersectfiles() which has been removed
upstream (in favor of a matcher).

The tests had a bunch of hardcoded hooks which were very messy and became
impossible to maintain when upstream changed what args were passed. Let's just
get rid of all that noise.

Test Plan: Ran the tests

Reviewers: sid0, rmcelroy, lcharignon, ericsumner, pyd

Reviewed By: pyd

Differential Revision: https://phabricator.fb.com/D2003033

Signature: t1:2003033:1429832524:c0de8ebea7e6348ba9b55c109ca71bb3a301b625
2015-04-17 13:49:35 -07:00
Siddharth Agarwal
9a3748f730 [pushrebase] fix for Mercurial 3.4
Summary: The `intersectfiles` API changed.

Test Plan: ran the tests

Reviewers: ericsumner, #sourcecontrol

Reviewed By: ericsumner, #sourcecontrol

Differential Revision: https://phabricator.fb.com/D1966309

Tasks: 6619970

Signature: t1:1966309:1428086453:415a185b71af4812de2f5b6690a5337a5950aab6
2015-04-03 11:38:55 -07:00
Eric Sumner
4092b99234 pushrebase: cleanup phase handling
Summary:
It turns out that bundlerepo uses the underlying phase boundaries, so the
added changesets show up with the same phase as their nearest ancestor that's
already in the repository.  This behavior is confusing and inconsistent with
what happens when the bundle is actually applied: retracting the draft boundary
over the new commits.

This makes a copy of the phase cache so that changes in the bundlerepo don't
affect the real one and then retracts the draft boundary like would happen
when the bundle is applied normally.

If this general solution looks OK, I'll submit an upstream patch that makes
bundlerepo behave this way always, which will make it match the behavior that
would be seen when using ##hg unbundle##.

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1733166

Signature: t1:1733166:1420502423:f57e2fff8fe47293ecab1ac4f6efdd0507c9c7b5
2015-01-05 15:50:59 -08:00
Eric Sumner
f5303c01ab pushrebase: push phase boundary on publishing servers
Test Plan: ##run-tests.py##

Reviewers: pyd, sid0, durham

Reviewed By: durham

Subscribers: akushner, davidsp, mpm, daviser, rmcelroy, calvinb

Differential Revision: https://phabricator.fb.com/D1749892

Signature: t1:1749892:1419020663:fe78e5c3aba585e5c9c0b93e21148cdacbe3ba71
2014-12-18 16:22:19 -08:00
Eric Sumner
0f39c60f82 pushrebase: (easy) fix traditional push
Summary: Been working with js too long; python vars aren't None by default

Test Plan: ##run-tests.py##, and doing a traditional push w/ the extension enabled

Reviewers: durham, sid0, pyd

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1743710
2014-12-16 14:27:21 -08:00
Eric Sumner
4ba902f661 pushrebase: add node argument to changegroup hook
Summary: This is expected by the remotefilelog hook, and possibly others

Test Plan: ##run-tests.py##

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1743261

Signature: t1:1743261:1418762431:4fbbc1ed800023ddc51dbf53703e58294fbc2a4c
2014-12-16 12:38:48 -08:00
Eric Sumner
773c19ec6b pushrebase: (easy) fix typo
Test Plan: left-blank

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1743240

Signature: t1:1743240:1418762156:d08545a3dfd4dff3fa1f5565aa4386ee219883f1
2014-12-16 12:32:24 -08:00
Eric Sumner
a540ffa647 pushrebase: enable pushback always
Test Plan: ##run-tests.py##

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1743234

Signature: t1:1743234:1418762853:e406ef2b4a22601596e0629e4561b2a7ca9a0df3
2014-12-16 11:44:45 -08:00
Eric Sumner
17840a1afd pushrebase: disallow pushing obsolete commits
Summary:
@durin42 suggested that the extension might want to prevent processing of
obsolete commits.  Given the current state of dealing with conflicting
obsolescence markers, this seems like a good idea.

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1740886

Signature: t1:1740886:1418686275:d505ff1de8fbce39eb4fbe3a2e6d368b4b14edb8
2014-12-15 15:06:57 -08:00
Eric Sumner
3d18258260 pushrebase: extract pushback into its own function
Summary: Also, remove some spurious TODOs

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1732036

Signature: t1:1732036:1418250584:6922035a05df012445b0092f8646eb982602f07d
2014-12-10 14:22:34 -08:00
Eric Sumner
c7ba62014c pushrebase: extract obsolete marker generation into a function
Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1726944

Signature: t1:1726944:1418242222:a91974f41b5883eb659dd69135176adf066b8b47
2014-12-08 17:49:48 -08:00
Eric Sumner
3575568e6e pushrebase: extract revlist creation and validation into its own function
Summary: None of these temporary variables should be needed later

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1726850

Signature: t1:1726850:1418242127:64da1168b9f11897f6018082292e7f6285141bfd
2014-12-08 17:30:26 -08:00
Eric Sumner
4bc463862e extract temporary bundle file creation into its own function
Summary:
Transferring the part data into a bundle file on disk for bundlerepo to read
is a self-contained operation

Test Plan: ##run_tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1726767

Signature: t1:1726767:1418241560:8afac123afc847e61e6f46b6216d15b003024504
2014-12-08 17:10:24 -08:00
Eric Sumner
40f3704fa2 pushrebase: extract commit grafting into its own function
Summary: Breaking up the part handler into smaller pieces

Test Plan: ##run_tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1726701

Signature: t1:1726701:1418241313:52edc229bc635d7e703bcc2b5ee5673ece6373fa
2014-12-08 16:54:14 -08:00
Eric Sumner
cc6da40495 pushrebase: improve formatting
Summary: Update indentation to be more in-line with how hg does things

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy, mitrandir, calvinb

Differential Revision: https://phabricator.fb.com/D1726641

Signature: t1:1726641:1418086497:91cde84647f094e077966aea53668fead9c47a7a
2014-12-08 16:39:20 -08:00
Eric Sumner
af1b675338 pushrebase: call changegroup/incoming hooks
Summary:
The rebase extension bypasses the changegroup processing hooks, so they need to
be called explicitly.

Test Plan: Added hooks to the existing test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1726408

Signature: t1:1726408:1418241039:4e51a6dcbf3134f12d55c8e902de9ca7086883d1
2014-12-08 15:43:58 -08:00
Eric Sumner
e9983fe1d5 pushrebase: fix changegroup handshake
Summary:
Instead of always sending back a v1 changegroup, do the proper version
negotiation so we use the latest version supported by both client and server

Test Plan: ##run-tests.py##

Reviewers: durham, pyd

Reviewed By: pyd

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

Differential Revision: https://phabricator.fb.com/D1722669

Signature: t1:1722669:1417819262:6ab35f612fbb0dc5884caefc12e550d1d3eb0adf
2014-12-05 13:10:34 -08:00
Eric Sumner
09fb2c7f88 pushrebase: mark rebase parttype as mandatory
Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1722517

Signature: t1:1722517:1417815518:afed70bc12dcf2130091e15821d76105e8591a2c
2014-12-05 12:19:12 -08:00
Eric Sumner
f558603bc4 pushrebase: transmit common heads information in separate parttype
Summary:
This information will be useful to any pushback extension; this is a first step
towards making it a separate extension

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

Differential Revision: https://phabricator.fb.com/D1722350

Signature: t1:1722350:1417813202:a021aa449765bf49c0c2e1fe86cb90534c50fdad
2014-12-05 11:40:14 -08:00
Eric Sumner
bfd9ea6e54 Remove head/tail safety parameters; commit dummyssh into the test directory
Test Plan: ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1722193

Signature: t1:1722193:1417813982:18951855d64d13d868ca80be92b7a3ecb631337b
2014-12-05 11:02:01 -08:00
Eric Sumner
081e7652ae [pushrebase] Remove debug command
Summary:
In practice, this doesn't seem to be necessary -- testing with ##hg push##
appears to be sufficient.

Test Plan: run-tests

Reviewers: pyd, durham, sid0

Reviewed By: sid0

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1700839

Signature: t1:1700839:1416859911:321862b34c7067a11475a2e77112e77b20147dc6
2014-11-24 11:40:57 -08:00
Eric Sumner
afe0305ccb [pushrebase] Handle client not accepting obsoletion part
Summary:
The function already raises ValueError if it can't generate a suitable part
for the remote; catch it and continue otherwise

Test Plan: Run test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

Differential Revision: https://phabricator.fb.com/D1700817

Signature: t1:1700817:1416868855:cad7838c2c9be0d0657adda28d0d1796c119a4ef
2014-11-24 11:18:33 -08:00
Eric Sumner
44c7735be5 [pushrebase] Use existing mechanism to pass info between parts
Summary: Removes the mechanism I monkey-patched in

Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

Differential Revision: https://phabricator.fb.com/D1697566

Signature: t1:1697566:1416603991:38d1cb3756b428e5ffe8b8af2b97ce62afde2a57
2014-11-21 10:55:46 -08:00
Eric Sumner
9cd35a5772 [pushrebase] Send changes back over the wire
Summary: Use the bundle2 reply stream to send changes back to the client

Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1689551

Signature: t1:1689551:1416948875:987c7440298aa57d5cf46d420feab151ce9340b1
2014-11-18 16:36:46 -08:00
Eric Sumner
8ccb57bef0 [rfc] Server-side rebasing extension
Summary:
Adds a new bundle2 parttype to accept a linear changegroup and rebase it onto
the designated position on the server.

Future work:

* Issue the new parttype from ##hg push## (under what circumstances?)
* Return new revisions to client in the bundle2 response
* Write automated tests
* Support v2 changegroup packing?
* Test compatibility with the extensions we commonly use

Test Plan:
Diff includes an hg command that issues the new parttype; have used it to test
manually on a repository with 2 files.

Reviewers: akushner, sid0, davidsp, mpm, daviser, rmcelroy, pyd, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1670811

Signature: t1:1670811:1416335316:05c5ae8a35ba28cab87c474bab28afe91e8702d2
2014-11-07 16:27:47 -08:00