Commit Graph

27287 Commits

Author SHA1 Message Date
Gregory Szorc
06ebc04a42 obsolete: use absolute_import 2015-12-12 13:30:47 -05:00
Gregory Szorc
164cea475f contrib: ignore empty files in check-py3-compat.py 2015-12-12 13:27:31 -05:00
Gregory Szorc
b6d0b58fa7 doc: make gendoc.py module import policy aware
Without this, running gendoc.py during an install without C modules
available (via `make local`) will result in an import failure because
the default module load policy insists on C modules.

We also remove the sys.path adjustment because it is no longer needed
since our magic importer handles things.
2015-12-12 13:23:29 -05:00
Matt Mackall
3bbe98aeff merge with stable 2015-12-11 17:45:19 -06:00
Pierre-Yves David
516c4fcbd3 check-commit: add a test for the patch checking script in contrib
This introduces a test for the change introduced in d1bba8f10f62.
2015-12-11 12:21:26 +00:00
Bryan O'Sullivan
319ff5c06a match: use re2 in readpatternfile if possible
This has a small, but measurable, effect on performance if a pattern
file is very large.  In an artificial test with 200,000 lines of
pattern data, using re2 reduced read time by 200 milliseconds.
2015-12-10 21:33:55 -08:00
Bryan O'Sullivan
484df3d610 test-hgignore.t: add tests for comments
Although support for comments in hgignore files has existed for a
while, it was previously untested.
2015-12-10 21:32:19 -08:00
timeless
65f4d64bf2 help: fix help -c/help -e/help -k
Before, hg help -c was the same as hg help, now it only shows commands.
Before, hg help -e was the same as hg help, now it only shows extensions.
Before, hg help -k crashed, now it shows all topics.
2015-12-09 05:56:54 +00:00
timeless
2d7d422638 help: call filtercmd from topicmatch
update test coverage to explicitly define when help -c should
list debug/deprecated items.
2015-12-09 19:09:35 +00:00
timeless
068f6ee2a2 help: refactor filtercmd 2015-12-09 19:09:06 +00:00
timeless
4714e37c78 transplant: use Oxford comma 2015-11-30 19:28:26 +00:00
Laurent Charignon
2ddae732ee crecord: add dictionary to default return value of filterpatch
When committing interactively without changes, the user would get a ValueError
exception. This patch adds a dictionary to the return value of filterpatch
when there are no files to change.
2015-12-09 17:01:27 -08:00
Pierre-Yves David
c33f182029 discovery: properly filter changeset in 'peer.known' (issue4982)
The 'peer.known' call (handled at the repository level) was applying its own
manual filtering (looking at phases) instead of relying on the repoview
mechanism. This led to the discovery finding more "common" node that
'getbundle' was willing to recognised. From there, bad things happen, issue4982
is a symptom of it. While situations like described in issue4982 can still
happen because of race conditions, fixing 'peer.known' is important for
consistency in all cases.

We update the code to use 'repoview' filtering. This lead to small changes in
the tests for exchanging obsolescence marker because the discovery yields
different results.

The test affected in 'test-obsolete-changeset-exchange.t' is a test for
issue4982 getting back to its expected state.
2015-12-02 16:12:15 -08:00
Pierre-Yves David
614f88221e test: add an extra base changeset in test-obsolete.t
A fix to issue4982 (not fixed in this patch) will reinforce the filtering
during discovery. This will makes two of our test repositories appear
unrelated (because all common content is properly hidden). To avoid this, we
introduce an extra base changeset that will not get obsoleted. This affects
various test output so we put this addition in its own changeset.
2015-12-09 14:22:57 -08:00
timeless
0d1432229b parents: provide equivalent revsets in help 2015-12-08 20:21:08 +00:00
Martin von Zweigbergk
8e7f0fdda8 merge: refuse update/merge if there are unresolved conflicts (BC)
We currently allow updating and merging (with --force) when there are
unresolved merge conflicts, as long as there is only one parent of the
working copy. Even worse, when updating to another revision
(linearly), if one of the unresolved files (including any conflict
markers in the working copy) can now be merged cleanly with the target
revision, the file becomes marked as resolved.

