Commit Graph

24 Commits

Author SHA1 Message Date
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.

This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  99.990  86.410  12.000  99.990   test-revset.t

And 10 seconds after:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  10.080   0.380   0.130  10.080   test-revset.t

Also enable it for some other tests. Note the whitelist is not complete.  We
probably want to whitelist more tests in the future.

The feature could be opted out by deleting `contrib/chg/chg`.

Reviewed By: phillco

Differential Revision: D6767036

fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
2018-04-13 21:50:54 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Boris Feld
3276655886 config: replace experimental.stabilization by experimental.evolution
We replace 'experimental.stabilization=all' by 'experimental.evolution=true'
as we will extract individual config in their own config in later patches.

Differential Revision: https://phab.mercurial-scm.org/D1148
2017-10-17 11:29:26 +02:00
Boris Feld
9c0d9e0f57 configitems: register the test config in 'test-push-race.t' 2017-10-11 23:33:59 +02:00
Denis Laxalde
9efc7f05e3 transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Upon pull or unbundle, we display a message with the range of new revisions
fetched. This revision range could readily be used after a pull to look out
what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
revisions that might be present in transaction's "changes" but should not be
displayed to the end user.
2017-10-12 09:39:50 +02:00
Saurabh Singh
4d1fce7aa0 test-push-race: use 'ui.atexit' instead of python's 'atexit'
Callbacks registered with 'atexit' are sometimes not called (like when a
process is killed by the SIGTERM signal). Therefore, this commit replaces it
with 'ui.atexit' which ensures that the callbacks are always called. This also
makes the test compatible with chg.

Test Plan:
Ran the test 'test-push-race.t' with and without the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D957
2017-10-05 20:46:49 +00:00
Boris Feld
c886c86073 test: update evolution config
evolution* config has been rewritten in stabilization* in the previous patch,
update tests file to use the new names.

Differential Revision: https://phab.mercurial-scm.org/D249
2017-08-04 18:41:16 +02:00
Boris Feld
b989852f8f debugobsolete: also report the number of obsoleted changesets
This seems useful to have the number of obsoleted changesets when calling
debugobsolete.
2017-07-16 02:33:14 +02:00
Martin von Zweigbergk
b2ef392aae tests: fix reference to undefined variable
The delaypush() function had a reference to "repo" that was clearly
supposed to be "pushop.repo". Instead of just fixing that, let's
extract "pushop.repo.ui" to a variable, since that's the only
piece of the repo that's needed in the function.

I have not looked into why I saw a different result in the test to
start with, but that's for another patch anyway.
2017-07-06 14:17:02 -07:00
Augie Fackler
3112944d5b tests: replace yet more calls to python with $PYTHON
These are some simple cases. More to come in a future change.

Reviewers: krbullock

Reviewed By: krbullock

Differential Revision: https://phab.mercurial-scm.org/D4
2017-07-05 11:10:11 -05:00
Pierre-Yves David
5e97e55c0f obsolete: reports the number of local changeset obsoleted when unbundling
This is a first basic visible usage of the changes tracking in the transaction.
We adds a new function computing the pre-existing changesets obsoleted by a
transaction and a transaction call back displaying this information.

Example output:

  added 1 changesets with 1 changes to 1 files (+1 heads)
  3 new obsolescence markers
  obsoleted 1 changesets

The goal is to evolve the transaction summary into something bigger, gathering
existing output there and adding new useful one. This patch is a good first step
on this road. The new output is basic but give a user to the content of
tr.changes['obsmarkers'] and give an idea of the new options we haves. I expect
to revisit the message soon.

The caller recording the transaction summary should also be moved into a more
generic location but further refactoring is needed before it can happen.
2017-06-28 03:54:19 +02:00
Pierre-Yves David
92f804bd36 check-concurrency: expose the feature as 'concurrent-push-mode'
We move the feature to a proper configuration and document it. The config goes
in the 'server' section because it feels like something the server owner would
want to decide. We pick and open field because it seems likely that other
checking levels will emerge in the future. (eg: server like the mozilla-try
server will likely wants a "none" value)

