Commit Graph

33418 Commits

Author SHA1 Message Date
Martin von Zweigbergk
d1b1e4a13b run-tests: remove unnecessary 'with_color' variable
Its value is always the same as that of 'pygmentspresent'.

Differential Revision: https://phab.mercurial-scm.org/D118
2017-07-17 16:32:10 -07:00
Martin von Zweigbergk
63ec7f9083 run-tests: warn if --color=always and no pygments installed
Differential Revision: https://phab.mercurial-scm.org/D117
2017-07-17 16:27:13 -07:00
Martin von Zweigbergk
41812f06d0 run-tests: drop unnecessary check for pygmentspresent
47985606a0ae (run-tests: check if stream is a tty before using color,
2017-07-18) made the check redundant but forgot to remove it.

Differential Revision: https://phab.mercurial-scm.org/D116
2017-07-17 16:28:42 -07:00
Martin von Zweigbergk
b32f922e53 run-tests: pass color option via test case object , not global var
At first I updated the color field of the 'options' object (from the
CLI parser), but then I decided to put it directly on the test case
object itself to avoid mutating the shared object (even though all
tests would have the same value).

Differential Revision: https://phab.mercurial-scm.org/D114
2017-07-17 16:15:15 -07:00
Jun Wu
1b3b693903 phabricator: sanity check Differential Revision from commit message
Previously, we trust Differential Revision in commit message blindly. This
patch adds sanity check so a host name change will be detected and the
commit message will be ignored.

Differential Revision: https://phab.mercurial-scm.org/D35
2017-07-10 18:02:03 -07:00
Matt Harbison
4d8c9c4521 test-phases-exchange: properly conditionalize output
I forgot to invert the conditions, and the test runner didn't catch it[1].  But
since only '&&' is supported in the per-line feature tests, this won't work
anyway.

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/101941.html
2017-07-18 08:14:10 -04:00
Pulkit Goyal
4d367c3543 commitextras: mark the extension as ADVANCED 2017-07-18 00:10:44 +05:30
Matthieu Laneuville
ab721e92b9 run-tests: check if stream is a tty before using color
Previous implementation (ccf66c9bf5af) checked only if sys.stderr was a tty
which was less general. Also makes sure that colors is never used if pygments is
not available, irrespective of --color flag value.
2017-07-18 07:19:26 +09:00
Martin von Zweigbergk
1e3b6847e6 tests: rewrite test-rebase-detach.t using drawdag
This makes it much clearer because each test case can have exactly the
graph it wants (no extra cruft just because other tests want it).

Differential Revision: https://phab.mercurial-scm.org/D94
2017-07-14 21:44:29 -07:00
Martin von Zweigbergk
916919f081 tests: simplify config in test-rebase-detach.t
Differential Revision: https://phab.mercurial-scm.org/D93
2017-07-14 23:09:17 -07:00
Martin von Zweigbergk
e2487147f4 drawdag: include files from both parents in merge commits
Consider a graph like this:

  D
  |\
  B C
  |/
  A

drawdag will add a file called A in commit A, file B in B, file C in
C. That's fine and expected. In merge commits like D, I would expect
the files and their contents to be taken from the parent commits, so
commit D in this example would have files A, B, and C. However,
drawdag will instead add the file D compared to the first
parent. Depending on whether B or C got a smaller nodeid, the contents
of D would be {A, B, D} or {A, C, D}. This patch changes it to to be
{A, B, C}.

Differential Revision: https://phab.mercurial-scm.org/D92
2017-07-14 22:32:58 -07:00
Gregory Szorc
21ad83cca7 gitweb: preserve whitespace in description
Without this, multiple spaces or tabs in the commit message aren't
preserved and things like tables don't align properly.

As part of adding the CSS rule, we had to cuddle the content
with the <div> to not introduce leading and trailing whitespace.
The "addbreaks" filter was also removed because it would insert
an additional newline, effectively double spacing content.

Differential Revision: https://phab.mercurial-scm.org/D113
2017-07-17 15:54:15 -07:00
Gregory Szorc
8509056f34 sparse: add a requirement when a repository uses sparse (BC)
The presence of a sparse checkout can confuse legacy clients or
clients without sparse enabled for reasons that should be obvious.

This commit introduces a new repository requirement that tracks
whether sparse is enabled. The requirement is added when a sparse
config is activated and removed when the sparse config is reset.

The localrepository constructor has been taught to not open repos
with this requirement unless the sparse feature is enabled. It yields
a more actionable error message than what you would get if the
lockout were handled strictly at the requirements verification phase.
Old clients that aren't sparse aware will see the generic
"repository requires features unknown to this Mercurial" error,
however.

