Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 14 Dec 2018 21:00:33 +0300] rev 40950
py3: add a b'' prefix in tests/test-remotefilelog-pull-noshallow.t
This makes the test pass on Python 3.
# skip-blame because just b'' prefix.
Differential Revision: https://phab.mercurial-scm.org/D5427
Augie Fackler <augie@google.com> [Fri, 14 Dec 2018 12:01:47 -0500] rev 40949
error: implement __str__ on RevlogError to fix some output defects on Py3
We open-code encoding.unimethod here to avoid cycles, and do a local
import of encoding when someone str()s a RevlogError. It's not my
favorite solution, but it gets the job done.
Differential Revision: https://phab.mercurial-scm.org/D5426
Augie Fackler <augie@google.com> [Fri, 14 Dec 2018 12:00:38 -0500] rev 40948
perf: add two more missing b prefixes for Python 3
# skip-blame just two more b prefixes
Differential Revision: https://phab.mercurial-scm.org/D5425
Augie Fackler <augie@google.com> [Fri, 14 Dec 2018 11:37:50 -0500] rev 40947
match: fix doctest to use bytes instead of str
Fixes doctests on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5423
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 14 Dec 2018 19:30:20 +0300] rev 40946
py3: use pycompat.bytechr() instead of chr() in test-fastannotate-revmap.py
This makes the test pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5422
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 14 Dec 2018 19:21:28 +0300] rev 40945
py3: add a missing b'' prefix in contrib/perf.py
# skip-blame because just b'' prefixes
This fixes test-contrib-perf.t on Python 3 which started failing.
Differential Revision: https://phab.mercurial-scm.org/D5421
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 14 Dec 2018 19:12:45 +0300] rev 40944
py3: use '%d' for integers instead of '%s'
This should fix test-rebase-inmemory.t which started failing on Python 3 after
recent changes.
Differential Revision: https://phab.mercurial-scm.org/D5420
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 14 Dec 2018 19:10:46 +0300] rev 40943
py3: whitelist another passing test caught by buildbot
Differential Revision: https://phab.mercurial-scm.org/D5419
Yuya Nishihara <yuya@tcha.org> [Fri, 14 Dec 2018 21:19:19 +0900] rev 40942
py3: fix bad escapes of sub() replacement pattern in test-template-basic.t
Python 3.7 starts complaining about it. We have to double the backslash or
'\x5c' to get around.
Georges Racinet <gracinet@anybox.fr> [Thu, 13 Dec 2018 17:10:03 +0100] rev 40941
perfdiscovery: benching findcommonheads()
This works between the local repo and any peer given by its path, and
should be useful for further work on discovery
Differential Revision: https://phab.mercurial-scm.org/D5418
Matt Harbison <matt_harbison@yahoo.com> [Sat, 15 Dec 2018 14:55:06 -0500] rev 40940
windows: ensure pure posixfile fd doesn't escape by entering context manager
There are tests in test-revlog-mmapindex.t and test-rebase-mq-skip.t that are
fixed by this, but we usually don't use --pure on Windows. For whatever reason,
the remaining --pure failures are various errors like $ENOTDIR$ and "Access is
denied" have a trailing '.'.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 15 Dec 2018 13:54:37 -0500] rev 40939
vfs: ensure closewrapbase fh doesn't escape by entering context manager
I'm not sure if there's a problem in practice here, as there's no test failure
either way. The __exit__() and close() methods raise an exception, so maybe
__exit__() and close() are being called directly on the underlying handle when
delayclosedfile is used on a context manager? I doubt that was intended.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 15 Dec 2018 13:41:34 -0500] rev 40938
windows: ensure mixedfilemodewrapper fd doesn't escape by entering context mgr
Otherwise it seems that the special read and write handling would be bypassed.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 15 Dec 2018 01:26:18 -0500] rev 40937
py3: ensure the proxied Windows fd doesn't escape by entering context manager
The purpose of the proxy class is to provide the `name` attribute which contains
the file path. But in tests that used a context manager, it still blew up
complaining that 'int' doesn't have a 'startswith' function.
Augie Fackler <augie@google.com> [Thu, 13 Dec 2018 14:44:54 -0500] rev 40936
merge with stable
Yuya Nishihara <yuya@tcha.org> [Wed, 12 Dec 2018 22:45:02 +0900] rev 40935
templatefuncs: specialize "no match" value of search() to allow % operation
If Python had Maybe or Option, the type of the search() result would be
Option<Mapping>, which can be considered as a 0/1 container of a Mapping.
So it makes sense that {search(r'no match pattern', x) % "whatever"} is
mapped to an empty string.
Yuya Nishihara <yuya@tcha.org> [Wed, 12 Dec 2018 22:19:57 +0900] rev 40934
templatefuncs: add regexp search() function that extracts substring
This can be used to extract an issue number from a commit message, for
example:
{search(r'\(issue([0-9]*)\)', desc) % '{1}'}
Georges Racinet <gracinet@anybox.fr> [Fri, 30 Nov 2018 00:44:04 +0100] rev 40933
rust: changed Graph.parents to return [Revision; 2]
This will allow for simple iteration on parent revisions,
such as:
for parent in graph.parents(rev)?.iter().cloned()
This seems to be a zero overhead abstraction once built in
release mode.
Differential Revision: https://phab.mercurial-scm.org/D5415
Georges Racinet <gracinet@anybox.fr> [Tue, 11 Dec 2018 17:31:54 +0100] rev 40932
rust: improved docstring
In the previous wording, rustfmt wanted to cut at the == which is not very
readable in my taste.
Differential Revision: https://phab.mercurial-scm.org/D5414
Anton Shestakov <av6@dwimlabs.net> [Thu, 13 Dec 2018 17:18:57 +0800] rev 40931
revset: move subscript relation functions to its own dict
This will help adding more relation functions in extensions.
We skip short names (that consist of one letter) while raising
UnknownIdentifier because such names cannot be suggested anyway: the similarity
cutoff in dispatch._getsimilar() is currently 0.6.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 13 Dec 2018 00:18:47 -0500] rev 40930
py3: teach run-tests.py to handle exe with spaces when --local isn't specified
This was the reason that no amount of quoting worked in test-hghave.t.
`os.popen()` needed to be swapped out because while the added quoting around
line 3124 worked on py3, it failed on py2. See
38d51371792b. The problem with
`os.system()` was wrongly splitting the command on the space in 'Program Files',
regardless of quoting. It looks like there are a few other instances of
`os.system()` in core code, so presumably those should be replaced?
Georges Racinet <gracinet@anybox.fr> [Tue, 11 Dec 2018 17:13:17 +0100] rev 40929
rust: adapted hg-core tests for iteration over Result
Now AncestorsIterator iters on Result<Revision, GraphError>
Matt Harbison <matt_harbison@yahoo.com> [Tue, 11 Dec 2018 21:57:54 -0500] rev 40928
win32: close the handles associated with a spawned child process
Probably not a big deal because at this point, the call is only used when
spawning a daemonized server. In that case, the parent process goes away first,
so it won't prevent the child from being cleaned up.
Yuya Nishihara <yuya@tcha.org> [Tue, 11 Dec 2018 22:23:39 +0900] rev 40927
rust: remove comment about error handling of AncestorsIterator
To be align with
443eb4bc41af "rust: propagate error of index_get_parents()
properly."
Spotted by Georges Racinet.
Julien Cristau <jcristau@mozilla.com> [Wed, 12 Dec 2018 06:41:19 +0100] rev 40926
test: fix test-http-bad-server with current python 2.7
https://github.com/python/cpython/pull/2825 changed the exception
message for empty http status line.
Differential Revision: https://phab.mercurial-scm.org/D5412
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 20:01:07 +0000] rev 40925
perf: add perfprogress command
I've noticed that progress bars can add significant overhead to tight
loops. Let's add a perf command that attempts to isolate that overhead.
With a default hgrc, iteration over 1M items appears to take ~3.75s on
my machine. Profiling reveals ~28% of time is spent in ui.configbool()
resolving the value of the progress.debug config option.
Even if I set progress.disable=true, execution still takes ~2.60s, with
~59% of the time spent in ui.configbool().
Differential Revision: https://phab.mercurial-scm.org/D5407
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 18:55:08 +0000] rev 40924
wireprotov2: unify file revision collection and linknode derivation
The old mechanism for choosing which file revisions to send in the
haveparents=True case was buggy in multiple ways - the most severe
of which being that file revisions were excluded when they shouldn't
have been.
This commit unifies the logic for deriving the filenodes that will
be sent by the "filesdata" command. We now consistently read files
data from manifests. The "haveparents" argument now controls whether
we iterate ctx.files() or use the full manifest to derive relevant
files.
The logic here is still woefully lacking to fully support shallow
clones. It will require an API break to fully address. This commit
should at least make the server APIs emit proper data, which is
strictly better than before.
Differential Revision: https://phab.mercurial-scm.org/D5406
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 18:04:12 +0000] rev 40923
wireprotov2: send linknodes to emitfilerevisions()
Previously, linknodes were calculated within emitfilerevisions() by
using filectx.introrev(), which would always use the linkrev/linknode
as recorded by storage. This is wrong for cases where the receiver
doesn't have the changeset the linknode refers to.
This commit changes the logic for linknode emission so the mapping
of filenode to linknode is computed by the caller and passed into
emitfilerevisions().
As part of the change, linknodes for "filesdata" in the
haveparents=False case are now correct: the existing code performed a
manifest walk and it was trivial to plug in the correct linknode.
However, behavior for the haveparents=True case is still wrong
because it relies on filtering linkrevs against the outgoing set in
order to determine what to send. This will be fixed in a subsequent
commit.
The change test test-wireproto-exchangev2-shallow.t is a bit wonky.
The test repo has 6 revisions. The changed test is performing a shallow
clone with depth=1. So, only file data for revision 5 is present
locally. So, the new behavior of associating the linknode with
revision 5 for every file revision seems correct. Of course, when
backfilling old revisions, we'll want to update the linknode. But
this problem requires wire protocol support and we'll cross that
bridge later.
Differential Revision: https://phab.mercurial-scm.org/D5405
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 17:26:12 +0000] rev 40922
tests: add tests for server-side linknode adjustment with wireprotov2
The current implementation of linknode serving in wireprotov2 simply
serves up the linkrev/linknode as stored: it doesn't attempt to
adjust the linknode to what the receiver is aware of. This can result
in the client seeing a linknode referencing a changeset that is unknown
to it.
This commit adds test coverage of that scenario.
The tests in test-wireproto-command-filesdata.t demonstrate two failures.
First, the linknode refers to a changeset not in the available set.
Second, the server doesn't send a file revision that it should have
(because of linkrev filtering).
The test in test-wireproto-exchange.t demonstrates that the lack of
a file revision results in a corrupted repository on the client.
Differential Revision: https://phab.mercurial-scm.org/D5404
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 16:53:09 +0000] rev 40921
tests: fix empty commit in test
This was almost certainly a bug.
Differential Revision: https://phab.mercurial-scm.org/D5403
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 10 Dec 2018 19:41:43 +0000] rev 40920
tests: add sparserevlog requirement to test-sqlitestore.t
Looks like this test was missed when enabling sparse revlogs by default.
Differential Revision: https://phab.mercurial-scm.org/D5402
Boris Feld <boris.feld@octobus.net> [Mon, 12 Nov 2018 02:21:52 +0100] rev 40919
tests: remove all transitional configuration
Now that sparse-revlog is enabled by default, we no longer needs it.
Differential Revision: https://phab.mercurial-scm.org/D5346