Commit Graph

24 Commits

Author SHA1 Message Date
Jun Wu
7b2453666a test-pushrebase-remotenames: add necessary spaces to fix the test 2016-09-26 19:55:06 +01:00
Stanislau Hlebik
bbb7f15c99 pushrebase: cleanup
Summary: Remove unused imports + fix missing variable error in `_checkheads()`.

Test Plan: Added a new test.

Reviewers: quark, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3862724

Signature: t1:3862724:1474283118:deceacc683bb079eb7afb2ea34fb1e196f9bb18b
2016-09-26 01:48:13 -07:00
Jun Wu
9fea0c3f0c doc: replace "commit" where it is used as a noun with "changeset"
Summary:
"changeset" is a more official term and let's use it. Note that this patch
only changes documentation / i18n messages visible to the users and header
comment blocks to developers. Other places like comments in the code are
untouched.

With the "dialect" extension enabled, users will still see the more friendly
term - "commit".

Test Plan:
`arc unit`. Note the remotefilelog failure is probably unrelated - seems
related to ongoing / upcoming manifest refactoring upstream.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3900394

Signature: t1:3900394:1474470348:6a1b5691e2599cc47df18b227d56d1f9d3c7c906
2016-09-21 15:45:25 +01:00
Jun Wu
3884602d28 check-code: enfore checking before using common foreign extensions
Summary:
It's a common mistake that our tests require foreign extensions (namely evolve
and remotenames) without checking them first.

This diff adds checks to catch these mistakes, adds missing checks, and unifies
our checking logic using `require-ext.sh`, which is aware of `hgext3rd` and
prints skip message.

This affects `arc lint` so hopefully our new testing code would be free of this
kind of mistakes.

Test Plan: `arc lint` would catch errors

Reviewers: #mercurial, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3550977

Signature: t1:3550977:1468455857:e849dfd9e3cbc446cc6e6c662050ee88a3366e6c
2016-07-12 20:39:34 +01:00
Durham Goode
1069b76390 pushrebase: support pushing to non-pushrebase repos
Summary:
If pushrebase was enabled on the client, it became impossible to push
to a non-pushrebase repo using --to, like remotenames allows. The fix is to
detect if remotenames is enabled and allow the default --to behavior.

Test Plan: Added a test

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

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

Tasks: 9455435
2016-03-22 10:57:29 -07:00
Tony Tung
137ac1b118 use ssh to clone repos
Summary: This allows us to differentiate between remote output and local output.

Test Plan: pass unit test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mitrandir, mjpieters

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

Signature: t1:2955753:1455918979:235a4d8ca317a0568e5d3a72d1cd1e2baf09a910
2016-02-19 14:31:18 -08:00
Tony Tung
eae40a3eac mimick our config where remotenames is not enabled on the server
Summary: On the server, we explicitly disable remotenames.  We should test that identical config here.

Test Plan: pass unit test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mitrandir, mjpieters

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

Signature: t1:2955740:1455918916:0b1d50d3855dddc579b451f036b46ea0275f2507
2016-02-19 14:24:59 -08:00
Tony Tung
7061c1092f store the pushvars in the bundle2 operation object
Summary:
The pushvars extension ensures that it precedes the hooks.
Unfortunately, that means pushrebase does not have access to the hook
variables unless it obtains the transaction.  If it does that, then the
prepushrebase step will have the lock, defeating the purpose of the hook.

By storing the pushvars in the operation, we can retrieve it without
starting the transaction.

Test Plan: passes the BYPASS_REVIEW test when it is moved to prepushrebase

Reviewers: #sourcecontrol, durham, lcharignon

Reviewed By: durham

Subscribers: durham, mitrandir

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

Tasks: 9872386

Signature: t1:2890191:1454526611:503a30015494eef467ad545b92077bf42cdd30d5
2016-02-18 21:32:11 -08:00
Tony Tung
c6681e3e6d [pushrebase] change the pushrebase tests to use the PYTHONPATH setup
Summary: Just a bit cleaner.  Also this makes it so pushrebase can source any hypothetically shared code.  Mostly because I'm too lazy to type bundle2hooks=PATH_OF_FILE.

Test Plan: same unit tests pass.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham, mitrandir

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

Signature: t1:2903928:1454648999:81f6cc64f708dc4709640b2a214e1b3dbc11caa5
2016-02-04 22:47:14 -08:00
Eric Sumner
a08709e0e1 remove bm.write from test-pushreabse-remotenames 2016-01-20 13:40:15 -08:00
Ryan McElroy
7739d6ecbe fix tests for new remotenames
Test Plan: run tests with latest hg and latest remotenames

Reviewers: #sourcecontrol, cdelahousse, mitrandir

Reviewed By: cdelahousse, mitrandir

Subscribers: cdelahousse

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

Signature: t1:2667327:1447811426:9106bf9f091dec8ca938efe696498453c0525cee
2015-11-17 17:54:28 -08:00
Durham Goode
959bf80211 pushrebase: fix 'hg push' with remotenames
Summary:
If tracking was set up, 'hg push' was not invoking the pushrebase logic, like it
would if the user ran 'hg push --to master'.

This is required for us to unify all pushes through pushrebase, so we can move
the hooks out of the lock and into prepushrebase.

