Yuya Nishihara <yuya@tcha.org> [Wed, 03 Oct 2018 22:27:45 +0900] rev 40011
help: document about "annotate" template keywords
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 16:34:53 -0700] rev 40010
storageutil: pass nodes into emitrevisions()
The main emitrevisions() uses nodes. So it makes sense to use
nodes for the helper API.
Not bothering with API since this function was introduced a few
commits ago.
Differential Revision: https://phab.mercurial-scm.org/D4805
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 16:16:09 -0700] rev 40009
storageutil: make all callables optional
Not all storage backends may implement these callables. That's part
of the reason these methods aren't exposed on the storage interface.
Differential Revision: https://phab.mercurial-scm.org/D4804
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 16:16:22 -0700] rev 40008
storageutil: extract most of emitrevisions() to standalone function
As part of implementing a storage backend, I found myself copying
most of revlog.emitrevisions(). This code is highly nuanced and it
bothered me greatly to be copying such low-level code.
This commit extracts the bulk of revlog.emitrevisions() into a
new standalone function. In order to make the function generally
usable, all "self" function calls that aren't exposed on the
ifilestorage interface are passed in via callable arguments.
No meaningful behavior should have changed as part of the port.
Upcoming commits will tweak behavior to make the code more
generically usable.
Differential Revision: https://phab.mercurial-scm.org/D4803
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:51:17 -0700] rev 40007
storageutil: invert logic of file data comparison
IMO things make more sense when the function is explicitly a test
for file data equivalence.
Not bothering with API since the function was introduced by the
previous commit.
Differential Revision: https://phab.mercurial-scm.org/D4802
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:47:53 -0700] rev 40006
storageutil: extract filelog.cmp() to a standalone function
As part of implementing an alternate storage backend, I found myself
reimplementing this code.
With a little massaging, we can extract filelog.cmp() to a standalone
function.
As part of this, the call to revlog.cmp() was inlined (it is just a
2-line function).
I also tweaked some variable names to improve readability. I'll
further tweak names in a subsequent commit.
Differential Revision: https://phab.mercurial-scm.org/D4801
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:37:49 -0700] rev 40005
storageutil: extract copy metadata retrieval out of filelog
As part of implementing an alternate storage backend, I found myself
reinventing this wheel.
Let's create a utility function for doing the work.
Differential Revision: https://phab.mercurial-scm.org/D4800
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:29:05 -0700] rev 40004
storageutil: extract functionality for resolving strip revisions
I found myself having to copy this method as part of implementing a new
storage backend. With a little tweaking, we can extract it to a
standalone function so it can be reused easily.
We'll likely want to implement a better method for removing revisions
on the storage interface someday. But until then, let's use what we
have.
Differential Revision: https://phab.mercurial-scm.org/D4799
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:16:44 -0700] rev 40003
storageutil: consistently raise LookupError (API)
The interface docs say this is supposed to raise LookupError on
failure. But for invalid revision number input, it could raise
IndexError because ifileindex.node() is documented to raise
IndexError.
lookup() for files isn't used that much (pretty much just in
basefilectx in core AFAICT). And callers should already be catching
LookupError. So I don't anticipate that much fallout from this
change.
Differential Revision: https://phab.mercurial-scm.org/D4798
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:03:17 -0700] rev 40002
storageutil: implement file identifier resolution method (BC)
revlog.lookup() has a number of advanced features, including partial
node matching.
These advanced features aren't needed for file id lookup because file
identifiers are almost always from internal sources. (An exception to
this is hgweb, which appears to have some code paths that attempt
to resolve a user-supplied string to a node.)
This commit implements a new function for resolving file identifiers
to nodes. It behaves like revlog.lookup() but without the
advanced features.
Tests reveal behavior changes:
* Partial hex nodes are no longer resolved to nodes.
* "-1" now returns nullid instead of raising LookupError.
* "0" on an empty store now raises LookupError instead of returning
nullid.
I'm not sure why "-1" wasn't recognized before. But it seems reasonable
to accept it as a value since integer -1 resolves to nullid.
These changes all seem reasonable to me. And with the exception of
partial hex node matching, we may want to consider changing
revlog.lookup() as well.
Differential Revision: https://phab.mercurial-scm.org/D4797
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 11:00:20 -0700] rev 40001
testing: add more testing for ifileindex.lookup()
The tests demonstrate some... questionable behavior of revlog.lookup().
Differential Revision: https://phab.mercurial-scm.org/D4796
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 10:20:37 -0700] rev 40000
dagop: extract DAG local heads functionality from revlog
As part of implementing an alternate storage backend, I found myself
having to reimplement this function.
The DAG traversal logic is generic and can be factored out into a
standalone function.
We could probably combine this with headrevs(). But I'll leave that
for another time.
Differential Revision: https://phab.mercurial-scm.org/D4795
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 10:03:32 -0700] rev 39999
dagop: extract descendants() from revlog module
This method needs to be implemented in other storage backends and is
generic if we parameterize the functions for retrieving revision
numbers and parent revision numbers.
Let's extract it to dagop so backends don't need to reinvent the
wheel.
I'm not too worried about performance overhead of the extra function
call because I don't expect anyone to be calling descendants() in a
tight loop.
Differential Revision: https://phab.mercurial-scm.org/D4794
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 09:33:05 -0700] rev 39998
filelog: remove checkhash() (API)
It is unused.
While a caller may want to ask the store to validate the hash of some
provided text, since there are no in-core consumers of this method,
let's drop it for now.
Differential Revision: https://phab.mercurial-scm.org/D4793
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 09:28:38 -0700] rev 39997
filelog: remove revdiff() (API)
This proxy method is no longer used.
While it might be useful to query a storage backend for the delta
between any 2 revisions because the store could have a delta cached
and could compute it more efficiently than the caller calling
revision() twice in order to compute a delta, since nothing in core
is using this API now, I feel comfortable nuking it.
Differential Revision: https://phab.mercurial-scm.org/D4792
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 28 Sep 2018 09:46:50 -0700] rev 39996
localrepo: define storage backend in creation options (API)
We add an experimental config option to define the storage backend
for new repositories. By default, it uses "revlogv1," which maps to
the current and only modern supported repository format.
We add a "backend" creation option to control which backend to
use. It defaults to using the value from the config option.
newreporequirements() will now barf if it sees a "backend" value
that isn't "revlogv1." This forces extensions to monkeypatch the
function to handle requirements derivation for custom backends.
In order for this to "just work," we factored out obtaining the
default creation options into its own function and made callers
of newreporequirements() responsible for passing in valid data.
Without this, direct callers of newreporequirements() wouldn't
get the proper results.
Differential Revision: https://phab.mercurial-scm.org/D4791
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 27 Sep 2018 09:23:17 -0700] rev 39995
wireprotov2: derive "required" from presence of default value
If we define a default value for all optional arguments, we no
longer need to explicitly declare whether the argument is required.
Instead, we can derive it from the presence of a default value
callable.
Differential Revision: https://phab.mercurial-scm.org/D4790
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 01 Oct 2018 09:05:40 -0700] rev 39994
localrepo: capture repo interface factory functions as lambas
Previously, the list would hold a reference to the original function
and attempting to wrap the module function via extension wouldn't
result in the wrapped function being called, completely undermining
the expected behavior.
Differential Revision: https://phab.mercurial-scm.org/D4821
Joerg Sonnenberger <joerg@bec.de> [Mon, 14 May 2018 00:43:07 +0200] rev 39993
extensions: new closehead module for closing arbitrary heads
``hg close-head`` allows closing arbitrary heads. It is equivalent to
checking out the given revisions and commit an empty change with
``hg commit --close-branch``.
Differential Revision: https://phab.mercurial-scm.org/D3557
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 02 Oct 2018 13:12:56 -0700] rev 39992
cext: use modern buffer protocol in mpatch_flist()
Differential Revision: https://phab.mercurial-scm.org/D4841
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 02 Oct 2018 13:13:03 -0700] rev 39991
cext: use modern buffer protocol in patches()
PyObject_AsCharBuffer() is part of the "Old Buffer Protocol," which
has been deprecated for years. Let's port away from it.
PyBuffer_GetBuffer() must be paired with PyBuffer_Release(), hence the
added "goto cleanup" in a failure case.
We don't bump the extension version because the API has not changed.
Differential Revision: https://phab.mercurial-scm.org/D4840
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 01 Oct 2018 14:44:27 -0400] rev 39990
identify: when using -T, avoid unnecessary remote bookmarks query
Differential Revision: https://phab.mercurial-scm.org/D4839
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 01 Oct 2018 09:58:42 -0400] rev 39989
identify: only query remote bookmarks if needed
Instead of all the time when operating on a remote repo. This
perf regression was introduced in
15a79ac823e8, in 4.3.
This datahint method returns nothing for -Tjson, -Tpickle, -Tdebug
--config ui.formatdebug=true and --config ui.formatjson, so the
bookmarks won't show up. I don't know what these formatters are for.
plainformatter and templateformatter work properly, and the few other
uses of datahint should have the same kind of problem.
There is further weirdness where "--template '{node}'" is not enough
to avoid querying the bookmarks, you also need to pass --id or -q.
Differential Revision: https://phab.mercurial-scm.org/D4819
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 03 Oct 2018 13:59:19 +0300] rev 39988
py3: whitelist another passing tests caught by buildbot
I this indygreg recent patches made this test pass on Python 3. So thanks to
him!
Differential Revision: https://phab.mercurial-scm.org/D4848
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 03 Oct 2018 13:55:51 +0300] rev 39987
manifest: remove an unused variable caught by pyflakes
Uses of todel were removed in D4843 (
19103e68a698). This patch will make
buildbots green again.
Differential Revision: https://phab.mercurial-scm.org/D4847
Matt Harbison <matt_harbison@yahoo.com> [Tue, 02 Oct 2018 22:40:01 -0400] rev 39986
setup: ignore message about disabling 3rd party extensions because of version
I started getting into a bind recently when switching between py2 and py3
because switching requires a `make clean`, which kills __version__.py. But then
when running `make local`, it picks up the local hg.exe (MSYS seems to prefix
$PATH with '.'), which doesn't know its version. That causes it to emit a
warning about needing at least 4.3 to load evolve, which caused setup.py to fail
saying there is no working hg executable to figure out the version. If we can
ignore general extension import failures, we should be able to ignore this too.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 02 Oct 2018 09:11:18 -0700] rev 39985
narrow: avoid overwriting a variable
I don't like to overwrite variables, especially not with a different
type (because it makes it harder to explain what the variable is for,
and, therefore, to name it well).
Differential Revision: https://phab.mercurial-scm.org/D4846
spectral <spectral@google.com> [Thu, 27 Sep 2018 20:16:48 -0700] rev 39984
treemanifests: remove _loadalllazy in _diff()
The benchmarks below use a similar setup as in
ee7ee0c516ca and my other recent
commits. Yes, in some cases this runs in literally 5% of the time it
previously took.
before =
a6f8ab53
diff --git:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 1.301 s +- 0.004 s | 1.309 s +- 0.012 s | 100.6%
m-u | | x | 1.303 s +- 0.009 s | 1.302 s +- 0.006 s | 99.9%
m-u | x | | 1.308 s +- 0.006 s | 1.309 s +- 0.007 s | 100.1%
m-u | x | x | 85.7 ms +- 0.6 ms | 86.0 ms +- 0.3 ms | 100.4%
l-d-r | | | 197.5 ms +- 0.7 ms | 197.8 ms +- 2.2 ms | 100.2%
l-d-r | | x | 199.4 ms +- 0.6 ms | 199.3 ms +- 0.9 ms | 99.9%
l-d-r | x | | 86.1 ms +- 0.5 ms | 85.8 ms +- 0.9 ms | 99.7%
l-d-r | x | x | 64.4 ms +- 0.4 ms | 64.4 ms +- 0.3 ms | 100.0%
diff -c . --git:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 236.7 ms +- 1.1 ms | 236.5 ms +- 1.3 ms | 99.9%
m-u | | x | 158.7 ms +- 1.0 ms | 128.0 ms +- 1.0 ms | 80.7% <--
m-u | x | | 239.7 ms +- 1.8 ms | 238.1 ms +- 1.5 ms | 99.3%
m-u | x | x | 132.4 ms +- 0.9 ms | 132.3 ms +- 0.6 ms | 99.9%
l-d-r | | | 81.8 ms +- 0.4 ms | 81.8 ms +- 0.3 ms | 100.0%
l-d-r | | x | 3.894 s +- 0.017 s | 193.6 ms +- 0.4 ms | 5.0% <--
l-d-r | x | | 106.9 ms +- 0.4 ms | 106.6 ms +- 0.3 ms | 99.7%
l-d-r | x | x | 182.7 ms +- 0.8 ms | 183.3 ms +- 0.9 ms | 100.3%
rebase -r . --keep -d .^^:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 5.615 s +- 0.109 s | 5.562 s +- 0.015 s | 99.1%
m-u | | x | 5.701 s +- 0.027 s | 5.715 s +- 0.023 s | 100.2%
m-u | x | | 5.572 s +- 0.128 s | 5.613 s +- 0.182 s | 100.7%
m-u | x | x | 633.3 ms +- 28.7 ms | 636.2 ms +- 13.8 ms | 100.5%
l-d-r | | | 666.4 ms +- 17.0 ms | 658.5 ms +- 9.3 ms | 98.8%
l-d-r | | x | 6.520 s +- 0.070 s | 6.505 s +- 0.026 s | 99.8%
l-d-r | x | | 279.0 ms +- 13.0 ms | 276.5 ms +- 4.7 ms | 99.1%
l-d-r | x | x | 1.636 s +- 0.058 s | 1.657 s +- 0.014 s | 101.3%
status --change . --copies:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 218.6 ms +- 1.4 ms | 217.9 ms +- 1.5 ms | 99.7%
m-u | | x | 138.5 ms +- 0.4 ms | 108.4 ms +- 0.2 ms | 78.3% <--
m-u | x | | 220.1 ms +- 1.3 ms | 219.7 ms +- 1.5 ms | 99.8%
m-u | x | x | 113.2 ms +- 0.4 ms | 112.4 ms +- 0.8 ms | 99.3%
l-d-r | | | 80.2 ms +- 0.3 ms | 80.6 ms +- 0.6 ms | 100.5%
l-d-r | | x | 3.899 s +- 0.020 s | 194.8 ms +- 4.0 ms | 5.0% <--
l-d-r | x | | 83.4 ms +- 0.8 ms | 83.2 ms +- 0.2 ms | 99.8%
l-d-r | x | x | 732.2 ms +- 4.3 ms | 194.9 ms +- 1.0 ms | 26.6% <--
status --copies:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 1.917 s +- 0.005 s | 1.914 s +- 0.004 s | 99.8%
m-u | | x | 1.909 s +- 0.012 s | 1.934 s +- 0.004 s | 101.3%
m-u | x | | 1.915 s +- 0.005 s | 1.904 s +- 0.004 s | 99.4%
m-u | x | x | 94.8 ms +- 0.3 ms | 94.7 ms +- 0.2 ms | 99.9%
l-d-r | | | 593.9 ms +- 1.2 ms | 594.6 ms +- 9.4 ms | 100.1%
l-d-r | | x | 595.2 ms +- 3.8 ms | 597.2 ms +- 2.6 ms | 100.3%
l-d-r | x | | 182.5 ms +- 1.6 ms | 182.1 ms +- 0.6 ms | 99.8%
l-d-r | x | x | 149.6 ms +- 0.9 ms | 149.1 ms +- 0.8 ms | 99.7%
update $rev^; ~/src/hg/hg{hg}/hg update $rev:
repo | N | T | before (mean +- stdev) | after (mean +- stdev) | % of before
------+---+---+------------------------+-----------------------+------------
m-u | | | 3.121 s +- 0.007 s | 3.129 s +- 0.012 s | 100.3%
m-u | | x | 2.972 s +- 0.011 s | 2.981 s +- 0.012 s | 100.3%
m-u | x | | 3.144 s +- 0.014 s | 3.141 s +- 0.011 s | 99.9%
m-u | x | x | 312.2 ms +- 2.4 ms | 312.3 ms +- 2.1 ms | 100.0%
l-d-r | | | 444.4 ms +- 4.3 ms | 446.9 ms +- 5.3 ms | 100.6%
l-d-r | | x | 9.159 s +- 0.069 s | 9.182 s +- 0.040 s | 100.3%
l-d-r | x | | 254.6 ms +- 1.6 ms | 255.2 ms +- 1.6 ms | 100.2%
l-d-r | x | x | 1.525 s +- 0.007 s | 1.577 s +- 0.007 s | 103.4% <--?
Differential Revision: https://phab.mercurial-scm.org/D4845
spectral <spectral@google.com> [Tue, 02 Oct 2018 13:41:00 -0700] rev 39983
treemanifests: skip extraneous check for item before calling _loadlazy
Differential Revision: https://phab.mercurial-scm.org/D4844
spectral <spectral@google.com> [Tue, 02 Oct 2018 13:38:26 -0700] rev 39982
treemanifests: make _loadchildrensetlazy just call _loadlazy
This was suggested on the original review for _loadchildrensetlazy (D4370), it's
taken me a while to get to it though.
Differential Revision: https://phab.mercurial-scm.org/D4843
spectral <spectral@google.com> [Tue, 02 Oct 2018 13:37:12 -0700] rev 39981
treemanifests: make _loadlazy tolerate item not on _lazydirs
I'd like to clean up a few cases where we check for an item in _lazydirs before
calling _loadlazy - this will remove an extraneous dict lookup and make it
slightly more versatile.
Differential Revision: https://phab.mercurial-scm.org/D4842
Martin von Zweigbergk <martinvonz@google.com> [Wed, 08 Aug 2018 23:17:16 -0700] rev 39980
debugcommands: add a debugindexstats command
Someone went through the trouble of recording these stats, so let's
make them accessible.
Differential Revision: https://phab.mercurial-scm.org/D4832
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 19:23:50 +0900] rev 39979
rust-chg: add main program
It can at least connect to a *running* command server, and execute Mercurial
command. No signal handling nor daemon management is implemented yet.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 19:06:30 +0900] rev 39978
rust-chg: add interface to chdir the server
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 18:57:54 +0900] rev 39977
rust-chg: add Client extensions to run cHg-specific requests
This just provides a nicer way to issue command-server requests.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 18:33:46 +0900] rev 39976
rust-chg: port basic socket path handling from cHg of C
This is basically modeled after setcmdserveropts() of chg.c.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 18:21:10 +0900] rev 39975
rust-chg: add state machine to handle "runcommand" request with cHg extension
This is modeled after tokio-hglib's RunCommand state to support the "S"
channel message.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 18:18:35 +0900] rev 39974
rust-chg: add callback to handle pager and shell command requests
This could be inlined into the ChgRunCommand state to be introduced by
the next patch, but it seemed good to separate any user interactions from
the IPC code.
Yuya Nishihara <yuya@tcha.org> [Sat, 29 Sep 2018 21:59:07 +0900] rev 39973
rust-chg: add low-level function to set pager fd blocking
This is necessary because the server expects stdout/stderr to be blocking,
whereas we'll use async library to spawn pager, which makes pipes unblocking.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 16:59:12 +0900] rev 39972
rust-chg: add future that handles "attachio" request
This is the sequence to send client-side stdio and pager stdin to the
server.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 16:33:24 +0900] rev 39971
rust-chg: add parser for request messages sent to "S" channel
The data structure is documented at chgserver.py:channeledsystem().
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 16:22:03 +0900] rev 39970
rust-chg: add wrapper around C function
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 16:14:35 +0900] rev 39969
rust-chg: add function to send fds via domain socket
As a beginning, I wrote some C.
It's extracted from attachio() of contrib/chg/hgclient.c. Maybe it could
be rewritten in Rust by using the libc (and/or nix) crates, but doing that
wouldn't be trivial as the code depends on CMSG_*() macros. IMO, using C
is better here.
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 15:57:28 +0900] rev 39968
rust-chg: update dependencies
Yuya Nishihara <yuya@tcha.org> [Mon, 24 Sep 2018 15:54:18 +0900] rev 39967
rust-chg: add project skeleton
This directory will host the reimplementation of cHg in Rust. It will use
Tokio [1], and tokio-hglib [2] which I wrote for an oxidized CHg, no idea
if there's such carbon bonding in nature btw.
[1]: https://tokio.rs/
[2]: https://bitbucket.org/yuja/tokio-hglib/
The reasoning for depending on Tokio is that it will allow us to handle Unix
signals in a safer way. Well, I believed that until I found a weird function,
handlestopsignal(), in cHg codebase. It resends the same signal to the same
process by temporarily masking the handler, which can't be inherently async.
So the signal handlers will stay in C, which means there isn't actually much
reason to write async code right now, other than I've already done most of
the async stuff, and slightly easier pager handling.
The reasoning for the rewrite is that it will eventually be possible to port
server-side config validation back to the client side, which will reduce
the complexity of the current daemon management. It will also encourage us
to write frontend library (e.g. command line and config parsers) in Rust.
The license is GPL2+ because it's likely to include derived work from the
cHg of C. The rust/chg crate is excluded from the root workspace as it's
unclear how the whole rust packages should be laid out. That can be revisited
later.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Sep 2018 12:56:57 -0700] rev 39966
narrow: move copies overrides to core
The copies overrides seems to have been a little complicated just by
not being in core. When moved to core, it becomes trivial (at least I
think these overrides have the same effect).
Differential Revision: https://phab.mercurial-scm.org/D4825
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 18:45:16 +0300] rev 39965
narrow: pass old includes and excludes to _widen()
In future patches we will need to pass them in the widen wireprotocol command
which we are building.
Differential Revision: https://phab.mercurial-scm.org/D4812
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 28 Sep 2018 23:53:09 +0300] rev 39964
narrow: check for servers' narrow support before doing anything (BC)
Recently we introduced narrow capabilities for the server. So we can check
whether a server has narrow clone support or not before doing anything. This is
BC because new clients won't be able to extend from old narrow-enabled servers.
I *think* narrow is not used much (maybe just inside Google), also it's
experimental so I think we can change this. We will need to this someday anyway.
The "doesn't" in error is changed to "does not" because I think that's we do in
core. I also changed one more instance of the error message to use 'does not'
for consistency.
Differential Revision: https://phab.mercurial-scm.org/D4789
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 18:59:27 +0300] rev 39963
narrow: don't do the dirstate dance if ellipses is not enabled
I believe we set dirstate parents to nullid before widening pull because in
ellipses cases, the parent might be stripped off with a new changeset. However
the second ds.setparents() call invalidate my assumption. I am not sure why we
do this. So here is a patch.
This patch also adds tests showing we break nothing in non-ellipses cases.
Differential Revision: https://phab.mercurial-scm.org/D4788
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 28 Sep 2018 19:21:24 +0300] rev 39962
narrow: pass 'narrow_widen' as source while generating changegroup
Extensions inspect the `source` parameter and add some custom logic on the basis
of value of that parameter. The parameter is also passed to hooks. So let's pass
the value as 'narrow_widen' to differentiate widening from pull.
Differential Revision: https://phab.mercurial-scm.org/D4787
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 28 Sep 2018 19:18:17 +0300] rev 39961
narrow: factor out logic to create cg while widening into separate fn
This patch takes out the logic which generates a changegroup for widening a
narrow clone when ellipses are disabled. This is done because future patches
will introduce a narrow_widen() wireprotocol command which will send a
bundle2 with changegroup and will use this function.
The new function for now returns just the changegroup for compatibility with
existing code, but in future patches, when we establish a wireprotocol command
and call this function from there, this will return the required bundle2.
Differential Revision: https://phab.mercurial-scm.org/D4786
Martin von Zweigbergk <martinvonz@google.com> [Mon, 01 Oct 2018 15:29:31 -0700] rev 39960
narrow: avoid looking up dirstate again when editing dirstate
The narrow extension overrides the dirstate editing functions to
restrict paths outside the narrowspec. These overrides access the
dirstate from repo.dirstate instead of using the "self" reference
passed to the overridden functions. I don't see a reason for this and
it caused me problems with a later patch (it caused infinite recursion
when I modified localrepo.dirstate()), so let's change it.
Differential Revision: https://phab.mercurial-scm.org/D4829
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 23:09:28 -0700] rev 39959
repo: move unfiltered-repo optimization to workingctx
localrepo.__getitem__ special-cased lookup of the working copy parent
to avoid looking up obsmarkers. I think the reason for that code
(which I once wrote myself) was to make `hg commit` not load
obsmarkers, which it would otherwise do via ctx.p1() in
localrepo.commitctx().
That had the somewhat unfortunate consequence of making lookup of an
unrelated binary nodeid load the dirstate. Now that changectx's
constructor is dumb, we can let workingctx._parents() have the
opmtimization instead.
This affects two tests, because they no longer end up loading the
dirstate and their "warning: ignoring unknown working parent ..."
messages therefore go way.
Differential Revision: https://phab.mercurial-scm.org/D4828
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 22:53:14 -0700] rev 39958
context: move logic from changectx.__init__ to localrepo.__getitem__ (API)
My motivation for this change was to make repo[node] not load the
dirstate (more about that in the next patch), but I think it makes
more sense this way too. For example, raising RepoLookupError seems to
belong better in the repo lookup function
(i.e. localrepo.__getitem__).
This makes the changectx constructor very simple -- it just assigns
the given repo, revnum, and nodeid to properties.
Differential Revision: https://phab.mercurial-scm.org/D4827
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 22:44:51 -0700] rev 39957
context: reduce dependence of changectx constructor
I want to change the constructor's signature and letting all creation
of changectx instances go through the repo simplifies that.
Differential Revision: https://phab.mercurial-scm.org/D4826
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 01 Oct 2018 23:11:07 -0700] rev 39956
py3: use system strings for HTTP response header comparison
res.headers is holding system strings. Attempting to compare against
bytes always fails and we fail to print decoded CBOR responses on
Python 3.
After this change, various test-wireproto* tests are now properly
printing CBOR response objects.
Differential Revision: https://phab.mercurial-scm.org/D4835
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 01 Oct 2018 23:08:04 -0700] rev 39955
py3: convert HTTP request headers to str
The low-level request object ideally takes system strings for
HTTP request headers and values. If we send in bytes, it works. But
a duplicate header check fails and various tests emit duplicate
user-agent headers.
Differential Revision: https://phab.mercurial-scm.org/D4834
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 01 Oct 2018 23:12:42 -0700] rev 39954
py3: use system strings in HTTP server code
Previously the source transformer was converting some string literals
to bytes and we were comparing a system native string to bytes
and this was leading to sending the wrong HTTP response headers on
Python 3.
After this change, we now properly send Transfer-Encoding and
Connection response headers on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4833
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 01 Oct 2018 23:39:49 -0700] rev 39953
py3: byteify test-storage.py
The test now passed on Python 3.
# skip-blame just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D4836
Pulkit Goyal <pulkit@yandex-team.ru> [Tue, 02 Oct 2018 14:29:56 +0300] rev 39952
narrow: remove narrowpatch instead of narrowcopies
84092edd5c88 removed narrowpatch.py and wanted to drop narrowpatch from
__init__.py but mistakenly removed narrowcopies.
This will make buildbots green again.
Differential Revision: https://phab.mercurial-scm.org/D4837
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 23:26:24 -0400] rev 39951
py3: suppress the output from .write() calls in more tests
I missed these in
803b7569c9ea because I forgot about `...` lines.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 23:07:19 -0400] rev 39950
py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 23:04:58 -0400] rev 39949
lfs: explicitly name a key when sorting blob pointers
This is needed to keep py3 happy. The other two instances of sorting already
did this.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 21:54:00 -0400] rev 39948
py3: byteify test-lock.py
There's still a stacktrace about not being able to serialize _io.TextIOWrapper.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 21:48:45 -0400] rev 39947
py3: byteify contrib/dumprevlog
Matt Harbison <matt_harbison@yahoo.com> [Mon, 01 Oct 2018 19:39:05 -0400] rev 39946
py3: quote $PYTHON in test-merge-symlinks.t
Martin von Zweigbergk <martinvonz@google.com> [Thu, 21 Jun 2018 22:07:34 -0700] rev 39945
copies: inline a variable that's used only once
By inlining it, we also avoid calculating the value when "if of in
seen" is false (probably not significant).
Differential Revision: https://phab.mercurial-scm.org/D4831
Martin von Zweigbergk <martinvonz@google.com> [Sat, 15 Sep 2018 22:56:57 -0700] rev 39944
bundlerepo: remove a variable alias
"parentrepo" and "repo" were the same thing and I don't see much
reason for it (unionrepo has similar structure and a similar alias but
there are two repos there so at least it makes a little more sense
there).
Differential Revision: https://phab.mercurial-scm.org/D4830
Augie Fackler <augie@google.com> [Mon, 01 Oct 2018 16:11:48 -0400] rev 39943
merge with stable
Augie Fackler <raf@durin42.com> [Mon, 01 Oct 2018 16:07:38 -0400] rev 39942
Added signature for changeset
5405cb1a7901
Augie Fackler <raf@durin42.com> [Mon, 01 Oct 2018 16:07:36 -0400] rev 39941
Added tag 4.7.2 for changeset
5405cb1a7901
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 21:23:29 +0900] rev 39940
manifest: fix out-of-bounds read of corrupted manifest entry
Spotted by ASAN.
Yuya Nishihara <yuya@tcha.org> [Wed, 05 Sep 2018 21:32:45 +0900] rev 39939
manifest: rewrite pathlen() to not cross entry boundary
Even though the entire manifest data should be terminated by '\0', it seems
not nice to scan '\0' over the entry terminator, '\n'.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Sep 2018 12:05:48 -0700] rev 39938
narrow: move support for `hg verify` into core
Differential Revision: https://phab.mercurial-scm.org/D4824
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Sep 2018 13:55:17 -0700] rev 39937
narrow: drop unnecessary overrides of patch
The patch overrides became unnecessary when I made context.status()
filter by the narrowspec in
e411774a2e0f (narrow: move
status-filtering to core and to ctx, 2018-08-02).
Differential Revision: https://phab.mercurial-scm.org/D4823
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Sep 2018 00:00:36 -0700] rev 39936
tests: add test showing that paths outside narrowspec are not added
We had a test that shows that trying to explicitly add a file outside
the narrowspec results in an error, but we didn't have a test that
shows that paths from subdirectories outside the narrowspec are not
added (on e.g. `hg add .`) but silently ignored.
Differential Revision: https://phab.mercurial-scm.org/D4822
Augie Fackler <augie@google.com> [Mon, 01 Oct 2018 09:05:41 -0400] rev 39935
catapipe: fix bug introduced when switching to the timer api
Differential Revision: https://phab.mercurial-scm.org/D4818
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 03:45:51 +0530] rev 39934
narrow: move the ellipses server capability to core
This will be used in core logic to determining whether a server is ellipses
enabled or not. And also this will ease moving narrow related things to core.
Differential Revision: https://phab.mercurial-scm.org/D4809
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 03:42:35 +0530] rev 39933
narrow: move the wireprotocol narrow capability name to core
We are trying to integrate the whole of narrow logic into core and it will be
helpful for upcoming patches to have these capability names in core. The next
patch will move the ellipses capability to core also.
The exact motivation is to know whether we are cloning a ellipses repo or not
and adding an ellipses repo requirement.
Differential Revision: https://phab.mercurial-scm.org/D4808
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Sep 2018 16:11:35 +0900] rev 39932
help: document about "files" template keywords
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Sep 2018 15:53:36 +0900] rev 39931
formatter: remove experimental marker from -T option
I think it's good enough to stabilize the feature, at least for the core
and non-experimental commands.
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Sep 2018 15:37:09 +0900] rev 39930
grep: rename {line_number} to {lineno} as well (BC)
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Sep 2018 15:35:17 +0900] rev 39929
annotate: rename {line_number} to {lineno} (BC)
I think {lineno} looks more like a common template keyword. It isn't called
a {line} to avoid conflicts with the element name of {lines} and the
{_|splitlines} filter.
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary
Yuya Nishihara <yuya@tcha.org> [Sun, 30 Sep 2018 15:15:27 +0900] rev 39928
resolve: rename {status} to {mergestatus} to not shadow change status (BC)
This is a part of the name unification. I think it's somewhat useful to
provide a combined view of change/merge statuses.
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary
Augie Fackler <augie@google.com> [Mon, 01 Oct 2018 09:06:01 -0400] rev 39927
py3: whitelist one additional test
Differential Revision: https://phab.mercurial-scm.org/D4817
Boris Feld <boris.feld@octobus.net> [Fri, 03 Nov 2017 21:11:07 +0100] rev 39926
logtoprocess: connect all fds to /dev/null to avoid bad interaction with pager
We detected that pager is waiting for log-to-process script to finish, which
is annoying when adding a script on commandfinish that does an HTTP push.
There seems to be no workaround on the script side and it will make the
behavior on Linux/MacOS closer to the Windows behavior.
The drawback is that it makes the related tests more flaky as log-to-process
outputs are now really asynchronous.
If it's considered a BC change, another option would be to add a config option
for this new behavior. I personally think that the different behavior between
Windows and Linux is confusing and that it's a bug I would be fine with a new
config option.
Differential Revision: https://phab.mercurial-scm.org/D4816
Boris Feld <boris.feld@octobus.net> [Fri, 03 Nov 2017 21:35:36 +0100] rev 39925
logtoprocess: add a test to show pager and ltp bad interaction
The next changeset will fix the bad interaction between the pager and log-to-
process. Add a test first to make the next changeset easier to understand.
Differential Revision: https://phab.mercurial-scm.org/D4815
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 21:13:16 +0300] rev 39924
py3: add one more passing test to whitelist caught by buildbot
Thanks to Matt Harbison who fixed the remaining failures of this test.
Differential Revision: https://phab.mercurial-scm.org/D4814
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 12:06:32 +0200] rev 39923
cleanupnodes: pass multiple predecessors to `createmarkers` directly
Boris Feld <boris.feld@octobus.net> [Sat, 22 Sep 2018 14:40:33 +0200] rev 39922
obsolete: allow multiple predecessors in createmarkers
The logic for this change is similar to the change to `cleanupnodes` that we
did earlier. Now that the rebase code is trying to record a fold, we need to
actually record it in the markers. The first step is to have the markers
creation API able to receive such fold data.
To keep things sane, we restrict fold to on successors.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 21:03:09 +0200] rev 39921
obsolete: preindent code in createmarkers
This will help to make the next change clearer.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 23:37:43 +0200] rev 39920
obsolete: explicitly pass relation items to effectflag computation
To track folds, we are about to change the content of `rel`. To simplify this
change, we update the `geteffectflag` function beforehand.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 22:45:44 +0200] rev 39919
rebase: explicitly track collapses as fold
A collapse is a large fold. It is now explicitly tracked (at the cleanupnodes
API level).
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 23:51:11 +0200] rev 39918
rebase: use tuple as `replacement` keys
Now that `cleanupnodes` support tuples as key, we update the rebase code to use
them. No changes in the replacement tracked are introduced yet.
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 00:15:21 +0200] rev 39917
rebase: expand a long "one-liner"
When a one-liner gets 3 lines longs, it lose its expressivity benefits. We
expand it into a simple for loop. This makes future changes of the code in
that area clearer.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 21:28:21 +0200] rev 39916
cleanupnodes: drop special casing around prune markers (API)
The `cleanupnodes` has logic to skip the creation of "prune" markers if the
changeset is already obsolete. This feels strange and gets in the way of code
changes to tracks folds. Now that callers no longer request such prune, we can
drop this logic.
In many cases, pruning through cleanupnodes should be replaced by internal
phase usage.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 22:05:28 +0200] rev 39915
rebase: don't try to prune obsolete changeset already in the destination
With similar motivations to the previous changesets, we stop marking changeset
from pruning when it is not the command intention. In this case, we still need
to distinguish between the strip and the obsolete case.
Boris Feld <boris.feld@octobus.net> [Wed, 26 Sep 2018 21:51:29 +0200] rev 39914
histedit: don't cleanup nodes already disposed of
If something else took care of these temporary nodes, we don't need to do
anything about it. This less liberal usage of pruning through cleanup nodes
will help us further cleanup on the road to explicitly tracks folds.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 30 Sep 2018 01:15:46 -0400] rev 39913
py3: avoid b'' output in test-hgweb-non-interactive.t
I couldn't figure out how to get the list to print without b'' with
pycompat.write(), without converted each element to str.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 30 Sep 2018 01:10:41 -0400] rev 39912
py3: convert print to a function call in a few tests
I *think* this is the last of them.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 29 Sep 2018 23:52:00 -0400] rev 39911
py3: use util.forcebytestr() to convert push lock error to bytes
Matt Harbison <matt_harbison@yahoo.com> [Sat, 29 Sep 2018 20:57:49 -0400] rev 39910
py3: byteify windows.shelltocmdexe()
This makes test-doctest.py happy on Windows.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 29 Sep 2018 20:33:52 -0400] rev 39909
run-tests: flush output stream before prompting to accept changes
With py3 on Windows, the prompt to accept changes in an --interactive run wasn't
showing up until after the choice was read from stdin.
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 30 Sep 2018 05:52:42 +0530] rev 39908
py3: use util.forcebytestr() to convert error messages to bytes
This makes the python 3 buildbot green again.
Differential Revision: https://phab.mercurial-scm.org/D4811
Martin von Zweigbergk <martinvonz@google.com> [Thu, 27 Sep 2018 14:26:02 -0700] rev 39907
context: stop catching TypeError when converting hex nodeid to binary
It has been a programming error to pass a 40-character string that is
not a hex nodeid since
8b86acc7aa64 (context: drop support for looking
up context by ambiguous changeid (API), 2018-04-28), so we can just
let it raise a TypeError.
Differential Revision: https://phab.mercurial-scm.org/D4807
Martin von Zweigbergk <martinvonz@google.com> [Thu, 27 Sep 2018 09:56:13 -0700] rev 39906
context: stop catching and re-raising FilteredRepoLookupError
FilteredRepoLookupError is only raised by changectx's constructor and
the higher-level scmutil.revsymbol(), so there's no need to catch it
in changectx's constructor.
Differential Revision: https://phab.mercurial-scm.org/D4806
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Sep 2018 22:18:45 -0400] rev 39905
util: use a context manager in readlock()
Matt Harbison <matt_harbison@yahoo.com> [Tue, 25 Sep 2018 21:16:12 -0400] rev 39904
py3: convert os.readlink() path to native strings on Windows
Windows insisted that it needs to be str. I skipped the stuff in the posix
module, and left `tests/f` and `run-tests.py` alone for now.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 29 Sep 2018 02:02:35 -0400] rev 39903
py3: suppress the output from .write() calls in the remaining tests
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Sep 2018 23:17:06 -0400] rev 39902
py3: conditionalize json float precision difference in test-debugcommands.t
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Sep 2018 22:39:18 -0400] rev 39901
py3: byteify extension in test-debugcommands.t
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 16:55:06 +0200] rev 39900
pullreport: rev duplicated and extinct into account
If we already have some obsolete and hidden nodes locally and the server send
them again to you, it seems useful to point it out instead of being silent about
it.
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 16:52:25 +0200] rev 39899
pullreport: issue a message about "extinct" pulled changesets
Changeset pulled from a remote repository while already obsolete locally can
end up hidden after the pull. Hiding obsolete changesets is a good behavior
but silently "skipping" some of the pulled content can get confusing.
We now detect this situation and emit a message about it. The message is
simple and the wording could be improved, however, we focus on the detection
here. Evolution is still an experimental feature, so the output is open to
changes.
In particular, we could point out at the latest successors of the obsolete
changesets, however, it can get tricky is there are many of them. So we delay
these improvements to another adventure.
Another easy improvement would be to merge this message with the previous line
about the new nodes and their phases.
This is a good example of cases where we can only transmit a limited amount of
data to users by default. We need some sort of "transaction journal" we could
point the user to.
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 17:00:00 +0200] rev 39898
pullreport: skip or rework some early return
We are about to add more logic in this report. Before that, we need it to not
quit so early.
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 16:35:10 +0200] rev 39897
pullreport: skip filtered revs instead of obsolete ones
Obsolescence is closely related to visibility but still a distinct concept. We
can receive changesets that are obsolete but visible (eg: when pulling
orphans). Such changeset should be reported too. In addition, the filtering
level can be anything, we should respect it.
Boris Feld <boris.feld@octobus.net> [Thu, 27 Sep 2018 18:06:13 +0200] rev 39896
pullreport: add a test to show misreporting of visible changeset
The current code ignores all obsolete changesets including the visible one. We
add a test showing this behavior before fixing the behavior.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 10:38:37 -0700] rev 39895
repo: don't look up context for tip node if it's not needed
We were doing repo['tip'].node() or similar in a few places where
repo.changelog.tip() would be enough.
Differential Revision: https://phab.mercurial-scm.org/D4781
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 22:17:34 -0700] rev 39894
repo: look up nullrev context by revnum, not symbolic name
I think lookup of the 'null' symbol should be done via
scmutil.revsymbol() and repo['null'] is only supported for historical
reasons. However, repo[nullrev] is fine, so we can switch to that
instead of switching to scmutil.revsymbol('null').
Differential Revision: https://phab.mercurial-scm.org/D4780
Martin von Zweigbergk <martinvonz@google.com> [Wed, 26 Sep 2018 22:17:26 -0700] rev 39893
bundle: consistently put revnums in "base" collection
The "base" collection contains revnums, except that it can also
contain the "null" symbol. That's a little weird. Let's be consistent.
Differential Revision: https://phab.mercurial-scm.org/D4779
Matt Harbison <matt_harbison@yahoo.com> [Thu, 27 Sep 2018 22:07:12 -0400] rev 39892
py3: ensure printing to stdout uses str in test-hgweb-no-request-uri.t