Gregory Szorc <gregory.szorc@gmail.com> [Thu, 23 Aug 2018 13:50:47 -0700] rev 39485
wireprotov2peer: report exceptions in frame handling against request future
Otherwise the future may never resolve, which could cause deadlock.
Differential Revision: https://phab.mercurial-scm.org/D4440
Anton Shestakov <av6@dwimlabs.net> [Sat, 08 Sep 2018 21:58:51 +0800] rev 39484
httppeer: use util.readexactly() to abort on incomplete responses
Plain resp.read(n) may not return exactly n bytes when we need, and to detect
such cases before trying to interpret whatever has been read, we can use
util.readexactly(), which raises an Abort when stream ends unexpectedly. In the
first case here, readexactly() prevents a traceback with struct.error, in the
second it avoids looking for invalid compression engines.
In this test case, _wraphttpresponse doesn't catch the problem (presumably
because it doesn't know transfer encoding), and the code continues reading the
response until it gets to compression engine data. Maybe there should be checks
before the execution gets there, but I'm not sure where (httplib?)
Anton Shestakov <av6@dwimlabs.net> [Sat, 08 Sep 2018 23:57:07 +0800] rev 39483
httppeer: calculate total expected bytes correctly
User-facing error messages that handled httplib.IncompleteRead errors in
Mercurial used to look like this:
abort: HTTP request error (incomplete response; expected 3 bytes got 1)
But the errors that are being handled underneath the UI look like this:
IncompleteRead(1 bytes read, 3 more expected)
I.e. the error actually counts total number of expected bytes minus bytes
already received.
Before, users could see weird messages like "expected 10 bytes got 10", while
in reality httplib expected 10 _more_ bytes (20 in total).
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Sep 2018 23:36:09 -0700] rev 39482
lazyancestors: reuse __iter__ implementation in __contains__
There was a comment in the code that said "Trying to do both __iter__
and __contains__ using the same visit heap and seen set is complex
enough that it slows down both. Keep them separate.". However, it
seems easy and efficient to make __contains__ keep an iterator across
calls.
I couldn't measure any slowdown from `hg bundle --all` (which seem to
call lazyancestors.__contains__ frequently).
Differential Revision: https://phab.mercurial-scm.org/D4508
Martin von Zweigbergk <martinvonz@google.com> [Sun, 09 Sep 2018 23:16:55 -0700] rev 39481
lazyancestors: extract __iter__ to free function
The next patch will keep a reference to the returned iterator in a
field, which would otherwise result in a reference cycle.
Differential Revision: https://phab.mercurial-scm.org/D4517
Boris Feld <boris.feld@octobus.net> [Thu, 30 Aug 2018 01:53:21 +0200] rev 39480
phase: report number of non-public changeset alongside the new range
When interacting with non-publishing repository or bundle, it is useful to
have some information about the phase of the changeset we just pulled.
This changeset updates the "new changesets MIN:MAX" output to also includes
phases information for non-public changesets. Displaying extra data about
non-public changesets means the output for exchange with publishing repository
(the default) is unaffected.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 07 Sep 2018 23:54:42 -0400] rev 39479
tests: disable test-nointerrupt on Windows
Per the followup discussion[1]. proc.send_signal(INT) in timeout.py raises a
ValueError because of an unsupported signal. I don't like missing test coverage
for this on Windows. But this is the last test failing on Windows, and red all
the time hides new failures.
[1] https://phab.mercurial-scm.org/D3716
Matt Harbison <matt_harbison@yahoo.com> [Fri, 07 Sep 2018 23:39:49 -0400] rev 39478
tests: conditionalize an error message about unlinking a non empty directory
The message on Windows comes from win32.unlink(). It looks like os.unlink() on
posix platforms is a simple call to unlink(3), which turns into unlinkat(2).
Since there's a comment in one of the tests that the message should be improved,
I don't think it's worth adding a check in win32.unlink() to see if it's empty,
if that function is always going to fail on a directory. (It seems like the
POSIX spec allows unlinking directories though.)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Sep 2018 14:48:38 -0700] rev 39477
ancestors: add nullrev to set from the beginning
Differential Revision: https://phab.mercurial-scm.org/D4507
Yuya Nishihara <yuya@tcha.org> [Sat, 08 Sep 2018 10:59:24 +0900] rev 39476
ancestor: filter out initial revisions lower than stoprev
Yuya Nishihara <yuya@tcha.org> [Sat, 08 Sep 2018 10:48:42 +0900] rev 39475
ancestor: add test showing inconsistency between __iter__ and __contains__
Boris Feld <boris.feld@octobus.net> [Thu, 06 Sep 2018 19:37:38 -0400] rev 39474
ancestors: ensure a consistent order even in the "inclusive" case
It seems odds to first issue the "source" revs and then the other ancestors.
In addition, doing so can break the other contract of always issuing a child
before its parent. We update the code to apply the same logic to all yielded
revision. No tests break so we seem in the clear except where we explicitly
test the order.
Boris Feld <boris.feld@octobus.net> [Thu, 06 Sep 2018 17:00:28 -0400] rev 39473
ancestors: actually iterate over ancestors in topological order (
issue5979)
This code previously used a dequeue logic, the first ancestors seen were the
first ancestors to be emitted. In branching/merging situations, it can result
in ancestors being yielded before their descendants, breaking the object
contract.
We got affected by this issue while working on the copy tracing code. At about
the same time, Axel Hecht <axel@mozilla.com> reported the issue and provided
the test case used in this changeset. Thanks Axel.
Running `hg perfancestors` does not show a significant difference between the
old and the new version.
Yuya Nishihara <yuya@tcha.org> [Thu, 06 Sep 2018 22:12:21 +0900] rev 39472
doc: use modern import style in runrst
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Aug 2018 22:18:09 +0900] rev 39471
hgweb: do not audit URL path as working-directory path
Since hgweb is an interface to repository data, we don't need to prohibit
any paths conflicting within the filesystem. Still an access to working
files is audited by filectx.
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Aug 2018 22:23:25 +0900] rev 39470
hgweb: map Abort to 403 error to report inaccessible path for example
Abort is so common in our codebase. We could instead introduce a dedicated
type for path auditing errors, but we'll probably have to catch error.Abort
anyway.
As you can see, an abort message may include a full path to the repository,
which might be considered information leak. If that matters, we should hide
the message and send it to the server log instead.
Yuya Nishihara <yuya@tcha.org> [Fri, 07 Sep 2018 22:19:28 +0900] rev 39469
hgweb: add error template to json so it won't crash
Yuya Nishihara <yuya@tcha.org> [Fri, 07 Sep 2018 22:12:46 +0900] rev 39468
hgweb: show shortlog by default in json output (
issue5978)
Augie Fackler <augie@google.com> [Fri, 07 Sep 2018 11:35:43 -0400] rev 39467
merge with stable
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 15:16:22 +0300] rev 39466
tests: improve the widening testing in test-narrow-widen*
Before this patch, we are testing `hg tracked --addinclude` by adding a command
which is not introduced in the changesets till now.
If you closely look at the tests, wider/f was introduced on the server after the
narrow clone was done and extending the existing clone to include wider/f does
not make sense. We should test extending a file which exists.
Differential Revision: https://phab.mercurial-scm.org/D4452
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 19:26:50 +0300] rev 39465
narrow: use util.readfile() and improve error message using --narrowspec
This patch improves the error message and uses util.readfile() for reading
narrowspecs file while cloning.
Differential Revision: https://phab.mercurial-scm.org/D4462
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 04 Sep 2018 15:55:23 -0700] rev 39464
merge: use vfs methods for I/O
All I/O is supposed to be performed via vfs instances so filesystems
can be abstracted. The previous commit ported the old code in purge,
which didn't go through the vfs layer. This commit ports the purge
code to use the vfs layer.
The vfs layer didn't have a method to remove a single directory, so
it was added as part of implementing this.
Differential Revision: https://phab.mercurial-scm.org/D4478
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 06 Sep 2018 18:30:12 -0700] rev 39463
merge: move purge logic from extension
Working directory purging feels like functionality that should be
in core rather than in an extension.
This commit effectively moves the core purging logic from the
purge extension to merge.py.
Code was refactored slightly. Rather than deal with printing in
this function, the function is a generator of paths and the caller
can worry about printing.
Differential Revision: https://phab.mercurial-scm.org/D4477
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 Sep 2018 23:37:24 -0400] rev 39462
tests: stabilize test-removeemptydirs.t on Windows
Yuya Nishihara <yuya@tcha.org> [Thu, 06 Sep 2018 21:55:30 +0900] rev 39461
help: add internals.wireprotocolv2 to the table, and remove redundant header
Kyle Lippincott <spectral@google.com> [Fri, 17 Aug 2018 19:18:53 -0700] rev 39460
match: improve includematcher.visitchildrenset to be much faster and cached
This improves the speed of visitchildrenset considerably, especially when there
are complicated matchers involved that may have many entries in _dirs or
_parents.
Unfortunately the benchmark isn't easily upstreamed due to its reliance on
https://github.com/vstinner/perf (primarily due to the conflict when importing
it if I were to contribute the benchmark as contrib/matcherbenchmarks.py)
instead of asv or some other perf measurement system.
To describe the benchmark briefly: I generated an includematcher of either 5 or
3500 "rootfilesin:prefix1/prefix2/prefix3/<randomsubdirs, 1-8 levels deep>"
items in the 'setup' function, and then called
`im.visitchildrenset('prefix1/prefix2')` in the 'stmt' function in perf.timeit.
For the set of 5:
- before: 15.3 us +- 2.9 us
- after: 1.59 us +- 0.02 us
For the set of 3500:
- before: 3.90 ms +- 0.10 ms
- after: 3.15 us +- 0.09 us (note the m->u change)
Differential Revision: https://phab.mercurial-scm.org/D4351
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 06 Sep 2018 03:21:05 +0530] rev 39459
py3: add new passing tests spotted by the buildbot
Differential Revision: https://phab.mercurial-scm.org/D4495
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 06 Sep 2018 03:24:27 +0530] rev 39458
tests: order the imports in test-fastannotate-hg.t
The wrong ordering breaks test-check-module-imports.t on Python 3. I am not sure
why that test is so much active on py3.
Differential Revision: https://phab.mercurial-scm.org/D4496
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 Sep 2018 00:51:21 -0400] rev 39457
lfs: ensure the blob is linked to the remote store on skipped uploads
I noticed a "missing" blob when pushing two repositories with common blobs to a
fresh server, and then running `hg verify` as a user different from the one
running the web server. When pushing the second repo, several of the blobs
already existed in the user cache, so the server indicated to the client that it
doesn't need to upload the blobs. That's good enough for the web server process
to serve up in the future. But a different user has a different cache by
default, so verify complains that `lfs.url` needs to be set, because it wants to
fetch the missing blobs.
Aside from that corner case, it's better to keep all of the blobs in the repo
whenever possible. Especially since the largefiles wiki says the user cache can
be deleted at any time to reclaim disk space- users switching over may have the
same expectations.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 04 Sep 2018 22:29:38 -0400] rev 39456
cbor: teach the encoder to handle python `long` type for Windows
The tests for 2**32 and -
7000000000 were blowing up, complaining about not
knowing how to encode type 'long'. sys.maxint tops out at 2**31-1 on Windows,
but I guess is 2^63-1 on Linux? I *think* we're OK on the decode side, as there
is an assertion that the decoded value is equal to the original primitive value.
I opted for the pycompat alias instead of swallowing the NameError because the
vendored cbor package uses an alias, and I see at least pywatchman and
templatefilters open codes their own aliases.
Augie Fackler <raf@durin42.com> [Wed, 05 Sep 2018 16:39:47 -0400] rev 39455
buildrpm: remove TODO that looks done to me
Differential Revision: https://phab.mercurial-scm.org/D4494
Augie Fackler <raf@durin42.com> [Wed, 05 Sep 2018 16:29:31 -0400] rev 39454
buildrpm: fix embarassing bug in shell variable expansions
`$distance_$node` looks up and concatenates `$distance_` and
`$node`. `$distance_` is empty, so we were getting the node without
the distance. Using the curly braces makes our intent explicit and
produces better-versioned RPMS.
Differential Revision: https://phab.mercurial-scm.org/D4493
Matt Harbison <matt_harbison@yahoo.com> [Tue, 04 Sep 2018 20:48:22 -0400] rev 39453
absorb: clarify the reason for not finding changesets to modify
I'm used to pushing to non-publishing repos, so this was the last thing I
thought to check.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 05 Sep 2018 09:36:31 -0700] rev 39452
merge with stable
Includes an extra bump of the version number for parsers because the
merge produces a new, distinct version of the code.
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 04 Sep 2018 10:22:42 -0700] rev 39451
state: use our CBOR module
This was the last consumer of the vendored CBOR package in
core.
Differential Revision: https://phab.mercurial-scm.org/D4471
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 15:41:09 -0700] rev 39450
wireprotov2peer: use our CBOR decoder
Behavior should be the same in order to preserve backwards
compatibility. We obviously want to stream values in this code.
We'll do that in subsequent commits.
Differential Revision: https://phab.mercurial-scm.org/D4470
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 15:37:55 -0700] rev 39449
debugcommands: use our CBOR decoder
It implements the set of CBOR needed for the wire protocol.
Differential Revision: https://phab.mercurial-scm.org/D4469
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 18:12:04 -0700] rev 39448
wireprotov2server: use our CBOR encoder
Again, test output changed slightly because of map key ordering
differences. This shouldn't matter.
I could have called oncommandresponsereadygen() with the raw output
from the stream encoder. However, this changed test output further.
I left a TODO to follow up on that later.
Differential Revision: https://phab.mercurial-scm.org/D4468
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 18:05:48 -0700] rev 39447
wireprotoserver: use our CBOR encoder
Moving away from the vendored package.
Again, our encoder normalizes keys differently from the vendored
package (for now), hence the test changes.
Differential Revision: https://phab.mercurial-scm.org/D4467
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 18:05:08 -0700] rev 39446
wireprotoframing: use our CBOR module
Tests changed because our CBOR encoder appears to sort map keys
differently from the vendored CBOR package. The CBOR specification
does define canonical sorting rules for keys based on the
byte values. I'm guessing our implementation doesn't follow them.
But our encoder doesn't guarantee that it conforms with the canonical
specification. Right now, we just care that output is deterministic.
And our encoder does guarantee that.
Differential Revision: https://phab.mercurial-scm.org/D4466
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 15:10:56 -0700] rev 39445
httppeer: use our CBOR decoder
We just implemented our own CBOR decoder. Let's use it in
httppeer.
Differential Revision: https://phab.mercurial-scm.org/D4465
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Aug 2018 09:02:07 +0800] rev 39444
zsh_completion: complete shelve and unshelve
Differential Revision: https://phab.mercurial-scm.org/D4428
Anton Shestakov <av6@dwimlabs.net> [Tue, 21 Aug 2018 20:30:53 +0800] rev 39443
zsh_completion: use revsets to exclude this rev from suggestions to hg merge
One of the most important aspects of a completion system is its speed, so 1
call to hg is definitely better than 4.
Sorting by rev (descending) is to preserve the same order as in `hg heads`
output.
While at it, declare branches as an array too.
Differential Revision: https://phab.mercurial-scm.org/D4426
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 Sep 2018 10:36:34 -0700] rev 39442
drawdag: correctly pass repo to super constructor
This was caught by someone who was looking for the
super(cls, self).__init__(self, ...)
pattern in all code in our Google-internal repo.
Differential Revision: https://phab.mercurial-scm.org/D4464
Matt Harbison <matt_harbison@yahoo.com> [Tue, 04 Sep 2018 20:54:41 -0400] rev 39441
help: correct a typo in tweakdefaults
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 06 Aug 2018 14:06:19 +0300] rev 39440
narrow: add '--import-rules' flag to tracked command
This patch adds a `--import-rules` flag to tracked command provided by narrow
extension. Using the --import-rules flag, you can pass a filename from which
narrowspecs should be read and added to main narrowspec.
A lot of times, in automation or manually also, when you are working with big
repo, specifying each path name on commandline using '--addinclude' and
'--addexclude' is tedious and something which can scale. So we needed something
where we can pass a file to extend the narrowspecs.
Nice thing about this is that the automations which reads some file to change
the sparse profile, can now read the same file for changing narrowspecs too.
Tests are added for the new feature.
Differential Revision: https://phab.mercurial-scm.org/D4125
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 23 Aug 2018 13:11:13 -0700] rev 39439
internals: extract wire protocol version 2 commands to standalone doc
wireprotocol.txt is a bit long and unwieldy. I think splitting it up
will help aid comprehension.
Let's start by extracting wire protocol version 2 commands to a
standalone document.
As part of the port, I munged with the section titles a bit and
expanded the TODO around node namespaces.
Differential Revision: https://phab.mercurial-scm.org/D4442
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 23 Aug 2018 13:46:39 -0700] rev 39438
wireprotov2peer: split responsedata handling into separate function
So we don't have so much logic inside an if/elif block.
Differential Revision: https://phab.mercurial-scm.org/D4439
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 22 Aug 2018 10:25:47 -0700] rev 39437
httppeer: add TODO about delayed handling of ^C
When testing wire protocol v2 with large responses, I noticed that
^C doesn't result in immediate termination. I'm not sure what the
root cause is. Let's add a TODO so we don't forget about it.
Differential Revision: https://phab.mercurial-scm.org/D4438
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 31 Aug 2018 08:57:14 -0700] rev 39436
httppeer: log commands for version 2 peer
This will aid testing and debugging.
Differential Revision: https://phab.mercurial-scm.org/D4437
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 22 Aug 2018 10:29:30 -0700] rev 39435
wireprotov2peer: add TODO about streaming responses
This is a pretty big deficiency in the current implementation.
We don't want to forget about this.
Differential Revision: https://phab.mercurial-scm.org/D4435
Augie Fackler <augie@google.com> [Tue, 04 Sep 2018 12:36:33 -0400] rev 39434
tests: update relnotes test for actual output
I'm unclear why I didn't see this before but I consistently see it
now. In any event, it doesn't appear to be a regression, so let's just
bake it into the test.
Differential Revision: https://phab.mercurial-scm.org/D4463
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:57:49 +0300] rev 39433
py3: use print as a function in tests/test-hgweb.t
Differential Revision: https://phab.mercurial-scm.org/D4461
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:58:39 +0300] rev 39432
py3: bytestr a bytes val to make sure we get bytechr while iterating
Differential Revision: https://phab.mercurial-scm.org/D4460
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:53:54 +0300] rev 39431
py3: make regexes in hgext/keyword.py bytes
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4459
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:33:59 +0300] rev 39430
py3: add more missing b'' prefixes in test files
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4458
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:33:22 +0300] rev 39429
py3: write the file in str mode in tests/test-rename-merge2.t
This is better then converting the value the value of sys.argv to bytes.
This makes the test pass on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4457
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:32:09 +0300] rev 39428
py3: add missing b'' prefixes in tests/badserverext.py
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4456
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:19:30 +0300] rev 39427
py3: handle keyword arguments correctly in hgext/acl.py
The keys of keyword arguments on python 3 should be str, so when we try to get
some key from them, we must make sure we are using str.
# skip-blame because just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D4455
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:16:29 +0300] rev 39426
py3: don't return the revid as unicode in hgext/convert/subversion.py
I tried digging why u'' was added in first place, and I was unable to found
something relevant. This might be because some API's takes unicodes, I am not
sure.
Differential Revision: https://phab.mercurial-scm.org/D4454
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 04 Sep 2018 17:15:17 +0300] rev 39425
py3: make sure we pass str in os.sysconf in hgext/convert/common.py
# skip-blame because just r'' prefix
Differential Revision: https://phab.mercurial-scm.org/D4453
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 21:49:44 +0900] rev 39424
manifest: fix leak on error return from lazymanifest_filtercopy()
Spotted by ASAN.
free(copy->lines) and Py_DECREF(copy->pydata) are replaced by Py_XDECREF(copy),
which should call lazymanifest_dealloc(). Freeing half-initialized copy->lines
is safe since copy->numlines holds a valid value.
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 21:46:53 +0900] rev 39423
manifest: incref/decref copy->pydata to clarify 'copy' holds a reference
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 20:52:22 +0900] rev 39422
dirstate: use tuple interface to fix leak in pack_dirstate()
Spotted by ASAN.
Unlike PyTuple_GET_ITEM(), PySequence_ITEM() returns a new reference. This
bug could be fixed by inserting Py_CLEAR() and Py_XDECREF() appropriately,
but I think requiring a tuple object is simpler and less error-prone.
The cext version is jumped to 10 since 6..9 are used in the default branch.
We'll need to bump it again at merge.
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 22:10:41 +0900] rev 39421
xdiff: fix leak in hunk_consumer()
Spotted by ASAN.
Since PyList_Append() does not "steal" a reference, Py_DECREF() is always
required. Perhaps, this is the largest leak in this series.
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 20:57:38 +0900] rev 39420
base85: fix leak on error return from b85decode()
Spotted by ASAN.
We don't need to initialize 'out' to NULL, but I decided to do that for
clarity.
Augie Fackler <augie@google.com> [Tue, 04 Sep 2018 12:16:28 -0400] rev 39419
merge with stable
Augie Fackler <raf@durin42.com> [Tue, 04 Sep 2018 11:59:12 -0400] rev 39418
Added signature for changeset
ede3bf31fe63
Augie Fackler <raf@durin42.com> [Tue, 04 Sep 2018 11:59:09 -0400] rev 39417
Added tag 4.7.1 for changeset
ede3bf31fe63
Yuya Nishihara <yuya@tcha.org> [Fri, 31 Aug 2018 21:44:24 +0900] rev 39416
hgweb: load revcount + 1 entries to fill nextentry in log page (
issue5972)
"revcount + 1" is moved to the call site to make it clearer.
Yuya Nishihara <yuya@tcha.org> [Tue, 04 Sep 2018 13:29:21 +0900] rev 39415
revlog: fix size of Python nodetree object
Follows up
9f097214fbf3.
Yuya Nishihara <yuya@tcha.org> [Mon, 03 Sep 2018 23:03:19 +0900] rev 39414
revert: stabilize status message of chunks selected interactively
Unfortunately, patch.filterpatch() doesn't preserve the order of the input
files. We have to sort them manually.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 29 Aug 2018 14:29:01 -0700] rev 39413
cborutil: add a buffering decoder
The sansiodecoder leaves it up to the callers to feed in data that
wasn't fully consumed last time.
This commit implements a decoder that performs buffering of
leftover chunks from the previous invocation. It otherwise
behaves identically to sansiodecoder.
Differential Revision: https://phab.mercurial-scm.org/D4434
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 31 Aug 2018 15:54:17 -0700] rev 39412
cborutil: remove readindefinitebytestringtoiter()
This was implemented as part of implementing streaming encoding.
It was never used outside of tests.
Now that we have a full CBOR decoder, it can be used for incremental
decoding of indefinite-length byte strings.
This also removes the last use of the vendored cbor2 package from this
module.
Differential Revision: https://phab.mercurial-scm.org/D4433
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 15:02:48 -0700] rev 39411
cborutil: implement sans I/O decoder
The vendored CBOR package decodes by calling read(n) on an object.
There are a number of disadvantages to this:
* Uses blocking I/O. If sufficient data is not available, the decoder
will hang until it is.
* No support for partial reads. If the read(n) returns less data than
requested, the decoder raises an error.
* Requires the use of a file like object. If the original data is in
say a buffer, we need to "cast" it to e.g. a BytesIO to appease the
decoder.
In addition, the vendored CBOR decoder doesn't provide flexibility
that we desire. Specifically:
* It buffers indefinite length bytestrings instead of streaming them.
* It doesn't allow limiting the set of types that can be decoded. This
property is useful when implementing a "hardened" decoder that is
less susceptible to abusive input.
* It doesn't provide sufficient "hook points" and introspection to
institute checks around behavior. These are useful for implementing
a "hardened" decoder.
This all adds up to a reasonable set of justifications for writing our
own decoder.
So, this commit implements our own CBOR decoder.
At the heart of the decoder is a function that decodes a single "item"
from a buffer. This item can be a complete simple value or a special
value, such as "start of array." Using this function, we can build a
decoder that effectively iterates over the stream of decoded items and
builds up higher-level values, such as arrays, maps, sets, and indefinite
length bytestrings. And we can do this without performing I/O in the
decoder itself.
The core of the sans I/O decoder will probably not be used directly.
Instead, it is expected that we'll build utility functions for invoking
the decoder given specific input types. This will allow extreme
flexibility in how data is delivered to the decoder.
I'm pretty happy with the state of the decoder modulo the TODO items
to track wanted features to help with a "hardened" decoder. The one
thing I could be convinced to change is the handling of semantic tags.
Since we only support a single semantic tag (sets), I thought it would
be easier to handle them inline in decodeitem(). This is simpler now.
But if we add support for other semantic tags, it will likely be easier
to move semantic tag handling outside of decodeitem(). But, properly
supporting semantic tags opens up a whole can of worms, as many
semantic tags imply new types. I'm optimistic we won't need these in
Mercurial. But who knows.
I'm also pretty happy with the test coverage. Writing comprehensive
tests for partial decoding did flush out a handful of bugs. One
general improvement to testing would be fuzz testing for partial
decoding. I may implement that later. I also anticipate switching the
wire protocol code to this new decoder will flush out any lingering
bugs.
Differential Revision: https://phab.mercurial-scm.org/D4414
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 15:22:06 -0700] rev 39410
tests: remove use of string in CBOR test
We don't use the CBOR string major type in the wire protocol. Let's
not test for it.
Differential Revision: https://phab.mercurial-scm.org/D4413
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Aug 2018 20:27:36 -0700] rev 39409
internals: document CBOR utilization
I spoke with some people at Mozilla about CBOR and they advised me
that we should be careful about the subset of CBOR we use in order
to mitigate security, performance, and compatibility concerns.
This commit establishes a document that attempts to formalize our
use of CBOR.
Its main limitations are on what types are allowed. It explicitly
enumerates which types are supported. Notable missing features
include:
* Indefinite-length arrays and maps
* Text strings (bytes all the way)
* Floats
* Date/time types
* Big integers
* Use of indefinite-length byte strings for map keys, values in
containers.
If we have a need for any of these, we can have a discussion about
them when the time comes.
Differential Revision: https://phab.mercurial-scm.org/D4412
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 03 Sep 2018 13:56:53 +0300] rev 39408
py3: add new passing test to whitelist found by buildbot
Differential Revision: https://phab.mercurial-scm.org/D4451
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 03 Sep 2018 13:53:30 +0300] rev 39407
py3: alias xrange to range in tests/test-fastannotate-revmap.py
xrange is not available on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4450
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 03 Sep 2018 13:52:49 +0300] rev 39406
py3: add r'' prefix to prevent b'' being prepended
The keys of keyword arguments should be str.
# skip-blame because we are adding just r'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D4449
Sushil khanchi <sushilkhanchi97@gmail.com> [Fri, 31 Aug 2018 23:28:09 +0530] rev 39405
revert: fix the inconsistency of status msgs in --interactive mode
Before this patch we were priting every action msg before actually
performing that action and that was resulting in inconsistencies;
like in --interactive session if user decided to not revert any
changes in a file foo, still there will be a msg on console saying
"reverting foo".
To fix this, I have made some changes to print status msg just
before the action it is going to perform, no matter if --interactive
or not.
Changes made in test-revert-interactive.t reflect the changed behavior.
There are also some changes in test-revert.t because of change in the
order of messages.
Differential Revision: https://phab.mercurial-scm.org/D4380
Sushil khanchi <sushilkhanchi97@gmail.com> [Mon, 03 Sep 2018 10:44:52 +0530] rev 39404
revert: remove unnecessary check as `msg` should never be a callable now
Differential Revision: https://phab.mercurial-scm.org/D4448
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Sep 2018 16:32:11 +0900] rev 39403
run-tests: drop support for --with-python3 and $PYTHON3
This backs out
cdbc25306696. We can run many tests on python3 without
this hack.
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Sep 2018 16:26:33 +0900] rev 39402
test-check-py3-compat: don't run py3 part if not build against python3
This test depends on C extensions built for python3, which aren't available
if run-tests.py runs on python2 and no -l/--local is specified.
Yuya Nishihara <yuya@tcha.org> [Sun, 02 Sep 2018 16:23:34 +0900] rev 39401
test-check-py3-compat: don't run py2 part if $PYTHON is python3
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 01 Sep 2018 18:00:38 -0400] rev 39400
resolve: test that we suggest a valid hg command
Differential Revision: https://phab.mercurial-scm.org/D4447
Anton Shestakov <av6@dwimlabs.net> [Sun, 02 Sep 2018 08:40:57 +0800] rev 39399
bash_completion: complete arguments for --color and --pager
Anton Shestakov <av6@dwimlabs.net> [Sun, 02 Sep 2018 08:39:17 +0800] rev 39398
bash_completion: add more global options that receive an argument
Augie Fackler <augie@google.com> [Sat, 01 Sep 2018 11:33:17 -0400] rev 39397
tracing: ignore any IOErrors when writing to pipe
When the pager forks off the main process, we can end up with the pipe
closed prematurely. Rather than break hg entirely when that happens
and tracing is active, just let lingering events disappear as needed.
Differential Revision: https://phab.mercurial-scm.org/D4445
Augie Fackler <augie@google.com> [Sat, 01 Sep 2018 11:06:47 -0400] rev 39396
tests: avoid shellquoting bytes on Python 3
Should fix Python 3 builder.
Differential Revision: https://phab.mercurial-scm.org/D4444
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sat, 01 Sep 2018 17:37:52 -0400] rev 39395
resolve: ui.config -> ui.configbool, for better validation
Differential Revision: https://phab.mercurial-scm.org/D4446
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Aug 2018 09:12:22 +0800] rev 39394
zsh_completion: handle --rev as well as -r for diff and revert
Completion for hg diff and revert should suggest all files in context of a
non-current revision. The script used to look only for `-r foo`, and now it
also understands `--rev foo`.
Differential Revision: https://phab.mercurial-scm.org/D4427
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 26 Aug 2018 16:42:28 -0400] rev 39393
resolve: add config to make hg resolve not re-merge by default
Before this, calling 'hg resolve' with neither -m, -u or -l will
re-merge. This is highly error prone (it's easy to forget to forget a
-m), and pretty bad when it happens (many people have no idea 'hg
resolve' can re-merge, and end up redoing the work of resolving all
the conflicts, because they have no idea there was a backup of their
work).
Differential Revision: https://phab.mercurial-scm.org/D4379
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 26 Aug 2018 15:52:34 -0400] rev 39392
resolve: add a flag for the default behavior of re-merging
On its own, it's not useful, but the next commit will add an hgrc
config option to make it mandatory.
There is no short option, as -r almost always means --rev and this
option doesn't seem like it would be so common as to mandate a short
option.
Differential Revision: https://phab.mercurial-scm.org/D4378
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 Sep 2018 02:01:55 -0400] rev 39391
tests: conditionalize narrow-widen error output for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Aug 2018 13:09:24 -0400] rev 39390
largefiles: use a context manager to control the progress bar lifetime