Commit Graph

34708 Commits

Author SHA1 Message Date
muxator
571ba67b50 update: mention long options explicitly in description of merge.update()
The short options "-c" and "-C" may be confusing for a novice reading the
documentation. Let's try to be more explicit, also mentioning the equivalent
long options ("--check" and "--clean") in the comments.
2017-10-04 23:22:34 +02:00
Yuya Nishihara
feaa3f8a8c mq: copy pager attributes back to qrepo.ui
If the legacy pager extension is enabled, a pager is started through repo.ui
at dispatch._runcommand(). After that, mqcommand() creates a qrepo with a
fresh repo.baseui, at which point pager information was lost and another pager
would be spawned by the modern pager interface.

This is a minimal workaround for the problem.
2017-10-21 13:42:43 +09:00
Yuya Nishihara
9e02f75b4c registrar: host "dynamicdefault" constant by configitem object
This is the common pattern seen in the other registrar classes.
2017-10-21 13:13:20 +09:00
Yuya Nishihara
74c1bd2363 configitems: register 'ui.editor' 2017-10-21 13:04:58 +09:00
Yuya Nishihara
1d02a603e8 help: do not abort topicmatch() because of unimportable extensions
This is alternative workaround to D1198, originally spotted by the earlier
version of the releasenotes extension.
2017-08-05 23:15:37 +09:00
Yuya Nishihara
6e8c1d0f1a configitems: register 'email.to' and 'patchbomb.to' 2017-10-20 22:25:09 +09:00
Boris Feld
87151ab0b0 exchange: propagate the subfunctions return
The parts generator can return a callback to handle server reply. We should
propagate the return for correctness.
2017-10-19 21:50:14 +02:00
Kevin Bullock
d8f39381cf merge default into stable for code freeze
# no-check-commit because default contains new vendored code
2017-10-19 15:15:05 -05:00
Denis Laxalde
6a72a6393c log: add an assertion about fctx not being None in patch.diff()
As noted in the comment, this should not happen as removed files (the cause of
fctx2 being None) are caught earlier.
2017-10-19 15:06:33 +02:00
Denis Laxalde
daa0a6c266 log: handle removed files with --line-range patterns
I.e. abort when the pattern corresponds to a removed file, as done with bare
file patterns.
2017-10-19 14:55:10 +02:00
Denis Laxalde
40359bfd01 log: disable bare file patterns with --line-range
Currently, specifying both a line-range pattern and a bare file pattern
results in an AND operation whereas we probably want an OR so that bare file
patterns are like a line-range pattern with all lines specified.

So, until this works as expected, we disable this.
2017-10-19 14:12:49 +02:00
Denis Laxalde
21cd66f96c log: switch to FROMLINE:TOLINE syntax for -L/--line-range
This is more consistent with the followlines() revset.
2017-10-19 12:37:26 +02:00
Denis Laxalde
7b3941db14 log: handle binary files in --line-range patterns
When a file is binary patch.trydiff() would yield None for 'hunkrange'. Handle
this case in the hunksfilter() callback.
Add tests with and without diff.git option as binary handling differs
depending on this option's value.
2017-10-18 19:00:33 +02:00
muxator
a02f04e2c9 build: build deb/rpm independently on config/extensions in the host system
Reverts 5b2411bab704 and replaces it with a more general solution.

- works for both rpm and deb
- sidesteps eventual problems with local extensions that have nothing to do with
  the build process (hg-git, for example, fails with version 4.4 because
  ccf72242b638 removed peerrepository, and hg-git still uses it as of 0.8.9)
2017-10-17 22:46:08 +02:00
Boris Feld
bd26fb4ef0 config: also gather effect-flags on experimental.evolution
Effect-flags config was in flight while the previous evolve config renaming
was written. Now that both landed, gather effect-flags in
experimental.evolution like the others evolve-related configurations.

Differential Revision: https://phab.mercurial-scm.org/D1197
2017-10-19 17:50:20 +02:00
Boris Feld
b2b964dde1 obsfate: rename obsfate into obsolete in default mapfile
Like the previous patch, replace obsfate by obsolete in default mapfile.

Differential Revision: https://phab.mercurial-scm.org/D1190
2017-10-19 12:33:53 +02:00
Boris Feld
540b37e2a9 obsfate: rename obsfate into obsolete in changeset_printer
Yuja's comment on the original obsfate about how we would translate obsfate
and the recent discussions about exposing users to new concepts and names lead
have led me to think that 'obsfate' should be treated as internal jargon. End-
users should not be aware of obsfate, so we replace 'obsfate' by 'obsolete' in
changeset_printer.

