Commit Graph

17 Commits

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