Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 Mar 2016 18:51:07 -0800] rev 28523
help: document requirements
We didn't have unified documentation of the various repository
requirements. This patch changes that.
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 13 Mar 2016 01:59:18 +0530] rev 28522
showstack: use absolute_import
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Mar 2016 14:12:13 +0530] rev 28521
contrib: use absolute_import in win32/hgwebdir_wsgi.py
Yuya Nishihara <yuya@tcha.org> [Sun, 27 Dec 2015 13:38:46 +0900] rev 28520
dispatch: catch KeyboardInterrupt more broadly
Because _runcatch() can run long operations in its exception handler,
it wasn't enough to catch KeyboardInterrupt at the same level. For
example, "hg unknown" will load all extension modules, so we could
easily make it crashed by Ctrl-C.
Mateusz Kwapich <mitrandir@fb.com> [Sun, 13 Mar 2016 16:46:49 -0700] rev 28519
histedit: have dropmissing abort on empty plan
We noticed that many users have the intuition of laving the editor empty when
they want to abort the operation. The fact that dropmissing allows user to
delete all edited commits is not intuitive even for users that asked for it.
Let's prevent people from this footgun.
Mads Kiilerich <madski@unity3d.com> [Sun, 13 Mar 2016 02:29:11 +0100] rev 28518
streamclone: fix error when store files grow while stream cloning
Effectively a backout of
9fea6b38a8da, but updated to using 'with'.
Mads Kiilerich <madski@unity3d.com> [Sun, 13 Mar 2016 02:28:46 +0100] rev 28517
tests: add test of stream clone of repo that is changing
This reveals an error introduced by
9fea6b38a8da.
Jun Wu <quark@fb.com> [Mon, 14 Mar 2016 12:52:35 +0000] rev 28516
chgserver: handle ParseError during validate
Currently the validate command in chgserver expects config can be loaded
without issues but the config can be broken and chg will print a stacktrace
instead of the parsing error, if a chg server is already running.
This patch adds a handler for ParseError in validate and a new instruction
"exit" to make the client exit without abortmsg. A test is also added to make
sure it will behave as expected.
Jun Wu <quark@fb.com> [Mon, 14 Mar 2016 12:32:09 +0000] rev 28515
dispatch: extract common logic for handling ParseError
The way ParseError is handled at two different places in dispatch.py is the
same. Move common logic into _formatparse.
Jun Wu <quark@fb.com> [Mon, 14 Mar 2016 11:23:04 +0000] rev 28514
chgserver: resolve relative path before sending via system channel
The chgserver may have a different cwd from the client because of the side
effect of "--cwd" and other possible os.chdir done by extensions. Therefore
relative paths can be misunderstood by the client.
This patch solves it by expanding relative cwd path to absolute one before
sending them via the 'S' channel. It can help chg to pass a testcase in
test-alias.t later.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 Mar 2016 13:19:19 -0800] rev 28513
mercurial: use pure Python module policy on Python 3
The C extensions don't yet work with Python 3. Let's minimize the
work required to get Mercurial running on Python 3 by always using
the pure Python module policy on Python 3.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Mar 2016 22:17:30 +0900] rev 28512
chg: provide early exception to user
See the previous patch for details. Since the socket will be closed by the
server, handleresponse() will never return:
Traceback (most recent call last):
...
chg: abort: failed to read channel
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Mar 2016 22:03:30 +0900] rev 28511
cmdserver: write early exception to 'e' channel in 'unix' mode
In 'unix' mode, the server is typically detached from the console. Therefore
a client couldn't see the exception that occurred while instantiating the
server object.
This patch tries to catch the early error and send it to 'e' channel even if
the server isn't instantiated yet. This means the error may be sent before the
initial hello message. So it's up to the client implementation whether to
handle the early error message or error out as protocol violation.
The error handling code is also copied to chgserver.py. I'll factor out them
later if we manage to get chg passes the test suite.
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 13 Mar 2016 01:32:42 +0530] rev 28510
contrib: make memory.py use absolute_import
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 13 Mar 2016 01:08:39 +0530] rev 28509
check-code: use absolute_import and print_function
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 11 Mar 2016 21:27:26 -0800] rev 28508
encoding: use range() instead of xrange()
Python 3 doesn't have xrange(). Instead, range() on Python 3
is a generator, like xrange() is on Python 2.
The benefits of xrange() over range() are when there are very
large ranges that are too expensive to pre-allocate. The code
here is only creating <128 values, so the benefits of xrange()
should be negligible.
With this patch, encoding.py imports safely on Python 3.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 11 Mar 2016 21:23:34 -0800] rev 28507
encoding: make HFS+ ignore code Python 3 compatible
unichr() doesn't exist in Python 3. chr() is the equivalent there.
Unfortunately, we can't use chr() outright because Python 2 only
accepts values smaller than 256.
Also, Python 3 returns an int when accessing a character of a
bytes type (s[x]). So, we have to ord() the values in the assert
statement.
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 11 Mar 2016 10:28:58 +0000] rev 28506
extensions: factor import error reporting out
To clarify third party extensions lookup, we are about to add a third place
where extensions are searched for. So we factor the error reporting logic out to
be able to easily reuse it in the next patch.
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 11 Mar 2016 10:24:54 +0000] rev 28505
extensions: extract the 'importh' closure as normal function
There is no reason for this to be a closure so we extract it for clarity.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 11 Mar 2016 15:40:58 -0800] rev 28504
zeroconf: remove leftover camelcase identifier
eb9d0e828c30 (zeroconf: remove camelcase in identifiers, 2016-03-01)
forgot one occurrence of "numAuthorities", which makes test-paths.t
fail for me. I don't even know what zeroconf is, but this patch seems
obviously correct and it fixes the failing test case.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 12 Mar 2016 04:35:42 +0900] rev 28503
hg: acquire wlock while updating the working directory via updatetotally
updatetotally() might be invoked outside wlock scope (e.g. invocation
via postincoming() at "hg unbundle" or "hg pull").
In such case, acquisition of wlock is needed for consistent view,
because parallel "hg update" and/or "hg bookmarks" might change
working directory status while executing updatetotally().
Strictly speaking, truly consistent updating should acquire also store
lock, because active bookmark might be moved to another one outside
wlock scope (e.g. pulling from other repository causes updating
current active one).
Acquisition of wlock in this patch ensures consistency in as same
level as past "hg update".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 12 Mar 2016 04:35:42 +0900] rev 28502
commands: add postincoming docstring for explanation of arguments
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 12 Mar 2016 04:35:42 +0900] rev 28501
commands: centralize code to update with extra care for non-file components
This patch centralizes similar code paths to update the working
directory with extra care for non-file components (e.g. bookmark) into
newly added function updatetotally().
'if True' at the beginning of updatetotally() is redundant at this
patch, but useful to reduce amount of changes in subsequent patch.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 12 Mar 2016 04:35:42 +0900] rev 28500
update: omit redundant activating message for already active bookmark
This patch also adds "hg bookmarks" invocation into tests, where
redundant message is omitted but bookmark activity isn't clear from
context.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 11 Mar 2016 11:44:03 -0800] rev 28499
tests: make test-verify-repo-operations.py not run by default
test-verify-repo-operations.py currently starts way too late and
extends the running time with -j50 on my machine from around 3:48 min
to 6:30 min. We could of course make it run earlier, but the test case
seems unlikely to find bugs not covered by other tests, so let's mark
it "slow" instead. I think this type of test is better suited to
running separately in a long-running job.
timeless <timeless@mozdev.org> [Fri, 29 Jan 2016 14:37:16 +0000] rev 28498
ui: log devel warnings
timeless <timeless@mozdev.org> [Fri, 11 Mar 2016 17:22:04 +0000] rev 28497
util: refactor getstackframes
timeless <timeless@mozdev.org> [Fri, 11 Mar 2016 16:50:14 +0000] rev 28496
util: reword debugstacktrace comment
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Mar 2016 15:40:20 -0800] rev 28495
changelog: avoid slicing raw data until needed
Before, we were slicing the original raw text and storing individual
variables with values corresponding to each field. This is avoidable
overhead.
With this patch, we store the offsets of the fields at construction
time and perform the slice when a property is accessed.
This appears to show a very marginal performance win on its own and
the gains are so small as to not be worth reporting. However, this
patch marks the end of our parsing refactor, so it is worth reporting
the gains from the entire series:
author(mpm)
0.896565
0.795987 89%
desc(bug)
0.887169
0.803438 90%
date(2015)
0.878797
0.773961 88%
extra(rebase_source)
0.865446
0.761603 88%
author(mpm) or author(greg)
1.801832
1.576025 87%
author(mpm) or desc(bug)
1.812438
1.593335 88%
date(2015) or branch(default)
0.968276
0.875270 90%
author(mpm) or desc(bug) or date(2015) or extra(rebase_source)
3.656193
3.183104 87%
Pretty consistent speed-up across the board for any revset accessing
changelog revision data. Not bad!
It's also worth noting that PyPy appears to experience a similar to
marginally greater speed-up as well!
According to statprof, revsets accessing changelog revision data
are now clearly dominated by zlib decompression (16-17% of execution
time). Surprisingly, it appears the most expensive part of revision
parsing are the various text.index() calls to search for newlines!
These appear to cumulatively add up to 5+% of execution time. I
reckon implementing the parsing in C would make things marginally
faster.
If accessing larger strings (such as the commit message),
encoding.tolocal() is the most expensive procedure outside of
decompression.
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Mar 2016 13:13:54 -0800] rev 28494
changelog: parse description last
Before, we first searched for the double newline as the first step in
the parse then moved to the front of the string and worked our way
to the back again. This made sense when we were splitting the raw
text on the double newline. But in our new newline scanning based
approach, this feels awkward.
This patch updates the parsing logic to parse the text linearly and
deal with the description field last.
Because we're avoiding an extra string scan, revsets appear to
demonstrate a very slight performance win. But the percentage
change is marginal, so the numbers aren't worth reporting.