Commit Graph

47 Commits

Author SHA1 Message Date
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Pierre-Yves David
4db3d34a4b discovery: include timing in the debug output
Having such date easily available is useful. It also prepare the inclusion of
some discovery related data in blackbox.
2017-06-07 10:29:39 +01:00
Pierre-Yves David
667d10975b changegroup: skip delta when the underlying revlog do not use them
Revlog can now be configured to store full snapshot only. This is used on the
changelog. However, the changegroup packing was still recomputing deltas to be
sent over the wire.

We now just reuse the full snapshot directly in this case, skipping delta
computation. This provides use with a large speed up(-30%):

# perfchangegroupchangelog on mercurial
! wall 2.010326 comb 2.020000 user 2.000000 sys 0.020000 (best of 5)
! wall 1.382039 comb 1.380000 user 1.370000 sys 0.010000 (best of 8)

# perfchangegroupchangelog on pypy
! wall 5.792589 comb 5.780000 user 5.780000 sys 0.000000 (best of 3)
! wall 3.911158 comb 3.920000 user 3.900000 sys 0.020000 (best of 3)

# perfchangegroupchangelog on mozilla central
! wall 20.683727 comb 20.680000 user 20.630000 sys 0.050000 (best of 3)
! wall 14.190204 comb 14.190000 user 14.150000 sys 0.040000 (best of 3)

Many tests have to be updated because of the change in bundle content. All
theses update have been verified.  Because diffing changelog was not very
valuable, the resulting bundle have similar size (often a bit smaller):

# full bundle of mozilla central
with delta:    1142740533B
without delta: 1142173300B

So this is a win all over the board.
2016-10-14 01:31:11 +02:00
timeless
a57e86590a discovery: use single quotes in use warning 2016-09-20 23:47:30 +00:00
Pierre-Yves David
da34f186a3 tests: remove bundle2 activation from test-push-warn.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
2016-08-02 03:54:17 +02:00
Jordi Gutiérrez Hermoso
dc2068ce42 dispatch: add fail-* family of hooks
The post-* family of hooks will not run in case a command fails (i.e.
raises an exception). This makes it inconvenient to hook into events
such as doing something in case of a failed push.

We catch all exceptions to run the failure hook. I am not sure if this
is too aggressive, but tests apparently pass.
2016-04-28 10:37:47 -04:00
Martin von Zweigbergk
63c15f247e changegroup3: introduce experimental.changegroup3 boolean config
In order to give us the freedom to change the changegroup3 format,
let's hide it behind an experimental config. Since it is required by
treemanifests, that will override the cg3 config.
2016-01-12 21:23:45 -08:00
Mike Edgar
44af48ee4a changegroup: add flags field to cg3 delta header
This lets revlog flags be transmitted over the wire. Right now this is
useful for censored nodes and for narrowhg's ellipsis nodes.
2015-12-14 15:55:12 -05:00
Pierre-Yves David
cc5966c01a test: use bundle2 for exchange in test-push-warn
Using bundle2 for exchange unlocks the usage of changegroup version 2. This
version of the changegroup held more information (delta base) that result in
a small increase in content size (20 bytes x 2 changes).
2015-05-27 04:30:40 -07:00
Matt Mackall
1b6a04b2ec branch: don't warn about branches if repository has multiple branches already
This warning exists to prevent git users from prematurely polluting
their namespace when trying out Mercurial. But for repos that already
have multiple branches, understanding what branches are is not
optional so we should just shut up.
2015-05-22 17:08:59 -05:00
Pierre-Yves David
281365197e progress: get the extremely verbose output out of default debug
When the progress extension is not enabled, each call to 'ui.progress' used to
issue a debug message. This results is a very verbose output and often redundant
in tests. Dropping it makes tests less volatile to factor they do not meant to
test.

We had to alter the sed trick in 'test-rename-merge2.t'. Sed is used to drop all
output from a certain point and hidding the progress output remove its anchor.
So we anchor on something else.
2015-05-09 23:40:40 -07:00
Gregory Szorc
f0e6b05c9b commands.push: abort when revisions evaluate to empty set (BC)
If the "-r" argument is specified to "hg push," the user has expressed
an intent for a specific changeset to be present on the remote. If that
expression cannot be mapped to a known changeset, the user's intent is
ambiguous and cannot be acted upon without making assumptions.