It will be easier to understand for end-users, easier to translate and closer
to the original Evolve obsfate output.

I'm aware it's extremely late in the cycle but I think it's an UX improvement
for the end-users.

Differential Revision: https://phab.mercurial-scm.org/D1189
2017-10-19 12:32:42 +02:00
Augie Fackler
495c324fbe tests: add some (?) output lines to catch "helpful" output from Solaris diff
Differential Revision: https://phab.mercurial-scm.org/D1196
2017-10-19 11:17:10 -04:00
Paul Morelle
80d72dfb5f sparse-read: ignore trailing empty revs in each read chunk
An empty entry in the revlog may happen for two reasons:
- when the file is empty, and the revlog stores a snapshot;
- when there is a merge and both parents were identical.

`hg debugindex -m | awk '$3=="0"{print}' | wc -l` gives 1917 of such entries
in my clone of pypy, and 113 on my clone of mercurial.

These empty revision may be located at the end of a sparse chain, and in some
special cases may lead to read relatively large amounts of data for nothing.
2017-10-18 15:28:19 +02:00
Jun Wu
b46e073ee5 fsmonitor: use nonnormalset from dirstatemap
`dirstate._nonnormalset` has been moved to `dirstate._map.nonnormalset` by
822ff2522caf (dirstate: move nonnormal and otherparent sets to dirstatemap)
and is guaranteed to be existed.

Let's update fsmonitor code to use the new `nonnormalset`. Thix fixed a perf
regression that slows down `hg status` by 0.5 seconds in one of our
production repos.

Differential Revision: https://phab.mercurial-scm.org/D1184
2017-10-18 15:42:44 -07:00
Martin von Zweigbergk
745cf248e6 registrar: don't i18n ProgrammingError message
Differential Revision: https://phab.mercurial-scm.org/D1188
2017-10-18 22:10:08 -07:00
Martin von Zweigbergk
0975261d97 registrar: move "constant" possiblecmdtypes to class level
While at it, switch to set literal syntax.

Differential Revision: https://phab.mercurial-scm.org/D1187
2017-10-18 22:07:53 -07:00
Martin von Zweigbergk
d0c2c0b351 tests: de-flake test-run-tests.t's "--jobs=2 --first" test
Once in a while, test-nothing.t finished before test-failure.t or
test-failure-copy.t (I haven't checked which one actually gets run
first). Since there already are two tests that will fail in the same
way, just run those two instead so the diff will be reproducible and
not timing-dependent.

The test case was added in d5f1ee5ea1d3 (run-tests: handle --jobs and
--first gracefully, 2014-10-09), and I have checked that backing that
out results in two failures being printed. Note that the summary may
still include multiple tests even if --first is given, it's just that
the diff is only printed for the first failure.

Differential Revision: https://phab.mercurial-scm.org/D1186
2017-10-18 16:28:18 -07:00
Augie Fackler
28d451ef21 cmdutil: fix status tersing on Python 3
Differential Revision: https://phab.mercurial-scm.org/D1183
2017-10-18 18:30:02 -04:00
Augie Fackler
3ea4e52f7c hghave: fix clang-format check to use bytes regex
Fixes hghave on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1182
2017-10-18 18:29:17 -04:00
Augie Fackler
a0c006361b configitems: make all regular expressions bytes and not native str
Fixes many tests on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1181
2017-10-18 18:29:00 -04:00
Augie Fackler
f528e201d0 convert: register missed subversion config items
Should fix the build failures on the Solaris builders.

Differential Revision: https://phab.mercurial-scm.org/D1180
2017-10-18 18:11:50 -04:00
Pulkit Goyal
b9bca507ff amend: error out if the note is greater than 255bytes
In obsmarker we can't store keys and values of more than 255 bytes in metadata.
If we try to do so, ProgrammingError is raised. The note flag to amend stores
the note in obsmetadata. If a user will try to store a larger note, he will
encounter ProgrammingError which is wrong. We must error out early.

Thanks to Yuya for warning about this.

Differential Revision: https://phab.mercurial-scm.org/D1179
2017-10-19 03:20:47 +05:30
Jun Wu
c0323e0c94 show: move configitems to core
chgserver.py is also checking the config and will get:

  devel-warn: accessing unregistered config item:
  'commands.show.aliasprefix' at:
  mercurial/chgserver.py:109

if the config is not registered.

