- Dec 03, 2018
-
-
Georges Racinet authored
This changeset introduces the hg-cpython crate, that compiles as a shared library holding a whole Python package (mercurial.rustext), with only the empty 'ancestor' submodule for now. Such bindings will be easier and safer to develop and maintain that those of `hg-direct-ffi`. They don't involve C code, only unsafe Rust that's mostly isolated within the cpython crate. The long-term goal would be to import the provided modules, such as rustext.ancestor with mercurial.policy.importmod, same as we already do with cext modules. Differential Revision: https://phab.mercurial-scm.org/D5434
-
Georges Racinet authored
hgcli uses a specific rust-cpython commit by indygreg, of which a PR has been derived which is not merged nor released yet. But we can't use several versions of the sys-python2.7 crate in a single workspace: it makes for a build error. Since hgcli does not at the time being need anything from hg-core, whereas the upcoming hg-cpython will. So for now we're moving hgcli aside, hoping we could base all of them on the same version of rust-cpython again in the future. Differential Revision: https://phab.mercurial-scm.org/D5433
-
- Dec 14, 2018
-
-
Boris Feld authored
For unclear reasons, some repositories include nullrev (-1). Re-computing delta for such repo remove nullrev from all chain, so some older versions have been creating them. This currently raise an IndexError with the new C code doing chain slicing as it expect all item to be positive. Both python and C code for reading delta chain preserve nullrev, and the Python code for chain slicing handle the case fine. So we take the safe route and make the new C code works fine in that case.
-
Boris Feld authored
The more generic index_get method handle nullrev fine, we apply the same logic here.
-
Boris Feld authored
The more generic index_get method handle nullrev fine, we apply the same logic here.
-
Boris Feld authored
The value is important enough to be explicitly tracked.
-
- Nov 29, 2018
-
-
Georges Racinet authored
This is as direct as possible a translation of the ancestor.missingancestors Python class in pure Rust. The goal for this changeset is to make it easy to compare with the Python version. We also add to Python tests the cases that helped us develop and debug this implementation. Some possible optimizations are marked along the way as TODO comments Differential Revision: https://phab.mercurial-scm.org/D5416
-
- Dec 14, 2018
-
-
Paul Morelle authored
We have been using this script to look into the result of various runs of the `hg perfrevlogwrite` command. It seems useful enough to be shared more widely.
-
- Dec 06, 2018
-
-
Boris Feld authored
When picking a potential candidate, we filter them on various criteria. The "different from nullrev" criteria is very fast to compute and we should process it first.
-
Boris Feld authored
Since the delta chain length is limited to 1000 revisions, we get a new snapshot about every 1000 revisions. If we assume that the snapshot will be most of the slowest revision, the current display (99% and max) are not very precise in their area. We now include more information about this space in the default report.
-
- Dec 14, 2018
-
-
Martin von Zweigbergk authored
This should make it much more discoverable (we document it in `hg help flags`, but most users don't think to look there). Note that flags that default to None (and not False) will not get this new presentation. We can change the defaults to False later for flags where it makes sense (probably almost all boolean flags). Differential Revision: https://phab.mercurial-scm.org/D5432
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D5431
-
Martin von Zweigbergk authored
"True" feels like a Python thing and not something that users should see. Differential Revision: https://phab.mercurial-scm.org/D5430
-
Martin von Zweigbergk authored
It should be okay to write "topic: change 'default: True' to 'default: on'". Differential Revision: https://phab.mercurial-scm.org/D5429
-
Danny Hooper authored
Differential Revision: https://phab.mercurial-scm.org/D5428
-
Pulkit Goyal authored
This makes the test pass on Python 3. # skip-blame because just b'' prefix. Differential Revision: https://phab.mercurial-scm.org/D5427
-
Augie Fackler authored
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 authored
# skip-blame just two more b prefixes Differential Revision: https://phab.mercurial-scm.org/D5425
-
Augie Fackler authored
Fixes doctests on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5423
-
Pulkit Goyal authored
This makes the test pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5422
-
Pulkit Goyal authored
# 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 authored
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 authored
Differential Revision: https://phab.mercurial-scm.org/D5419
-
Yuya Nishihara authored
Python 3.7 starts complaining about it. We have to double the backslash or '\x5c' to get around.
-
- Dec 13, 2018
-
-
Georges Racinet authored
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
-
Augie Fackler authored
-
- Dec 12, 2018
-
-
Yuya Nishihara authored
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 authored
This can be used to extract an issue number from a commit message, for example: {search(r'\(issue([0-9]*)\)', desc) % '{1}'}
-
- Nov 29, 2018
-
-
Georges Racinet authored
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
-
- Dec 11, 2018
-
-
Georges Racinet authored
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
-
- Dec 13, 2018
-
-
Anton Shestakov authored
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 authored
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?
-
- Dec 11, 2018
-
-
Georges Racinet authored
Now AncestorsIterator iters on Result<Revision, GraphError>
-
- Dec 12, 2018
-
-
Matt Harbison authored
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.
-
- Dec 11, 2018
-
-
Yuya Nishihara authored
To be align with 443eb4bc41af "rust: propagate error of index_get_parents() properly." Spotted by Georges Racinet.
-
- Dec 12, 2018
-
-
Julien Cristau authored
https://github.com/python/cpython/pull/2825 changed the exception message for empty http status line. Differential Revision: https://phab.mercurial-scm.org/D5412
-
- Dec 10, 2018
-
-
Gregory Szorc authored
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 authored
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 authored
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 authored
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
-