The new requirement has "exp" in its name to reflect the
experimental nature of sparse. There's a chance that the eventual
non-experimental feature won't change significantly and we could
have squatted on the "sparse" requirement without ill effect. If
that happens, we can teach new clients to still recognize the old
name. But I suspect we'll sneak in some BC and we'll want a new
requirement to convey new meaning.

Differential Revision: https://phab.mercurial-scm.org/D110
2017-07-17 11:45:38 -07:00
Gregory Szorc
e4e4915b76 sparse: consolidate common code for writing sparse config
In 3 functions we were writing the sparse config and updating the
working directory. In two of them we had a transaction-like process
for restoring the sparse config in case of wdir update fail.

Because the pattern is common, we've already made mistakes, and the
complexity will increase in the near future, let's consolidate the
code into a reusable function.

As part of this refactor, we end up reading the "sparse" file twice
when updating it. This is a bit sub-optimal. But I don't think it
is worth the code complexity to pass around the variables to avoid
the redundancy.

Differential Revision: https://phab.mercurial-scm.org/D109
2017-07-17 11:21:23 -07:00
Gregory Szorc
64adaa7b62 revset: pass repo when passing ui
The repo instance is currently only used to provide a changeset
lookup function as part of parsing revsets. I /think/ this allows
node fragments to resolve. I'm not sure why we wouldn't want this
to always "just work" if parsing a revset string.

Plus, an upcoming commit will introduce a new consumer that needs a
handle on the repo. So passing it more often will make that code
work more.

Passing a repo instance in all callers of revset.match* results in
a bunch of test changes. Notably, branch and tags caches get
populated as part of evaluating revsets. I'm not sure if this is
desirable. So this patch takes the conservative approach and only
passes the repo if we're passing a ui instance.

Differential Revision: https://phab.mercurial-scm.org/D97
2017-07-15 15:51:57 -07:00
Kevin Bullock
bfa5943656 win32: copy-edit debugssl messages to match prevailing style 2017-07-17 13:22:59 -05:00
Pulkit Goyal
2ceeb040ad run-tests: make sure to check if pygments is installed before using it
e80041832e introduced support to color the output of tests but used pygments
without checking whether it's installed or not. That breaks test-run-tests.t for
machines which don't have pygments installed. This patch conditionalize the
color test in test-run-tests.t and also add a check to make sure pygments is
installed before using that.
2017-07-15 02:17:05 +05:30
Gregory Szorc
fde2177334 sparse: require [section] in sparse config files (BC)
Previously, [include] was implicit and pattern lines before a
[section] were added to includes.

Because the format may change in the future and explicit behavior,
well, more explicit, this commit changes the config parser to
reject pattern lines that don't occur in a [section].

Differential Revision: https://phab.mercurial-scm.org/D96
2017-07-15 13:21:23 -07:00
Gregory Szorc
edf6de3f78 sparse: use set for capturing profiles
Order doesn't need to be preserved. A set is acceptable.

Differential Revision: https://phab.mercurial-scm.org/D95
2017-07-15 13:07:57 -07:00
Alex Gaynor
088c6ecb28 util: remove dead code which used to be for old python2 versions
Differential Revision: https://phab.mercurial-scm.org/D107
2017-07-17 12:38:07 -04:00
Matt Harbison
7bfa32d43e help: cleanup grammar in the hooks section 2017-07-04 22:58:21 -04:00
Augie Fackler
23d737c926 merge with i18n 2017-07-04 10:18:44 -04:00
Augie Fackler
73e7629f41 revlog: backed out changeset ee3dde8eb4c5
We'll move this to the default branch.
2017-07-04 10:17:14 -04:00
Wagner Bruna
4dab97608c i18n-pt_BR: synchronized with bfeb75461255 2017-06-29 12:07:54 -03:00
Pierre-Yves David
d0426e2f1a revlog: add an experimental option to mitigated delta issues (issue5480)
The general delta heuristic to select a delta do not scale with the number of
branch. The delta base is frequently too far away to be able to reuse a chain
according to the "distance" criteria. This leads to insertion of larger delta (or
even full text) that themselves push the bases for the next delta further away
leading to more large deltas and full texts. This full text and frequent
recomputation throw Mercurial performance in disarray.

For example of a slightly large repository

  280 000 files (2 150 000 versions)
  430 000 changesets (10 000 topological heads)