Test Plan: Added a test

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2635253
2015-11-10 10:14:29 -08:00
Durham Goode
a49358f7cc pushrebase: improve messages when pushing
Summary:
Previously the output just said "searching for changes" then "updating
bookmark", which was kind of terse. It also showed the "adding XX changesets"
output without any context, which is kind of scary to see "adding 100
changesets" when I'm only pushing one commit.

Now we mention how many commits we're pushing, what the hash range is, and how
many commits are being downloaded.

Test Plan: Ran ze tests

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir

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

Signature: t1:2594007:1446081446:99b77f4982acafc1f1940ba07b094a27dd05e354
2015-10-28 18:19:18 -07:00
Durham Goode
d15ddf0bfa pushrebase: make push -f go through pushrebase
Summary:
Since pushrebase allows running hooks outside of the lock, we want to force all
pushes to go through pushrebase. Step #1 of that is making push --force go
through the pushrebase flow.

The initial version is pretty naive. A future version might avoid the whole
graft process for performance sake.

Test Plan:
Added a test that creates a new bookmark. I also tested the same test
doing a force push.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy

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

Signature: t1:2588894:1446076583:12b58048742b112a5d7cab839204c6219414f9ee
2015-10-28 18:19:12 -07:00
Christian Delahousse
df27ba12fe Dropped local run-tests in favour of using mercurial's own test runner
Summary:
To do so, we had to change some path variables and change the output of some
tests. Removed a few dependencies that provided by hg.

Test Plan:
Ran the tests. There was some ignorable output changed (about devel-warn) caused by other code not
related to this change.

Reviewers: #sourcecontrol, pyd, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, durham

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

Signature: t1:2499721:1443745230:9d4e53e83356807f3343c8343e28d10f1b9dc35f
2015-10-01 13:03:03 -07:00
Ryan McElroy
5be993a5b8 pushrebase: fix up bad pushkey change
Summary:
Also added an additional test to show a case that fails now (and should fail),
but would have succeeded with the previous code.

Test Plan: Additional unit test

Reviewers: #sourcecontrol, durham

Reviewed By: durham

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

Signature: t1:2502396:1443809922:18ec6697b7c135c37c10f7bdd9544901c4a54c99
2015-10-02 00:46:37 -07:00
Ryan McElroy
ccb4595e9e pushrebase: redo check for bookmark moving forward
Summary:
The old check moved the bookmark old node after the prepushkey hooks
had ran, bypassing the non-ff prevention logic. This moves the old node rewrite
to before the prepushkey hook and also checks that old node is moved in a
ff-only way.

Test Plan: updated unit test

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: durham

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

Signature: t1:2499633:1443733890:4c84150bd0f21adb97feb23e54727bb4e8be38cf
2015-10-01 11:57:06 -07:00
Ryan McElroy
170afe7179 pushrebase: do not fail when old bookmark location does not match
Summary:
In pushrebase, we expect bookmarks to be moving after discovery but
before we grab the lock. With this patch, we rewrite the incoming bookmark
changes so that they do not fail if the bookmark moves after discovery.

Test Plan:
Wrote a new test to cover this behavior and verified that the test failed before
this change but works afterwards.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: durham

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

Signature: t1:2488675:1443503039:660f88da9727a74f7c9a21f0767efb5d7379d16d
2015-09-28 18:42:18 -07:00
Durham Goode
e69ea77935 pushrebase: remove transaction spam from tests
Summary:
This tests were A) unreadable, and B) not deterministic. Let's remove all that
text and have a special test just for making sure the hook vars we care about
are present.

Also break the output into multiple lines for easier reading and diffing.

And fix a change in order for the remotenames test.

Test Plan: Ran the tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2479274
2015-09-24 20:03:02 -07:00
Eric Sumner
ae66dcdfae Make pushrebase set HG_NODE when it makes a commit
Test Plan: ran tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2471540
2015-09-23 10:25:24 -07:00
Durham Goode
48f7f4f934 pushrebase: don't do rebase if -f is specified
Summary:
pushrebase doesn't support pushing non-fastward heads when remotenames is on
(since --to implies both remotenames and do a rebase). Long term we want --new
and --replace to indicate bookmark movements, but for now we can use the
existing -f to imply that we don't want a rebase to happen.

Test Plan: Added a test

Reviewers: #sourcecontrol, lcharignon

Reviewed By: #sourcecontrol, lcharignon

Subscribers: lcharignon

Differential Revision: https://phabricator.fb.com/D2307585
2015-08-03 15:33:00 -07:00
Durham Goode
fec612dcb4 pushrebase: support creating new bookmarks
Summary:
Previously pushrebase could not create new bookmarks, because the rebase target
did not exist. This fixes that.

Also fixes some output text to match the core Mercurial behavior, so tools can
rely on the text in certain cases.

Test Plan: Added a test

Reviewers: lcharignon, pyd, rmcelroy, ericsumner

Reviewed By: ericsumner

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

Signature: t1:2240418:1436895571:2f56298969e09490f6f5e6a44857eedc2bfcace4
2015-07-13 22:01:02 -07:00
Durham Goode
1ac1afe786 pushrebase: support remotenames 2015-07-13 13:44:56 -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