While we could potentially allow updates that affect only files that
are not in the set of unresolved files, that's considerably more work,
and we don't have a use case for it anyway. Instead, let's keep it
simple and refuse any merge or update (without -C) when there are
unresolved conflicts.

Note that test-merge-local.t explicitly checks for conflict markers
that get carried over on update. It's unclear if that was intentional
or not, but it seems bad enough that we should forbid it. The simplest
way of fixing the test case is to leave the conflict markers in place
and just mark the files resolved, so let's just do that for now.
2015-12-07 20:43:24 -08:00
timeless
8d2aaddeec tests: drop require slow in test-contrib-perf
* skip presleep
* use a stub mode which does not output and generally loops only once
* only use one node for perfparents
2015-12-08 07:05:37 +00:00
timeless
15faf26352 convert/svn: quiet check-config 2015-12-08 08:37:12 +00:00
timeless
279ca50a3d check-config: handle multiline config 2015-12-08 08:21:46 +00:00
timeless
73dbe2bc47 check-config: escape period in regexp for inline comments 2015-12-08 08:36:00 +00:00
timeless
80e1115762 check-config: allow numbers in configs
p4...
2015-12-08 09:09:01 +00:00
timeless
98fb00321c check-config: recognize convert style documentation 2015-12-08 09:22:53 +00:00
timeless
568fd6bf86 tests: use a single repo for test-contrib-perf 2015-12-08 04:56:26 +00:00
timeless
e91c29104b perf: perfrevlog optimize for perf.stub 2015-12-04 19:05:56 +00:00
timeless
0da8511b85 perf: add getlen
getlen will return 1 if perf.stub
2015-12-04 19:05:32 +00:00
timeless
04f03f3aeb perf: add optional rev for perflog and perftemplating 2015-12-04 18:08:50 +00:00
timeless
05d63c41ee perf: perfparents honor config perf.parentscount 2015-12-04 18:18:07 +00:00
timeless
c9727daf48 perf: offer perf.stub to only run one loop 2015-12-04 17:41:30 +00:00
timeless
aa0ea59703 perf: improve grammar of gettimer comment 2015-12-04 17:41:02 +00:00
Gregory Szorc
7a14eca3ba tests: use absolute_import in tinyproxy
Thus begins a series of adding absolute_import to a bunch of files for
Python 3 compatibility.
2015-12-06 22:20:08 -08:00
Gregory Szorc
32a26751a0 tests: use absolulte_import in test-wireproto.py 2015-12-06 22:02:39 -08:00
Gregory Szorc
6aedf6c7e9 tests: use absolute_import in test-walkrepo 2015-12-06 22:05:19 -08:00
Gregory Szorc
6700f82707 tests: use absolute_import in hgweberror.py 2015-12-06 22:27:53 -08:00
Gregory Szorc
dd5b65b197 tests: use absolute_import in hghave.py 2015-12-06 22:27:18 -08:00
Gregory Szorc
8cca557cf0 tests: use absolute_import for heredoctest.py 2015-12-06 22:26:12 -08:00
Gregory Szorc
df8d1f17a7 tests: use absolute_import in /get-with-headers.py
While I was here, I removed condition code for failure to import json.
This code was necessary to support Python < 2.6, which didn't include
the json module.
2015-12-06 22:25:41 -08:00
Gregory Szorc
a89bad72f6 tests: use absolute_import in generate-working-copy-states.py 2015-12-06 22:23:37 -08:00
Anton Shestakov
2e206a44b7 hgweb: move entry-preparing code from webcommands to webutils.commonentry()
The new function is used to fill basic information about a ctx, such as
revision number and hash, author, commit message, etc. Before, every webcommand
used to get this basic information on its own using some boilerplate code, and
some things in some places just weren't available.
2015-11-13 14:35:36 +08:00
timeless
7451a5cbc6 grammar: favor zero, one, two over ... or no 2015-11-30 19:30:16 +00:00
timeless
4676c472c0 commands: use Oxford comma (help clone) 2015-11-30 19:29:46 +00:00
FUJIWARA Katsunori
18881f6953 commit: make commit acquire store lock before processing for consistency
If acquisition of wlock waits for another "hg commit" process to
release it, dirstate will refer newly committed revision after
acquisition of wlock.