Differential Revision: https://phab.mercurial-scm.org/D1178
2017-10-18 15:05:03 -07:00
Jun Wu
d0d741d8a7 chgserver: do not treat HG as sensitive environ when CHGHG is set
When `$CHGHG` is set, `$HG` is ignored by the chg client. Removing it from
chg's sensitive environment list would avoid starting up servers
unnecessarily when `$CHGHG` is the same while `$HG` is different.

Differential Revision: https://phab.mercurial-scm.org/D1177
2017-10-18 14:55:39 -07:00
Gregory Szorc
9906bb3d53 fsmonitor: declare missing config options
These were added in 24a87d506bbd. Attempting to run the test harness
with fsmonitor enabled spews a whole bunch of devel warnings due to
these options not be declared.

Differential Revision: https://phab.mercurial-scm.org/D1176
2017-10-18 22:54:50 +02:00
Gregory Szorc
35538a441a fsmonitor: warn when fsmonitor could be used
fsmonitor can significantly speed up operations on large working
directories. But fsmonitor isn't enabled by default, so naive users
may not realize there is a potential to make Mercurial faster.

This commit introduces a warning to working directory updates when
fsmonitor could be used.

The following conditions must be met:

* Working directory is previously empty
* New working directory adds >= N files (currently 50,000)
* Running on Linux or MacOS
* fsmonitor not enabled
* Warning not disabled via config override

Because of the empty working directory restriction, most users will
only see this warning during `hg clone` (assuming very few users
actually do an `hg up null`).

The addition of a warning may be considered a BC change. However, clone
has printed warnings before. Until recently, Mercurial printed a warning
with the server's certificate fingerprint when it wasn't explicitly
trusted for example. The warning goes to stderr. So it shouldn't
interfere with scripts parsing meaningful output.

The OS restriction was on the advice of Facebook engineers, who only
feel confident with watchman's stability on the supported platforms.

.. feature::

   Print warning when fsmonitor isn't being used on a large repository

Differential Revision: https://phab.mercurial-scm.org/D894
2017-10-18 22:57:15 +02:00
Ryan McElroy
08776110c4 merge: additional test cases to show merge-halting behavior
In the previous patches, we allowed the user to specify that
a merge process should be halted when a filemerge fails.

This patch adds tests that show additional places this logic
can be utilized -- via the options to do additional post-filemerge
checks to determine if a file merge was successful.

Differential Revision: https://phab.mercurial-scm.org/D952
2017-10-06 06:48:43 -07:00
Pulkit Goyal
58f03d7898 rebase: add support to output nodechanges
This patch adds support to rebase to show the changes in node once the rebase is
complete. This will be extremely helpful for automation purposes and editors
such as Nuclide.

The output is a dictionary of predecessor hash as key and a list of successors'
hashes. The successors one is a list as there can be many successors for a single
predecessor in case of split and it will good to have a generic output format.

This patch adds tests for the same. A new file is created for the patch as
existing files related to rebase has their own purpose and there will be more
formatter support coming for rebase in next cycle.

Thanks to Jun for suggesting to use fm.data().

Differential Revision: https://phab.mercurial-scm.org/D1173
2017-10-18 04:31:46 +05:30
Saurabh Singh
8e631c99b7 ui: move request exit handlers to global state
Since the ui objects can be created with the 'load' class method, it
is possible to lose the exit handlers information from the old ui instance. For
example, running 'test-bad-extension.t' leads to this situation where chg
creates a new ui instance which does not copy the exit handlers from the
earlier ui instance. For exit handlers, which are special cases anyways, it
probably makes sense to have a global state of the handlers. This would ensure
that the exit handlers registered once are definitely executed at the end of
the request.

Test Plan:
Ran all the tests without '--chg' option. This also fixes the
'test-bad-extension.t' with the '--chg' option.

Differential Revision: https://phab.mercurial-scm.org/D1166
2017-10-17 13:20:25 -07:00
Paul Morelle
942b4f2e1a sparse-read: skip gaps too small to be worth splitting
Splitting at too small gaps might not be worthwhile. With this changeset,
we stop considering splitting on too small gaps. The threshold is configurable.
We arbitrarily pick 256K as a default value because it seems "okay".
Further testing on various repositories and setups will be needed to tune it.

The option name is 'experimental.sparse-read.min-gap-size`, and replaces
`experimental.sparse-read.min-block-size` which is not used any more.
2017-10-18 09:07:48 +02:00
Boris Feld
b5ee1a86a9 sparse-read: move from a recursive-based approach to a heap-based one
The previous recursive approach was trying to optimise each read slice to have
a good density. It had the tendency to over-optimize smaller slices while
leaving larger hole in others.

