Pulkit Goyal <7895pulkit@gmail.com> [Mon, 05 Mar 2018 01:08:40 +0530] rev 36722
py3: use bytes() instead of str()
Differential Revision: https://phab.mercurial-scm.org/D2665
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 05 Mar 2018 01:05:54 +0530] rev 36721
py3: use b"%d" instead of str() to convert integers to bytes
Differential Revision: https://phab.mercurial-scm.org/D2664
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 05 Mar 2018 01:03:23 +0530] rev 36720
py3: use util.forcebytestr to convert testedwith value to bytes
Bad extensions can put anything in testedwith so we should use util.forcebytestr
here.
Differential Revision: https://phab.mercurial-scm.org/D2663
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 22:33:59 +0530] rev 36719
py3: use pycompat.bytestr instead of str
Differential Revision: https://phab.mercurial-scm.org/D2648
Martin von Zweigbergk <martinvonz@google.com> [Sun, 04 Mar 2018 07:40:21 -0800] rev 36718
setdiscovery: avoid a Yoda condition
Differential Revision: https://phab.mercurial-scm.org/D2646
Martin von Zweigbergk <martinvonz@google.com> [Sun, 04 Mar 2018 07:40:11 -0800] rev 36717
setdiscovery: remove unnecessary sample size limiting
Both _takequicksample() and _takefullsample() already limit their
result to the request size, so there's no need to let the caller do
that again.
Differential Revision: https://phab.mercurial-scm.org/D2645
Martin von Zweigbergk <martinvonz@google.com> [Sun, 04 Mar 2018 07:39:46 -0800] rev 36716
setdiscovery: remove initialsamplesize from a condition
It seems more direct to compare the actual sample size. That way we
can change the sample taken earlier in the code without breaking the
condition.
Differential Revision: https://phab.mercurial-scm.org/D2644
Martin von Zweigbergk <martinvonz@google.com> [Sun, 04 Mar 2018 07:37:08 -0800] rev 36715
setdiscovery: back out changeset
5cfdf6137af8 (
issue5809)
As explained in the bug report, this commit caused a performance
regression. The problem occurs when the local repo has very many
heads. Before
5cfdf6137af8, we used to get the remote's list of heads
and if these heads mostly overlapped with the local repo's heads, we
would mark these common heads as common, which would greatly reduce
the size of the set of undecided nodes.
Note that a similar problem existed before
5cfdf6137af8: If the local
repo had very many heads and the server just had a few (or many heads
from a disjoint set), we would do the same kind of slow discovery as
we would with
5cfdf6137af8 in the case where local and remote repos
share a large set of common nodes.
For now, we just back out
5cfdf6137af8. We should improve the
discovery in the "local has many heads, remote has few heads" case,
but let's do that after backing this out.
Differential Revision: https://phab.mercurial-scm.org/D2643
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 13:04:12 -0500] rev 36714
hgweb: fix up trailing slash detection on Python 3
Fixes a couple of hgweb tests.
Differential Revision: https://phab.mercurial-scm.org/D2661
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 13:03:22 -0500] rev 36713
hgweb: convert req.form to bytes for all keys and values
This is just going to be a lot cleaner for our internals.
Differential Revision: https://phab.mercurial-scm.org/D2660
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:33:15 -0500] rev 36712
templater: show repr of string we're rejecting
I feel like this should make it a little easier to hunt down problems.
Differential Revision: https://phab.mercurial-scm.org/D2659
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:21:01 -0500] rev 36711
webutil: some %d instead of %s love on ints
Differential Revision: https://phab.mercurial-scm.org/D2658
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:17:02 -0500] rev 36710
py3: whitelist three more cases
Differential Revision: https://phab.mercurial-scm.org/D2657
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:08:53 -0500] rev 36709
archival: our filenames are bytes, not strs
Differential Revision: https://phab.mercurial-scm.org/D2656
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:08:37 -0500] rev 36708
archival: tar file modes need to be sysstrs
Differential Revision: https://phab.mercurial-scm.org/D2655
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 12:08:19 -0500] rev 36707
archival: fsdecode paths before passing to tar or zip objects
Both of these traffic in unicodes for filenames on Python 3, and
inspection of the tarfile module shows that it uses the filesystem
encoding, so fsdecode is the right choice.
Differential Revision: https://phab.mercurial-scm.org/D2654
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 05:15:24 +0530] rev 36706
py3: add b'' prefixes in tests/test-minirst.py
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D2653
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 22:40:33 +0530] rev 36705
py3: make sure __repr__ returns a str
# skip-blame because just r'' prefix
Differential Revision: https://phab.mercurial-scm.org/D2652
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 22:40:08 +0530] rev 36704
py3: make sure regular expressions are bytes
# skip-blame because just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D2651
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 05:53:59 +0530] rev 36703
py3: use bytes instead of str to make sure we use bytes internally
Differential Revision: https://phab.mercurial-scm.org/D2650
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 04 Mar 2018 22:37:41 +0530] rev 36702
py3: use util.forcebytestr instead of str to convert error messages
Differential Revision: https://phab.mercurial-scm.org/D2649
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Mar 2018 23:49:39 -0500] rev 36701
lock: block signal interrupt while making a lock file
On Windows where symlink isn't supported, util.makelock() could leave an empty
file if interrupted immediately after os.open(). This empty lock never dies
as it has no process id recorded.
ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)
# an interrupt may occur here
os.write(ld, info)
os.close(ld)
This was a long-standing bug of TortoiseHg which runs a command-server and
kills it by CTRL_C_EVENT, reported by random Windows users.
https://bitbucket.org/tortoisehg/thg/issues/4873/#comment-
43591129
At first, I tried to fix makelock() to clean up a stale lock file, which
turned out to be hard because any instructions may be interrupted by a
signal.
ld = None
try:
# CALL_FUNCTION # os.open(...)
# an interrupt may occur here
# STORE_FAST # ld = ...
ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)
os.write(ld, info)
...
return True
except:
if ld:
...
os.unlink(pathname)
return False
So I decided to block signals by temporarily replacing the signal handlers
so makelcok() and held = 1 will never be interrupted.
Many thanks to Fernando Najera for investigating the issue.
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 09:40:12 -0500] rev 36700
fuzz: add some more docs about building/running fuzzers
Differential Revision: https://phab.mercurial-scm.org/D2635
Augie Fackler <augie@google.com> [Sun, 04 Mar 2018 11:49:33 -0500] rev 36699
util: also silence py3 warnings from codec module
Fixes warnings like this:
+ mercurial/util.py:2446: DeprecationWarning: invalid escape sequence '\d'
+ return codecs.escape_decode(s)[0]
Differential Revision: https://phab.mercurial-scm.org/D2642