The option name contains 'push' since this affects 'push' only. The option value
'check-related' is preferred over one explicitly containing 'allow' or 'deny'
because the client still have a strong decision power here. Here, the server is
just advising the client on the check mode to use.
2017-05-28 00:12:38 +02:00
Pierre-Yves David
a74c131fb4 push: add a way to allow concurrent pushes on unrelated heads
Client has a mechanism for the server to check that nothing changed server side
since the client prepared a push. That check is wide and any head changed on
the server will lead to an aborted push. We introduce a way for the client to
send a less strict checking. That logic will check that no heads impacted by
the push have been affected. If other unrelated heads (including named branches
heads) have been affected, the push will proceed.

This is very helpful for repositories with high developers traffic on different
heads, a common setup.

That behavior is currently controlled by an experimental option. The config
should live in the "server" section but bike-shedding of the name will happen
in the next changesets. Servers advertise this capability through a new bundle2
capability 'checkeads', using the value 'related'.

The 'test-push-race.t' is updated to check that new capabilities on the
documented cases.
2017-05-29 05:53:58 +02:00
Pierre-Yves David
b4a185b2cf test: add a push race case where the updated head is obsoleted
This is the mirror of the previously added case. We check the case where the
racing-push obsoletes a head while the raced-push updates that same head.
2017-05-29 05:53:51 +02:00
Pierre-Yves David
da1588880d test: add a push race case where obsoleted head is updated
We check the case where the raced-push obsoletes a head while the racing-push
updates that same head.
2017-05-29 05:53:24 +02:00
Pierre-Yves David
1aa4859c58 test: add the mirror push race case for non-contiguous branch head
We check case where the raced push update that a head through another named
branch while the racing push update that same head.
2017-05-27 22:27:56 +02:00
Pierre-Yves David
f372990b3a test: add a push race case where non-contiguous branch head are created
We check case where the raced push an update to branch default head while the
racing push update that same head but through another named branch.
2017-05-27 22:27:41 +02:00
Pierre-Yves David
729522bea7 test: add a push race case where the raced push touch multiple heads
We check case where the raced push update all heads while the racing push
update one of them.
2017-05-27 22:27:09 +02:00
Pierre-Yves David
2478014ca3 test: add a push race case where racing push touches multiple heads
We check case where the raced push updates a head while the racing push update
all of them.
2017-05-27 22:26:51 +02:00
Pierre-Yves David
94af527060 test: add a push race case where racing push create a new named branch
This is the mirror case from the previos one. We check case where the raced
push update a head while the racing push create a new named branch as a
children of that updated head.
2017-05-27 22:26:35 +02:00
Pierre-Yves David
a9b3ca63c6 test: add a push race case where raced push created a new named branch
We check case where the raced push create a new branch on the same head updated
by the racing push.
2017-05-27 22:26:16 +02:00
Pierre-Yves David
b95fd82d01 test: add a push race case where the racing client create a new head
We check case where the raced client push updates an existing head while the
racing client push creates a new one.
2017-05-27 22:25:40 +02:00
Pierre-Yves David
0ba4b1a95b test: add a push race case where each client replaces a different head
We check case where the raced push replace one head while the racing push
replaces another unrelated one.

That second test also make sure we synchronise all repositories to the same
state between tests. That will help us when allowing some sort of concurrent
pushes.
2017-05-27 22:25:20 +02:00
Pierre-Yves David
aa1066f0d0 test: add a file dedicated to push race between clients
There are very few tests around the detection of push race. This file will be
dedicated to covering these cases more through fully. We start with a simple
case. More complex cases get added in later changesets.

My end goal here is to provide a way for server to accept concurrent push as
long as they are not touching the same heads. However, I want to buff the test
coverage of that code before touching anything.
2017-05-27 22:24:58 +02:00