At that time, '00changelog.i' on the filesystem contains this new
revision, but in-memory 'repo.changelog' doesn't, if it is cached
without store lock (slock) before updating by another "hg commit".

This makes validating parents at re-loading 'repo.dirstate' from
'.hg/dirstate' replace such new revision with 'nullid'. Then,
'localrepository.commit()' creates "orphan" revision (see issue4368
for detail).

ec817376a322 makes 'commands.commit()' acquire both wlock and slock
before processing to avoid this issue at "hg commit".

But similar issue can occur even after ec817376a322, if 3rd party
extension does:

  - refer 'repo.changelog' outside wlock scope, and
  - invoke 'repo.commit()' directly (instead of 'commands.commit()')

This patch makes 'commit()' acquire slock before processing, to refer
recent changelog at validating parents of 'repo.dirstate'.
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
6cb3588722 censor: make censor acquire locks before processing
Before this patch, "hg censor" executes below:

  - without acquisition of wlock, examine whether the working
    directory refers the revision of the file to be censored or not

  - without acquisition of store lock (slock), replace existing
    filelog of file to be censored with censored one,

    Replacement consists of steps below, and it is assumed that the
    destination filelog at (1) isn't changed before renaming at (3).

    1. read existing filelog in
    2. write filelog entries (both censored and not) into temporary file
    3. rename from temporary file to existing filelog to be censored

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch makes "hg censor" acquire wlock and slock before
processing.
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
f9e9bdfb4f transplant: widen wlock scope of transplant for consitency while processing
Before this patch, "hg transplant" executes below before acquisition
of wlock.

  - cmdutil.checkunfinished()
  - repo.status() for dirty check
  - repo.dirstate.parents()

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch makes "hg transplant" acquire wlock before processing
instead of acquiring wlock in each of 'transplanter.apply()' and
'transplanter.recover()'.
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
3c4a554b71 shelve: remove redundant acquisition of wlock for sub commands of unshelve
Previous patch ensures that wlock is acquired before processing for
"hg unshelve". It makes acquisition of wlock in each functions below
redundant.

  - unshelveabort() for "unshelve --abort"
  - unshelvecontinue() for "unshelve --continue"
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
d4f8b1a01a shelve: widen wlock scope of unshelve for consistency while processing
Before this patch, "hg unshelve" of shelve extension executes below
before acquisition of wlock:

  - cmdutil.checkunfinished()
  - examine existence of (specified) shelve file

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch widens wlock scope of "hg unshelve" of shelve extension for
consistency while processing.
2015-12-09 08:28:53 +09:00
Gregory Szorc
da7e434856 perf: add perflrucachedict command
It measures time to construct, perform gets, sets, or mixed mode
operations on a cache of configurable size with variable numbers of
operations.
2015-12-06 17:07:50 -08:00
Gregory Szorc
eeefc7c496 tests/filterpyflakes: use absolute_import 2015-12-06 22:22:09 -08:00
Gregory Szorc
8b09023a2c tests/fakepatchtime.py: use absolute_import 2015-12-06 22:14:39 -08:00
Gregory Szorc
2e705bc6fe tests/fakedirstatewritetime.py: use absolute_import 2015-12-06 22:13:36 -08:00
Gregory Szorc
f19396fcbe tests/dumbhttp: use absolute_import 2015-12-06 22:12:07 -08:00