Number below compares repository with and without the distance criteria:

manifest size:
    with:    21.4 GB
    without:  0.3 GB

store size:
    with:    28.7 GB
    without   7.4 GB

bundle last 15 00 revisions:
    with:    800 seconds
             971 MB
    without:  50 seconds
              73 MB

unbundle time (of the last 15K revisions):
    with:    1150 seconds (~19 minutes)
    without:   35 seconds

Similar issues has been observed in other repositories.


Adding a new option or "feature" on stable is uncommon. However, given that this
issues is making Mercurial practically unusable, I'm exceptionally targeting
this patch for stable.

What is actually needed is a full rework of the delta building and reading
logic. However, that will be a longer process and churn not suitable for stable.

In the meantime, we introduces a quick and dirty mitigation of this in the
'experimental' config space. The new option introduces a way to set the maximum
amount of memory usable to store a diff in memory. This extend the ability for
Mercurial to create chains without removing all safe guard regarding memory
access. The option should be phased out when core has a more proper solution
available.

Setting the limit to '0' remove all limits, setting it to '-1' use the default
limit (textsize x 4).
2017-06-23 13:49:34 +02:00
Pierre-Yves David
133a01a035 rebase: also test abort from pretxnclose error
Different hooks will have different properties so we cover more hooks to catch
further regressions.
2017-06-27 18:13:10 +02:00
Pierre-Yves David
8561b85a7e rebase: reinforce testing around precommit hook interrupting a rebase
Different hooks will have different properties so we cover more hooks to catch
further regression.
2017-06-27 18:10:55 +02:00
Pierre-Yves David
d9644794db rebase: provides test case for (issue5610)
The 4.2 release introduces a regression regarding the behavior of rebase with
some hook failures. We add the tests from the bug report from Henrik Stuart to
our test base to prevent further regression on this.
2017-06-27 17:45:58 +02:00
Pierre-Yves David
17353b92ba rebase: backed out changeset 507f16f4aa51 (issue5610)
Having a single transaction for rebase means the whole transaction gets rolled back
on error. To work around this a small hack has been added to detect merge
conflict and commit the work done so far before exiting. This hack works because
there is nothing transaction related going on during the merge phase.

However, if a hook blocks the rebase to create a changeset, it is too late to commit the
work done in the transaction before the problematic changeset was created. This
leads to the whole rebase so far being rolled back. Losing merge resolution and
other work in the process. (note: rebase state will be fully lost too).

Since issue5610 is a pretty serious regression and the next stable release is a
couple day away, we are taking the backout route until we can figure out
something better to do.
2017-06-27 17:40:24 +02:00
Pierre-Yves David
70672e4541 rebase: backed out changeset 4bc0c14fb501
In the process of fixing issue5610 in 4.2.2, we are trying to backout
507f16f4aa51. This changeset is making changes that depend on 507f16f4aa51,
so we need to back it out first.

Since issue5610 is pretty serious regression and the next stable release is a
couple of days away, we are taking the backout route until we can figure out
something better to do.
2017-06-27 17:39:55 +02:00
Anton Shestakov
a666e891cf make: add Debian 9 (Stretch) docker target 2017-06-23 13:33:41 +08:00
Anton Shestakov
5f2a285fbe make: templatize Debian build target a la 7766b31dd141 2017-06-23 13:08:46 +08:00
Anton Shestakov
d3bb529590 make: add Ubuntu Zesty docker targets (.deb and ppa)
Zesty Zapus was released on 2017-04-13 and will be supported until 2018-01.
2017-06-23 12:04:12 +08:00
Anton Shestakov
51ae08ed10 docker: install less as a build-time dependency in deb-based distros
It's needed since 99d9c6aa0389, otherwise dpkg-checkbuilddeps errors out.
2017-06-23 10:05:01 +08:00
Pierre-Yves David
1b59e168fe eol: fix 'error' parameter name in the commitctx wrapper
Since its introduction in c7ec460797a9, the parameter has always been name
"error". Yet the eol extension have been using 'haserror' as the argument name,
breaking extensions with subclass passing 'error' as a keyword argument.
2017-06-23 13:22:04 +02:00
Pierre-Yves David
f83c410836 eol: import 'error' as 'errormod'
We need the 'error' name available to fix another bug, so we rename the imported
module.
2017-06-23 13:24:45 +02:00
Pulkit Goyal
7ea95030b1 status: add a flag to terse the output (issue4119)
This adds an experimental flag -t/--terse which will terse the output. The terse flag
will respect other flags which filters the output. The flag takes a string
whose value can be a subsequence of "marduic" (the order does not matter here.)

