Commit Graph

17 Commits

Author SHA1 Message Date
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