Commit Graph

71 Commits

Author SHA1 Message Date
Durham Goode
07da1f3e15 pushrebase: fix rebasing merge commits
Summary:
It turns out commit.files() does not return all the affected files during a
merge commit. It only returns files which differ from both p1 and p2, so in a
merge commit where we accept the changes from p2, the changes were lost during
the rebase.

This fixes it by performing a manifest diff if we're grafting a merge commit.

Test Plan:
Updated the tests to check the file contents (this test would fail
before)

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2331586
2015-08-10 22:15:03 -07:00
Gregory Szorc
4d32cb4009 pushrebase: don't use evolve in tests
Evolve isn't a part of core Mercurial nor is it part of this repository.
Make it easier to run tests for pushrebase by removing the evolve
dependency.

This does drop a workflow test that `hg evolve` after a rebased push
does the right thing. But, evolve's behavior in the presence of
specific obsolescence markers should be pretty well tested and it
shouldn't be strictly necessary to test this behavior.
2015-06-12 16:34:35 -07:00
Laurent Charignon
d051374662 pushrebase: update test to remove mistake 2015-07-30 11:14:14 -07:00
Laurent Charignon
7e55f2106e pushrebase: remove tail check
Summary:
The tail check was flagging by mistake scenarios where the push was
possible. This patch adds one of these scenario.

Test Plan: Add new test and all former tests are passing

Reviewers: ericsumner, durham

Differential Revision: https://phabricator.fb.com/D2292866
2015-07-29 13:32:51 -07:00
Laurent Charignon
4a7d8e9f70 pushrebase: fix fastfoward case
Summary:
Before this patch, pushrebase was not supporting some cases of fast
forward push. This patch fixes the issue.

Test Plan:
Added a new test. Check that the test failed before and is fixed
with the code change.

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D2279800
2015-07-24 15:23:16 -07:00
Laurent Charignon
66fabe5549 pushrebase: update tests for new version of hg 2015-07-24 16:05:56 -07:00
Laurent Charignon
d2bc198c5e pushrebase: record copies, exec and link properly
Summary:
Before this patch we were not recording all the information for file
copy, executable bit and link. This patch fixes the issue.

Test Plan: Add a new test with a copy

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D2277575
2015-07-24 09:38:01 -07:00
Laurent Charignon
8f43bce88c pushrebase: fix bug for changesets that remove file
Summary:
I saw this error when using pushrebase with fbsource on a commit
that deleted a file. We were trying to access it even if it was not in the
manifest.

Test Plan:
Modified the test
Before the code fix the new test fails with:
    remote: abort: b@46a2df24e272: not found in manifest!

Reviewers: durham, ericsumner, pyd

Differential Revision: https://phabricator.fb.com/D2274792
2015-07-23 14:11:58 -07:00
Durham Goode
1ac1afe786 pushrebase: support remotenames 2015-07-13 13:44:56 -07:00
Durham Goode
4d68369f95 Fix pushrebase tests 2015-07-08 21:08:26 -07:00
Durham Goode
66ee36a750 pushrebase: integrate with remotenames
Summary:
This makes the pushrebase extension work with the remotenames extension. It does
a few things:

1) rename --onto to be --to for consistency
2) configures remotenames to allow non-fastforward pushes
3) changes the push wrapper to happen after remotenames is loaded

Test Plan: Added a test

Reviewers: pyd, rmcelroy, lcharignon, ericsumner

Reviewed By: ericsumner

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

Signature: t1:2200222:1435695629:a92d8b20d158aa40bad1f3963af0348b6680d52d
2015-06-26 11:05:46 -07:00
Durham Goode
be9b0f0deb pushrebase: add support for rebasing merge commits
Summary:
This adds the ability to rebase changegroups that contain merge commits. It
works by identifying the maximum bundle root that is an ancestor of the desired
`onto` and rebases only things that are on top of that root.

Test Plan: Added a test

Reviewers: lcharignon, pyd, ericsumner

Reviewed By: ericsumner

Subscribers: rmcelroy

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

Signature: t1:2194350:1435695516:3a1f62bda7de0da9536a538da0bbb6deceb192f6
2015-06-25 18:49:48 -07:00
Mateusz Kwapich
a64b0e6080 pushrebase: change test to disable bundle2 where needed 2015-06-22 10:36:22 -07:00
Mateusz Kwapich
de1e111aba change ordering of lines in test for pushrebase
'cause threading
2015-06-20 14:27:30 -07:00
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
Mateusz Kwapich
8683108d87 [pushrebase] Adjust tests to new strip backup file names
Test Plan: run tests

Reviewers: sid0, davidsp, pyd, daviser, durham

Reviewed By: durham

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

Signature: t1:1825833:1423087754:245c6460599f495fb12dafe5f76d4f6ee4826c62
2015-02-04 13:47:49 -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
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
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
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