Previously, if arguments to `push -r <rev>` evaluated to an empty set
(perhaps the user specified a revset that didn't evaluate to anything),
the empty "revs" list would be passed down to "exchange.push" where
it appears the empty list was being interpreted as "push everything."

This patch adds validation to the "-r" argument to the push command. If
the argument is specified but doesn't resolve to a changeset, the
command will abort instead of doing something potentially unexpected.

This patch is technically breaking backwards compatibility. I believe
this is justified because the new behavior closes a crack that could
result in undefined or under-defined behavior. Also, this patch doesn't
drop client capabilities because if users really wanted to push all
changesets, they can simply omit the "-r" argument from push completely.
2015-03-23 18:21:01 -07:00
Matt Harbison
9741c43e48 tests: replace uses of 'seq' with portable 'seq.py' 2015-03-17 21:47:47 -04:00
Mads Kiilerich
af8710d713 bundle: when verbose, show what takes up the space in the generated bundle
This is kind of similar to the debugbundle command but gives summarized actual
uncompressed number of bytes when creating the bundle. The numbers are as
usable as the bundle format is efficient. Hopefully bundle2 will make it a
better indicator of actual entropy.

This is useful when accepting pull requests to assess whether the repo size
increase seems reasonable for the diff before pushing stuff upstream, It has
helped me catching large files that should have been committed as largefiles
but was committed as regular files in intermediate changesets.

This output doesn't combine well with debug output so we only enable it when
verbose without debug.
2014-08-15 19:43:32 +02:00
Pierre-Yves David
f2ec8aebea push: move bookmark discovery with other discovery steps
The discovery of necessary bookmark updates is now done within the "discovery
phase". This opens the door to the inclusion of bookmarks in a unified bundle2
push.
2014-08-15 18:39:39 -07:00
Pierre-Yves David
bee675a073 push: perform phases discovery before the push
This will allow including phase information in the same bundle2 as the
changesets.
2014-07-30 19:26:47 -07:00
Mads Kiilerich
bdb0a37b31 discovery: don't report all "unsynced" remote heads (issue4230)
49e52fbb2acd made discovery more helpful - too helpful for some extreme use
cases.

Instead, we arbitrarily limit the list it at 4 and add 'or more'.
2014-04-24 16:47:22 +02:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Mads Kiilerich
303021da0b discovery: improve "note: unsynced remote changes!" warning
This message frequently caused confusion. "unsynced" is not a well established
user-facing concept in Mercurial and the message was not very specific or
helpful.

Instead, show a message like:
  remote has heads on branch 'default' that are not known locally: 6c0482d977a3

This message will also (when relevant) be shown before aborting on "push
creates new remote head".

A similar (but actually very different) message was addressed in cbd5a12a601a.
2014-02-06 02:19:38 +01:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Mads Kiilerich
a4925d4784 discovery: make note messages for new heads more readable 2013-11-16 15:46:29 -05:00
Mads Kiilerich
d93d477327 discovery: tweak error message for multiple branch heads 2013-11-16 15:46:29 -05:00
FUJIWARA Katsunori
9246c0599a discovery: revise hint message introduced by changeset 49ed20ea8da0
This patch revises hint message from "for detail about" introduced by
changeset 49ed20ea8da0 to "for details about", to unify it with the
hint message introduced by proceeding patch.
2013-10-03 23:16:07 +09:00
FUJIWARA Katsunori
3198fa3830 push: hide description about "-f" in the hint to prevent from using it easily
"use push -f to force" in the hint at abortion of "hg push" may cause
novice users to execute "push -f" easily without understanding about
problems of multiple branch heads in the repository.

This patch hides description about "-f" in the hint, and leads into
seeing "hg help push" for details about pushing new heads.
2013-10-03 23:16:06 +09:00
FUJIWARA Katsunori
477426f110 discovery: abort also when pushing multiple headed new branch
Before this patch, pushing with --new-branch permits to create
multiple headed branch on the destination repository.

But permitting to create new branch should be different from
permitting to create multiple heads on branch.

This patch prevents from careless pushing multiple headed new branch,
and requires --force to push such branch forcibly.
2013-10-01 00:26:22 +09:00
Mads Kiilerich
d12d20b98d discovery: process heads in sorted order 2013-01-15 02:59:12 +01:00
Pierre-Yves David
a4bba98ab8 pushkey: add more verbose debug output regarding pushkey
Very few data are displayed now, making it hard to debug phases and obsolete
related issues.
2012-07-28 12:28:35 +02:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Matt Mackall
2157179ce3 push: return 1 if no changes found (issue3228)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       0

This fixes the lower-right entry.
2012-01-30 11:32:09 -06:00
Matt Mackall
a69962e18c branch: warn on branching 2011-12-08 14:32:44 -06:00
Matt Mackall
b06b887ee8 discovery: quiet note about heads
This was changing output on in/out -v for no good reason.
2011-07-05 14:30:42 -05:00
Peter Arrenbrecht
9a2d2f747c setdiscovery: batch heads and known(ownheads)
This means that we now discover both subset conditions (local<remote and
remote<local) in a single roundtrip without ever constructing an actual
sample (which takes a bit of client CPU).
2011-06-14 22:58:00 +02:00
Adrian Buehlmann
ff008eb648 prepush: show details about new remote heads with --verbose
previously, this info was only shown with --debug

Note that the new remote heads are only shown if the command aborts,
that is, they are *not* shown if --force was specified.

See also change 914ebeb62db8.
2011-06-03 13:10:22 +02:00
Adrian Buehlmann
1c143846c7 prepush: print short hash of first new head in abort message
and don't mention the branch if it's the default branch.

OLD:

  $ hg push ../a
  pushing to ../a
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (you should pull and merge or use push -f to force)

NEW:

  $ hg push ../a
  pushing to ../a
  searching for changes
  abort: push creates new remote head 1e108cc5548c!
  (you should pull and merge or use push -f to force)

This helps to identify which local head is causing troubles.

See also change 914ebeb62db8.
2011-06-03 12:16:17 +02:00
Peter Arrenbrecht
75fa0e5ea9 discovery: add new set-based discovery
Adds a new discovery method based on repeatedly sampling the still
undecided subset of the local node graph to determine the set of nodes
common to both the client and the server.

For small differences between client and server, it uses about the same
or slightly fewer roundtrips than the old tree-based discovery. For
larger differences, it typically reduces the number of roundtrips
drastically (from 150 to 4, for instance).

The old discovery code now lives in treediscovery.py, the new code is
in setdiscovery.py.

Still missing is a hook for extensions to contribute nodes to the
initial sample. For instance, Augie's remotebranches could contribute
the last known state of the server's heads.

Credits for the actual sampler and computing common heads instead of
bases go to Benoit Boissinot.
2011-05-02 19:21:30 +02:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Martin Geisler
5a0135a6ca tests: remove redundant mkdir
There are still many tests that check that a bare 'hg init'
initializes the current directory.
2011-04-19 12:04:44 +02:00
Matt Mackall
81bd0b7967 merge: back out single-parent fast-forward merge
This backs out

 changeset:   13158:17d1b96c0f12
 user:        Mads Kiilerich <mads@kiilerich.com>
 date:        Tue Dec 07 03:29:21 2010 +0100
 summary:     merge: fast-forward merge with descendant

Before named branches, the invariants were:

a) "merges" always have two parents
b) p1 is not linearly related to p2