Ignored files are not considered while tersing unless -i flag is passed or 'i'
is there is the terse flag value.

The flag is experimental for testing as there may be cases which will produce
strange results with the flag. We can set the terse on by default by simply
passing 'u' to the cmdutil.tersestatus().

This patch also adds a test file with tests covering the new feature.
2017-06-17 20:10:22 +05:30
Pulkit Goyal
262b010c09 commitextras: check the format of the arguments and no internal key is used
This patch adds check to make the arguments are passed as KEY=VALUE and no key
which is used internally is passed.

This patch also adds test for the extension.
2017-07-12 16:10:10 +05:30
Pulkit Goyal
90d68a27f9 commitextras: move fb extension to core which add extras to a commit
This patch moves the Facebook extension to add extra fields to a commit to a
in-core extension.
2017-07-12 00:23:45 +05:30
Matt Harbison
312e37cc1e archive: add an experimental config to control the metadata file template
Experimental because given the possible complexity, it may be worth figuring out
how to load this from a file, similar to the style files for the log command,
instead of trying to stuff it on the command line.
2017-07-17 00:49:29 -04:00
Matt Harbison
9f1bd9a3e0 archive: use a templater to build the metadata file
There are no visible changes here.

I'm starting to wonder if adding the '+' to the 'node' line instead of a
separate key line in a4d42f6edc09 was the right thing to do.  The '{node}'
keyword never includes '+' elsewhere, and the way setup.py works, it would
truncate it anyway.  Additionally, the file is missing '{p2node}' when 'wdir()'
merges are archived.  I thought about adding an 'identify' line that would
correspond to `hg id -n`.  But the other nodes are the full 40 characters, and
the output most useful for versioning is the short form.  All of this cries out
for customization via templating.  (Although maybe having the short identify
line by default is still a good idea.)
2017-07-16 17:40:36 -04:00
Jun Wu
ba3af86825 commandserver: do not handle EINTR for selector.select
selectors2 library handles EINTR transparently so we don't need to handle
select.error ourselves.
2017-07-16 11:17:00 -07: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
Boris Feld
68ddce738e transaction-summary: display the summary for all transactions
Now that we records "all" changes happening in a transaction (in tr.changes)
we will be able to provide better report on various changes (phases turned
public, changeset obsoleted, branch merged or created, etc..)

This is far too late in the cycle to play with this, but having this existing
method called more widely will help extensions to play around with various
options during the 4.4 cycle.

Instead of calling registersummarycallback only for transactions we want, we
always call it and use the transaction name to decide when to report (eg: we
do not want `hg amend` to report new obsoleted changesets). Filtering on
transaction name does not seems great, but seems good enough for the moment.
We can change the API during the next cycle.

The previous manual call during unbundling of the bundle2 "obsmarkers" part is
no longer necessary and has been dropped.
2017-07-16 02:20:06 +02:00
Boris Feld
4458de1334 test-strip: fix call to super class in crashstriprepo
The 'self' argument is already taken care of by the 'super(...)' call. Instead
we were passing the repository instance as the 'desc' value.

This got discovered by breaking the next changeset.
2017-07-16 02:38:14 +02:00
Boris Feld
838490c3d7 share: share 'cachevfs' with the source clone (issue5108)
Share extension now also share caches reads and writes. Not sharing caches
results in costly caches recomputations which can takes up to minutes when
using shares on large repositories.

There are a couple of file in the '.hg/cache/' that depends of the current
visibility. Visibility can be affected by the working copy location, something
which is specific to each share. We ignores them for this series because they:

* are the minority,
* already have a good fallback to other precomputed caches,
* are only affected when people use the experimental evolution feature.
2017-07-15 23:49:22 +02:00
Boris Feld
7c41aa9dd4 cachevfs: add a devel warning for cache access though 'vfs'
This will help third party extensions to migrate to the new 'cachevfs'.
2017-07-15 23:05:15 +02:00
Boris Feld
822a3e705e cachevfs: migration the tags fnode cache to 'cachevfs'
This will help sharing the cache between shares.
2017-07-15 23:30:25 +02:00
Boris Feld
439a5e0f6f cachevfs: migrate tagscache to 'cachevfs'
This will help sharing the cache between shares.
2017-07-15 23:30:16 +02:00
Boris Feld
95cb3ea225 cachevfs: migration the revbranchcache to 'cachevfs'
This will help sharing the cache between shares.
2017-07-15 22:42:50 +02:00