The new approach focuses on improving the combined density of all the reads,
instead of the individual slices. It slices at the largest gaps first, as they
reduce the total amount of read data the most efficiently.

Another benefit of this approach is that we iterate over the delta chain only
once, reducing the overhead of slicing long delta chains.

On the repository we use for tests, the new approach shows similar or faster
performance than the current default linear full read.

The repository contains about 450,000 revisions with many concurrent
topological branches. Tests have been run on two versions of the repository:
one built with the current delta constraint, and the other with an unlimited
delta span (using 'experimental.maxdeltachainspan=0')

Below are timings for building 1% of all the revision in the manifest log using
'hg perfrevlogrevisions -m'. Times are given in seconds. They include the new
couple of follow-up changeset in this series.

delta-span  standard    unlimited
linear-read     922s         632s
sparse-read     814s         566s
2017-10-18 12:53:00 +02:00
Matt Harbison
4856e00f46 subrepo: implement 'unshare' for Mercurial subrepos
I think there's a slight hole here in that a subrepo could be shared, removed
from .hgsub, and then it's not part of context.substate (so not iterated over).
But the push command has the same hole IIRC, and I think removing a subrepo is
an edge case.

The import hack is a copy/paste of subrepo.subrepo().
2017-10-17 22:55:33 -04:00
Matt Harbison
ae7841b944 share: move the implementation of 'unshare' to the 'hg' module
This will be used to setup unsharing subrepos.  Usually cmdutil is used for
this purpose.  But the implementation needs hg.copystore(), and the hg module
already imports cmdutil.
2017-10-17 21:48:56 -04:00
Denis Laxalde
13f0a4a653 show: use labelcset() template alias for work (and stack) views
By reusing labelcset() template alias from map-cmdline.default we can now
display obsolescence information in `hg show work/stack`.
2017-10-17 20:25:43 +02:00
Kevin Bullock
d9bf33fad2 phases: pass phase names to hooks instead of internal values 2017-10-18 12:19:53 -05:00
Boris Feld
aab8c43439 configitems: document the choice of using 'match' instead of 'search' 2017-10-18 12:36:23 +02:00
Boris Feld
ad198e9760 configitems: do not directly match generic items
Before this changesets, a literal '.*:foo$' config would match a registered
'.*:foo$' generic. This is wrong since generic should be matched through
regular exception only. This changeset fixes this problem.

Thanks for to Yuya Nishihara for spotting the issue.
2017-10-18 12:26:08 +02:00
Boris Feld
3df0c5d74a obsfate: fix obsfate_printer with empty date list
When the list of dates is empty, `min` and `max` would raises a ValueError.
Protect against this case by checking that the date list is not empty.

I didn't add a test because I couldn't find a reproducing test case.
2017-10-18 15:38:51 +02:00
Boris Feld
4b2916f625 config: gather allowdivergence under the evolution namespace
Grouping all evolution related-config under the experimental.evolution
namespace would helps the future migration outside [experimental].

Differential Revision: https://phab.mercurial-scm.org/D1155
2017-10-17 16:54:31 +02:00
Boris Feld
03a11d7666 config: remove stabilization.* aliases
Stabilization config items were never part of a release, remove them now that
we cleaned up the evolution related configuration.

Differential Revision: https://phab.mercurial-scm.org/D1154
2017-10-17 15:57:56 +02:00
Boris Feld
e2184ba620 config: rename stabilization.track-operation
We want to get rid of stabilization.* configuration, back out to the old
configuration 'evolution.track-operation'.

Differential Revision: https://phab.mercurial-scm.org/D1153
2017-10-17 15:56:49 +02:00
Boris Feld
7aaf02f1ae config: rename stabilization.bundle-obsmarker
We want to get rid of stabilization.* configuration, back out to the old
configuration 'evolution.bundle-obsmarker'.

Differential Revision: https://phab.mercurial-scm.org/D1152
2017-10-17 15:54:05 +02:00
Augie Fackler
0d393fc56a tests: invoke run-tests.py in test-hghave using $PYTHON (issue5697)
Some platforms (notably pkgsrc on NetBSD) only provide versioned
Python interpreters (eg `python2.7` exists, but `python` does not),
which exposes this error. We want to be running run-tests.py with the
python given in $PYTHON, since that might be `pypy` or `python3`.
2017-10-04 09:04:52 -04:00
Augie Fackler
6fe29748d5 Added signature for changeset ff1cee5a3854 2017-10-01 05:28:54 -04:00