Adding named branches made (b) problematic, so the above patch was
introduced, which fixed (b) but broke (a).

After discussion, we decided that the invariants should be:

a) "merges" always have two parents
b) p1 is not linearly related to p2 OR p1 and p2 are on different branches
2011-03-07 15:03:10 -06:00
Mads Kiilerich
9772d9af5a merge: fast-forward merge with descendant
issue2538 gives a case where a changeset is merged with its child (which is on
another branch), and to my surprise the result is a real merge with two
parents, not just a "fast forward" "merge" with only the child as parent.

That is essentially the same as issue619.

Is the existing behaviour as intended and correct?

Or is the following fix correct?

Some extra "created new head" pops up with this fix, but it seems to me like
they could be considered correct. The old branch head has been superseeded by
changes on the other branch, and when the changes on the other branch is merged
back to the branch it will introduce a new head not directly related to the
previous branch head.

(I guess the intention with existing behaviour could be to ensure that the
changesets on the branch are directly connected and that no new heads pops up
on merges.)
2010-12-07 03:29:21 +01:00
Adrian Buehlmann
c5ab776a53 discovery: list new remote heads in prepush() on --debug
With this patch applied, Mercurial will list the hashes of new remote heads
if push --debug aborts because of new remote heads (option -f/--force not set).

Example:

  $ hg push --debug repo1
  using http://example.org/repo1
  http auth: user johndoe, password not set
  sending between command
  pushing to http://example.org/repo1
  sending capabilities command
  capabilities: changegroupsubset stream=1 lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN branchmap
  sending heads command
  searching for changes
  common changesets up to 187dd3f0a37d
  sending branchmap command
  new remote heads on branch 'default'        <- new output line
  new remote head 5862c07f53a2                <- new output line
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Compare to without --debug (not changed by this patch, including it here
for reference purposes only):

  $ hg push repo1
  pushing to http://example.org/repo1
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Motivation for this change:

'hg outgoing' may list a whole lot of benign changesets plus an odd changeset
that will trigger the "new remote heads" abort. It can be hard to spot that
single unwanted changeset (it may be an old forgotten experiment, lingering
in the local repo).

"hg log -r 'heads(outgoing())'" might be useful, but that also lists a head
that may be benign on push.

Inside prepush(), we already know which heads are causing troubles on 'hg push'.
Why not make that info available (at least on --debug)?

This would also be helpful for doing remote support, as the supporter can ask
the user to paste the output of 'hg push --debug' on error and then ask further
questions about the heads listed.
2010-11-11 15:51:20 +01:00
Matt Mackall
0f064b0796 check-code: warning and fixes for whitespace in unified tests 2010-10-20 14:57:36 -05:00
Martin Geisler
3d112b3042 tests: added a short description to issue numbers
Many tests already had a short line to describe what IssueXXX is
about. I find that quite useful when reading a test.
2010-09-24 10:13:49 +02:00
Matt Mackall
ac660e9f65 tests: cleanup exit code handling in unified tests 2010-09-21 16:00:02 -05:00
Matt Mackall
200e89394d tests: fix a bunch of pointless #s in unified tests 2010-09-17 17:03:08 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Sune Foldager
843894f4b3 tests: remove exec bit from .t files 2010-09-14 16:03:10 +02:00
Adrian Buehlmann
79059e20c1 combine tests 2010-09-14 12:20:51 +02:00