Gregory Szorc <gregory.szorc@gmail.com> [Sat, 26 Jan 2019 10:53:10 -0800] rev 41406
statichttprepo: use URLError.reason directly
0b3f4be5c5bf changed str(inst) to inst.reason[0] all the way back
in 2006. URLError.reason is a str and we should have taken that
attribute in its entirety. I think the code was supposed to be
inst.args[1] for compatibility with ancient Python versions.
Python 2.7 always sets .reason, so it should be safe to use
directly.
Differential Revision: https://phab.mercurial-scm.org/D5715
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 26 Jan 2019 10:40:37 -0800] rev 41405
mail: document behavior of Python 3
test-notify.t (and possibly other tests) are failing on Python 3
because email.message.Message is now aware of encodings and
attempts to roundtrip values with the specified message encoding.
Python 2 doesn't perform this roundtripping. We have tests with
non-ascii data being serialized to a message that claims to use
ascii encoding.
I /think/ Mercurial's behavior may be buggy here. But I'm not
sure.
I'm documenting the behavior so the next person who looks into
this doesn't start from scratch like I did.
Differential Revision: https://phab.mercurial-scm.org/D5714
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 26 Jan 2019 10:22:09 -0800] rev 41404
notify: be more defensive aboute None values
encoding.strtolocal is the identity function on Python 2
but an actual string manipulation routine on Python 3.
In some cases, we were passing None, which caused Python 3
to barf.
Let's change the code to react properly when the value is
None.
Differential Revision: https://phab.mercurial-scm.org/D5713
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 26 Jan 2019 10:00:17 -0800] rev 41403
wireprotov2server: use our JSON encoder
Python's json module doesn't like to encode bytes instances.
This makes this code difficult to work with Python 3.
We simply swap in Mercurial's JSON encoder to work around it.
Differential Revision: https://phab.mercurial-scm.org/D5712
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 17:11:49 -0800] rev 41402
tests: add optional setsockopt() lines for Python 3
Differential Revision: https://phab.mercurial-scm.org/D5711
Navaneeth Suresh <navaneeths1998@gmail.com> [Sat, 26 Jan 2019 13:14:21 +0530] rev 41401
diffstat: support filenames with whitespaces on renames
This is a follow-up patch to D5628. `line.split()` cannot get filenames with
whitespaces as mentioned by @yuja. This patch replaces `split()` method with
`slice`. Corresponding tests were also added.
Differential Revision: https://phab.mercurial-scm.org/D5709
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Jan 2019 23:08:31 -0800] rev 41400
largefiles: avoid walking full manifest
When using treemanifest, diffs between two manifests can often be much
cheaper than iterating the full manifests (because common subtrees are
skipped).
Differential Revision: https://phab.mercurial-scm.org/D5644
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 23:22:23 -0800] rev 41399
cleanup: use p1() instead of parents() when we only need the first parent
Differential Revision: https://phab.mercurial-scm.org/D5708
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 23:43:11 -0800] rev 41398
cleanup: use repo['.'] instead of repo[None].p1()
Differential Revision: https://phab.mercurial-scm.org/D5707
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 23:36:23 -0800] rev 41397
cleanup: use p1() and p2() instead of parents()[0] and parents()[1]
We have had these methods on both contexts and dirstate for a long
time now.
Differential Revision: https://phab.mercurial-scm.org/D5706
Martijn Pieters <mj@octobus.net> [Mon, 21 Jan 2019 15:29:14 +0000] rev 41396
branchmap: rename partial -> bcache
The name better reflects that we have a branchcache object here, even if at
*some point* it is still being constructed.
Differential Revision: https://phab.mercurial-scm.org/D5290
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Jan 2019 13:45:12 -0800] rev 41395
context: delete mistaken comment about return value of renamed()
The comment seems to think that the return value of renamed() is a
tuple of source pathsx in the parents, but it's actually a pair of
(rename source path, file nodeid).
Differential Revision: https://phab.mercurial-scm.org/D5639
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Jan 2019 16:55:20 -0800] rev 41394
copies: get working copy parents from wctx, not dirstate, to make in-mem work
Before this patch, `run-tests.py test-rebase-conflicts.t
--extra-config-opt rebase.experimental.inmemory=1` would have some
lines that say "searching for copies back to rev 3" changed to
"... rev 1". I don't know of a better way of testing this patch than
doing that manually. There are many other differences, so we're not
ready to use #testcases syntax on the entire test-rebase-conflicts.t
yet.
Differential Revision: https://phab.mercurial-scm.org/D5596
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Jan 2019 16:50:50 -0800] rev 41393
copies: pass contexts into _findlimit()
Just a little refactoring to make the next patch simpler.
Differential Revision: https://phab.mercurial-scm.org/D5595
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Jan 2019 11:16:42 -0800] rev 41392
copies: consider nullrev a common ancestor
I've seen many bugs in the git codebase that were caused by it not
having a null revision and being forced to treat root commits
differently. Mercurial has a null revision and I think it's generally
a bug to treat it differently from other commits in graph algorithms.
This effectively undoes
83cfa1baf8ad (copies: don't report copies with
unrelated branch, 2010-01-01). The test cases that that commit added
still passes. I suspect some other fix after that commit made it
unnecessary.
Differential Revision: https://phab.mercurial-scm.org/D5594
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Jan 2019 09:18:48 -0800] rev 41391
unshare: use context manager for locks
Differential Revision: https://phab.mercurial-scm.org/D5695
Augie Fackler <augie@google.com> [Fri, 25 Jan 2019 21:23:16 -0500] rev 41390
py3: new tests from the ratchet
Thanks to indygreg for doing the work on these!
Differential Revision: https://phab.mercurial-scm.org/D5705
Anton Shestakov <av6@dwimlabs.net> [Sat, 26 Jan 2019 12:24:04 +0800] rev 41389
dagop: check if stopdepth is greater than or equal to maxlogdepth
Might prevent off-by-one errors.
Anton Shestakov <av6@dwimlabs.net> [Sat, 26 Jan 2019 12:21:20 +0800] rev 41388
revset: move dagop.maxlogdepth usage to generationsrel()
Not all subscript operations would want (maxlogdepth - 1) in place of None.
Anton Shestakov <av6@dwimlabs.net> [Sat, 26 Jan 2019 12:20:05 +0800] rev 41387
test-revset: check that #generations[1:-1] doesn't result in any errors
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Jan 2019 22:32:45 -0500] rev 41386
py3: fix a bytes/str mingling in test-install.t
Matt Harbison <matt_harbison@yahoo.com> [Fri, 25 Jan 2019 21:19:51 -0500] rev 41385
tests: conditionalize Windows difference in test-dispatch.t
The output matches the comment added 6 years ago in
ef60083b5536, so I'm
assuming that difference was the reason for the over-globbing removed in
93a7539a546e.
There's still a bit of py3 instability here, but I assume those are just more
Windows issues:
@@ -95,7 +95,7 @@
[255]
$ hg log -b --cwd=inexistent default
- abort: $ENOENT$: 'inexistent'
+ abort: $ENOENT$: inexistent
[255]
$ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
@@ -189,7 +189,7 @@
$ hg -R a archive ''
abort: $ENOENT$: '' (no-windows !)
- abort: $ENOTDIR$: '' (windows !)
+ abort: $ENOTDIR$
[255]
#if no-outer-repo
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 16:00:34 -0800] rev 41384
util: cast memoryview to bytes
Python 3 uses readinto() instead of read() in places. And
taking a slice of the buffer passed to readinto() will produce
a memoryview. _writedata() then gets confused when testing for
`b'\n' in data` because memoryview is an iterable over ints
instead of 1 character bytes.
We work around by casting a memoryview to bytes.
Differential Revision: https://phab.mercurial-scm.org/D5704
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:36:55 -0800] rev 41383
tests: add b'' prefixes to ui.configbool() call
Otherwise the call fails due to using str on Python 3.
# skip-blame: just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5703
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:31:07 -0800] rev 41382
commands: check for modheads being None
Python 2 allows the > operator to be used with a None and an
int. Python 3 does not. So we need to ensure the value isn't None
before comparing with >.
Differential Revision: https://phab.mercurial-scm.org/D5702
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:21:56 -0800] rev 41381
tests: add b'' when testing for tls1.2
The dict keys are bytes. The test was always failing due to
looking for a str key.
skip-blame: just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D5701
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:15:59 -0800] rev 41380
wireprotov2peer: make "received frame(...)" messages debug level
We don't need to show these during --verbose, it's more of a
debugging thing.
Differential Revision: https://phab.mercurial-scm.org/D5700
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:09:08 -0800] rev 41379
tests: add optional setsockopt() output on Python 3
Tests still don't pass. But this gets us a little closer.
Differential Revision: https://phab.mercurial-scm.org/D5699
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 15:03:20 -0800] rev 41378
wireprotov2peer: rewrite character traversal to use slices
Otherwise on Python 3 we iterate over integers instead of a
bytes instance and the comparison fails.
Differential Revision: https://phab.mercurial-scm.org/D5698
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 14:57:37 -0800] rev 41377
wireprotov2server: don't attempt to cast command name
I'm not sure why this was added. The command name should already
be bytes.
Differential Revision: https://phab.mercurial-scm.org/D5697
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 25 Jan 2019 14:38:49 -0800] rev 41376
wireprotov2server: use pycompat.strkwargs when calling cachekeyfn
Differential Revision: https://phab.mercurial-scm.org/D5696
Navaneeth Suresh <navaneeths1998@gmail.com> [Thu, 17 Jan 2019 18:05:54 +0530] rev 41375
diffstat: make --git work properly on renames (
issue6025)
`$ hg diff --stat --git` shows only the new filename on renames.
I added the old filename also to the output to make it identical
with the output of `$ git diff --stat`.
Differential Revision: https://phab.mercurial-scm.org/D5628