Drew Gottlieb <drgott@google.com> [Fri, 08 May 2015 12:30:51 -0700] rev 25189
match: rename _fmap to _fileroots for clarity
fmap isn't a very descriptive name for the set of the match's files.
Drew Gottlieb <drgott@google.com> [Wed, 06 May 2015 15:59:35 -0700] rev 25188
match: remove unnecessary optimization where visitdir() returns 'all'
Match's visitdir() was prematurely optimized to return 'all' in some cases, so
that the caller would not have to call it for directories within the current
directory. This change makes the visitdir system less flexible for future
changes, such as making visitdir consider the match's include and exclude
patterns.
As a demonstration of this optimization not actually improving performance,
I ran 'hg files -r . media' on the Mozilla repository, stored as treemanifest
revlogs.
With best of ten tries, the command took 1.07s both with and without the
optimization, even though the optimization reduced the calls from visitdir()
from 987 to 51.
Augie Fackler <augie@google.com> [Thu, 16 Apr 2015 17:12:33 -0400] rev 25187
dispatch: add support for python-flamegraph[0] profiling
This gives us nicer svg flame graphs for output, which can make
understanding some types of performance problems significantly easier.
0: https://github.com/evanhempel/python-flamegraph/
Augie Fackler <augie@google.com> [Tue, 28 Apr 2015 16:44:37 -0400] rev 25186
extensions: document that `testedwith = 'internal'` is special
Extension authors (notably at companies using hg) have been
cargo-culting the `testedwith = 'internal'` bit from hg's own
extensions, which then defeats our "file bugs over here" logic in
dispatch. Let's be more aggressive about trying to give extension
authors a hint about what testedwith should say.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 10 Apr 2015 23:12:33 -0700] rev 25185
treemanifest: cache directory logs and manifests
Since manifests instances are cached on the manifest log instance, we
can cache directory manifests by caching the directory manifest
logs. The directory manifest log cache is a plain dict, so it never
expires; we assume that we can keep all the directories in memory.
The cache is kept on the root manifestlog, so access to directory
manifest logs now has to go through the root manifest log.
The caching will soon not be only an optimization. When we start
lazily loading directory manifests, we need to make sure we don't
create multiple instances of the log objects. The caching takes care
of that problem.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 15:40:23 -0500] rev 25184
hook: drop dedicated catch for 'KeyboardInterrupt'
This is no longer under 'Exception' in Python 2.6.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 15:38:24 -0500] rev 25183
recover: catch any exception, not just Exception
We want recover to be rock solid.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 15:33:21 -0500] rev 25182
exchange: catch down to BaseException when handling bundle2
We can now catch more things.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 13:23:14 -0500] rev 25181
bundle2: use BaseException in bundle2
We can ensure we fail over properly in more cases.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 13:20:19 -0500] rev 25180
check-code: drop ban of BaseException
Lets go back to the basic. It is available in Python 2.6.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 13:25:07 -0500] rev 25179
wireproto: turn an 'except' into a 'finally' as suggest by the comment
Look! More hidden footprints!
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:56:59 -0500] rev 25178
check-code: drop the yield inside try/finally ban
This is now possible with Python 2.6.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 18 May 2015 15:34:42 -0400] rev 25177
run-tests: resurrect the wifexited polyfill (backout
6ab5a1c9ea3c)
Python 2.7.3 on Windows doesn't have os.WIFEXITED, and the test output looked
like this before I interrupted it.
$ ./run-tests.py --local -j2 -t700
EEEEEEEEEEEEEEEEEEEEEE
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 18 May 2015 02:53:08 +0900] rev 25176
tests: check import cycles in hgext/**.py, too
It is important to realize existing cycles in hgext/**.py.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 18 May 2015 02:52:58 +0900] rev 25175
import-checker: don't treat modules as relative one if not found
The previous patch ensures all module names are recorded in `imports`
as absolute names, so we no longer need to treat modules as ones
imported relatively from the target source if they appear to not be
from the stdlib.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 18 May 2015 02:52:55 +0900] rev 25174
import-checker: make imported_modules yield absolute dotted_name_of_path
This patch makes `imported_modules()` always yield absolute
`dotted_name_of_path()`-ed name by strict detection with
`fromlocal()`.
This change improves circular detection in some points:
- locally defined modules, of which name collides against one of
standard library, can be examined correctly
For example, circular import related to `commands` is overlooked
before this patch.
- names not useful for circular detection are ignored
Names below are also yielded before this patch:
- module names of standard library (= not locally defined one)
- non-module names (e.g. `node.nullid` of `from node import nullid`)
These redundant names decrease performance of circular detection.
For example, with files at
1ef96a3b8b89, average loops per file in
`checkmod()` is reduced from 165 to 109.
- `__init__` can be handled correctly in `checkmod()`
For example, current implementation has problems below:
- `from xxx import yyy` doesn't recognize `xxx.__init__` as imported
- `xxx.__init__` imported via `import xxx` is treated as `xxx`,
and circular detection is aborted, because `key` of such
module name is not `xxx` but `xxx.__init__`
- it is easy to enhance for `from . import xxx` style or so (in the
future)
Module name detection in `imported_modules()` can use information
in `ast.ImportFrom` fully.
It is assumed that all locally defined modules are correctly specified
to `import-checker.py` at once.
Strictly speaking, when `from foo.bar.baz import module1` imports
`foo.bar.baz.module1` module, current `imported_modules()` yields only
`foo.bar.baz.__init__`, even though also `foo.__init__` and
`foo.bar.__init__` should be yielded to detect circular import
exactly.
But this limitation is reasonable one for improvement in this patch,
because current `__init__` files in Mercurial seems to be implemented
carefully.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 18 May 2015 02:50:22 +0900] rev 25173
import-checker: add utility to examine what module is imported easily
`fromlocalfunc()` uses:
- `modulename` (of the target source) to compose absolute module
name imported relatively from it
It is assumed that `modulename` is an `dotted_name_of_path()`-ed
source file, which may have `.__init__` at the end of it.
This assumption makes composing `prefix` of relative name easy.
- `localmods` to examine whether there is a locally defined (=
Mercurial specific) module matching against the specified name
It is assumed that module names not existing in `localmods` are
ones of Python standard library.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:31:41 -0500] rev 25172
subrepo: further replacement of try/except with 'next'
Burn StopIteration, Burn!
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:27:15 -0500] rev 25171
parsers: use 'next' instead of try/except
This get rid of another StopIteration abomination. The change in self.current
value is supposed to not matter as nobody should be calling '_advance' after
that (as per Matt wisdom).
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:22:44 -0500] rev 25170
dagparser: use 'next' instead of try/except for default value
"Ich liebe es wenn ein Plan funktioniert."
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:18:00 -0500] rev 25169
getlogrevs: rewrite a loop to get read of try/except
Get rid of the 'except StopIteration' abomination.
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 18 May 2015 12:17:08 -0500] rev 25168
_makelogrevset: replace try/except with 'next' usage
More readable without the 'except StopIteration' abomination.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:46:54 -0700] rev 25167
ignore: move readpatternfile to match.py
In preparation for adding 'include:' rule support to match.py, let's move the
pattern file reader function to match.py
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:45:46 -0700] rev 25166
ignore: rename readignorefile to readpatternfile
A future commit will move the readignorefile logic into match.py so it can be
used from general match rules. Let's rename the function to represent this new
behavior.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:45:06 -0700] rev 25165
ignore: combine readignorefile and _ignorefile
_ignorefile did nothing except open the file. Let's combine it with
readignorefile for simplicity. This will make it easier to rename and move to
match.py in upcoming patches.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:37:59 -0700] rev 25164
ignore: move bad file handling out of readignorefile
In preparation for moving readignorefile to match.py to make it more generally
usable, let's move the bad ignore file handling up to the ignore specific logic.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:24:43 -0700] rev 25163
ignore: remove .hgignore from ignore list if nonexistent
Previously we would always pass the root .hgignore path to the ignore parser.
The parser then had to be aware that the first path was special, and not warn if
it didn't exist.
In preparation for making the ignore file parser more generically usable, let's
make the parse logic not aware of this special case, and instead just not pass
the root .hgignore in if it doesn't exist.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:47:18 -0400] rev 25162
run-tests: replace open-coded .decode()s on paths with a helper (
issue4667)
This also cleans up the mkdtemp code mentioned in the previous patch.
At this point, the remaining callsites of .{en,de)code() are in the
following categories:
Handling escaped lines in .t files
-----------------------------------
It seems eminently reasonable to me for us to declare that .t files
are valid utf-8, and that any escape sequences we see in .t files
should be valid unicode_escape sequences.
Making error text safe for cdata blocks for xml error reports
-------------------------------------------------------------
This is a point where we're already basically screwed, and we're
simply trying to do something "good enough" that the xml output will
be vaguely useful to the user. Punting here seems fine, and we should
probably stick to the same encoding here that we used in the previous
section.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:40:12 -0400] rev 25161
run-tests: move unicode-to-bytes operations on paths to a helper (
issue4667)
This doesn't fix the probably-wrong utf-8 encoding choice, it just
starts the process of encapsulating all the path handling in run-tests
in a single place.
One known-path use of .encode() remains: it's related to use of
mkdtemp, and it will be fixed in a followup patch once we have a
companion _strpath() helper function to go from bytes to a str, as we
need to file a bug about mkdtemp upstream.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:26:04 -0400] rev 25160
run-tests: insist that if people use Python 3, they use 3.5.x
We depend on both stdlib functionality (difflib.diff_bytes) and
language behavior (bytes formatting) introduced in 3.5, so let's try
and prevent some useless bug reports before they happen.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:18:56 -0400] rev 25159
run-tests: move all open-coded sys.version_info checks to PYTHON3 (
issue4668)
This consolidates all version checking in a single place and helps the
code read more obviously.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:17:13 -0400] rev 25158
run-tests: prefer PYTHON3 constant to many version_info checks (
issue4668)
We only support Python 2.6, 2.7, and 3.5 here, so we can simplify the
code and improve the warning.