Yuya Nishihara <yuya@tcha.org> [Sat, 01 Sep 2018 10:40:48 +0900] rev 39386
fastannotate: use stringutil.pprint() to dump diffopts to be hashed
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Sep 2018 10:23:13 +0900] rev 39385
test-check-py3-compat: update "python3 check-py3-compat.py" output
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Sep 2018 10:13:48 +0900] rev 39384
test-check-py3-compat: exclude thirdparty and cffi which are known to fail
Otherwise the following errors would be spilled out:
mercurial/cffi/bdiff.py: error importing: <ImportError> cannot import
name '_bdiff' (error at bdiff.py:*)
mercurial/cffi/bdiffbuild.py: error importing: <ModuleNotFoundError> No
module named 'cffi' (error at bdiffbuild.py:*)
mercurial/cffi/mpatch.py: error importing: <ImportError> cannot import
name '_mpatch' (error at mpatch.py:*)
mercurial/cffi/mpatchbuild.py: error importing: <ModuleNotFoundError> No
module named 'cffi' (error at mpatchbuild.py:*)
mercurial/cffi/osutilbuild.py: error importing: <ModuleNotFoundError> No
module named 'cffi' (error at osutilbuild.py:*)
mercurial/thirdparty/concurrent/futures/_base.py: invalid syntax: invalid
syntax (<unknown>, line *)
mercurial/thirdparty/concurrent/futures/process.py: error importing:
<SyntaxError> invalid syntax (_base.py, line 416) (error at __init__.py:*)
mercurial/thirdparty/concurrent/futures/thread.py: error importing:
<SyntaxError> invalid syntax (_base.py, line 416) (error at __init__.py:*)
mercurial/thirdparty/zope/interface/_flatten.py: error importing:
<ImportError> cannot import name 'Declaration' (error at _flatten.py:*)
Some of them can be suppressed by building cffi modules for example, but
I don't think it's worth keeping these modules covered by the compatibility
checker.
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Sep 2018 10:18:38 +0900] rev 39383
test-check-py3-compat: remove false output from "python3 check-py3-compat.py"
If python3 were python2, these errors would be reported, but we're running
check-py3-compat.py on Python 3 here.
Boris Feld <boris.feld@octobus.net> [Wed, 01 Aug 2018 08:52:55 +0200] rev 39382
test: add a test file that displays ssh behavior in front of various errors
Prior to changeset
ac0a87160012, these errors were suboptimal since they claim
the repository is missing while the actual issue was about permission.
This extra test file provides additional documented coverage for the various
corner cases.
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 01 Sep 2018 00:40:26 +0530] rev 39381
tests: update test-casefolding.t with recent changes
This is caught by the mac-buildbot. This was not found initially because this
test requires a case insensitive filesystem.
I have edited the test file by hand and I suggest to test this on such a system
before pushing.
Differential Revision: https://phab.mercurial-scm.org/D4430
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 01 Sep 2018 02:16:22 +0530] rev 39380
py3: don't use dict.iterkeys() in hgext/fastannotate/context.py
dict.iterkeys() is not present on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D4431
Matt Harbison <matt_harbison@yahoo.com> [Wed, 29 Aug 2018 23:39:58 -0400] rev 39379
run-tests: replace '/dev/null' with os.devnull for Windows
Many of the *.py tests were dying on:
File "c:\Users\Matt\projects\hg\hgdemandimport\tracing.py", line 27, in log
_pipe = open(os.environ['HGCATAPULTSERVERPIPE'], 'w', 1)
IOError: [Errno 2] $ENOENT$: '/dev/null'
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 09:13:58 -0700] rev 39378
stringutil: teach pprint() to indent
This will make data structure dumping in various places a bit
easier to read and diff. Since I wanted this for `hg debugwireproto`
output, I added indentation to it.
A more advanced pretty printer implementation would conditionally
add newlines if output is too long. But it is vastly simpler to
be consistent and always add newlines when indenting.
Again, I'm not crazy about the verbosity of the code and there is
room to consolidate logic for "print a collection." But this isn't
the most complicated code in the world and I'm not convinced it is
worth doing.
Differential Revision: https://phab.mercurial-scm.org/D4399
Anton Shestakov <av6@dwimlabs.net> [Wed, 22 Aug 2018 08:20:51 +0800] rev 39377
zsh_completion: complete merge tools for -t/--tool
Differential Revision: https://phab.mercurial-scm.org/D4362
Boris Feld <boris.feld@octobus.net> [Wed, 06 Jun 2018 01:46:37 +0200] rev 39376
shelve: add an "internal" extra
Keeping shelve changeset around increase the risk of collision with normal
changesets. To prevent such collision and help with overall clarity, we add an
'internal' key in extra that mark the changeset as created by "shelve".
Node changes in tests are expected.
Boris Feld <boris.feld@octobus.net> [Wed, 06 Jun 2018 01:10:01 +0200] rev 39375
shelve: write metadata file on the fly if they are missing
Keeping an explicit reference to the shelve node in order to reuse it directly
if the unshelved is repeated (eg: unshelve --keep).
Boris Feld <boris.feld@octobus.net> [Wed, 06 Jun 2018 00:57:22 +0200] rev 39374
shelve: look for shelved node in the repository before unbundling
This prepares the version of shelve that would not strip the shelved node from
the repository. If we have the node information, search for it in the
repository and only fallback on unbundling if it is missing.
To be able to find such nodes, we operate on an unfiltered repository.
Boris Feld <boris.feld@octobus.net> [Wed, 06 Jun 2018 01:03:10 +0200] rev 39373
shelve: handle shelved node on unfiltered repository
To build a version of shelve that use hiding instead of stripping, we need
shelve to be able to find these revisions. This it does not hurt the bundle
version, so we introduce the necessary code in the relevant place.
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 11:47:32 +0200] rev 39372
shelve: store shelved node in a new data file
It is useful for a version of shelve not based on bundle and strip. Having
more data does not hurt the bundle based case so we introduce it in all cases
before doing more rework.
We also keep storing the patch using another method.
note: We could have this metadata file list all the file involved in the
shelve and use that for cleanup. This would be more future proof than having a
hard-coded list of file to purge. However, this is an adventure for another
series.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 16:33:30 +0900] rev 39371
templatekw: add {path} keyword to host documentation
It's hidden since I'm not sure if filectx templates can be a thing. The plan
is to add {status}, {size}, etc., which are usable within {files % ...}
context.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 16:51:25 +0900] rev 39370
status: rename {copy} to {source} for compatibility with {file_copies} (BC)
.. bc::
``{copy}`` in status command template is renamed to ``{source}``.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 16:44:16 +0900] rev 39369
formatter: rename {abspath}/{file} to {path}, and drop relative {path} (BC)
Note that {path} in status is either relative-to-cwd or repository-absolute
depending on the command argument and config knob, which can't be reproduced
by using the {path|relpath} filter. The default template is updated to always
use a relative path.
.. bc::
``{abspath}`` and ``{file}`` in generic templates are renamed to ``{path}``.
Any ``{path}`` is a repository-absolute path. Use ``{path|relpath}`` to
convert it to a filesystem path.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 16:27:09 +0900] rev 39368
templatekw: alias {name} of file copies dict to {path}
For the same reason as the previous patch. We might want some hack to
support {source.path}, {source.rev}, etc., but that's a different issue.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 16:14:18 +0900] rev 39367
templatekw: alias {file} of files list to {path}
This is a part of the name unification. All {path}s will be changed to
repository-absolute (i.e. canonical) paths.
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 29 Aug 2018 18:52:09 +0300] rev 39366
copies: improve logic of deciding copytracing on based of config options
Few months ago or maybe a year ago, I imported Fb's heuristics based copytracing
algorithms. While importing that, I renamed `experimental.disablecopytrace` with
`experimental.copytrace` and the behavior of the new config option was like
this:
* "heuristics" : Fb's heuristic copytracing algorithm
* "off" : copytracing is turned off
* something else: copytracing is on
This is the behavior right now also and this is bad because it hardcodes the
string 'off' to turn off the copytracing. On big repositories, copytracing is
very slow and people wants to turn copytracing off. However if the user sets it
to 'False', 'Off', '0', none of them is going to disbale copytracing while they
should.
I lacked the understanding of why this can be bad when I coded it.
After this patch, the new behavior of the config option will be:
* "heuristics": Fb's heuristic copytracing algorithm
* '0', 'false', 'off', 'never', 'no', 'NO', all the values which
repo.ui.configbool() evaluates to False: copytracing in turned off
* something else: copytracing is on
Since 'off' still evaluates to copytracing being turned off, this is not BC.
Also the config option is experimental.
Differential Revision: https://phab.mercurial-scm.org/D4416
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 30 Aug 2018 13:29:03 +0300] rev 39365
relnotes: enable extension when running releasenotes command
Last night, when I was working on different machine, the test worked, now on a
different machine it does not. Looks like we should make sure releasenotes
extension is loaded.
Differential Revision: https://phab.mercurial-scm.org/D4425
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 30 Aug 2018 13:11:15 +0300] rev 39364
narrow: rename getbundlechangegrouppart_nonellipsis function
The function is renamed to getbundlechangegrouppart_widen as per suggestion in
D4383. The motivation is such that we can evolve the function into a handler for
new wire-protocol command.
Differential Revision: https://phab.mercurial-scm.org/D4424
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 30 Aug 2018 13:05:59 +0300] rev 39363
tests: rename test-narrow-widen-non-ellipsis to match current names
The test is renamed to test-narrow-widen-no-ellipsis (note non -> no), to match
with test-narrow-clone-no-ellipsis.t.
Follows up on D4382.
Differential Revision: https://phab.mercurial-scm.org/D4423
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 29 Aug 2018 20:38:38 +0300] rev 39362
contrib: byteify perf.py file
This is done using contrib/byteify-strings.py. There is just one extra change
done to make sure lines don't get longer than 80 chars.
# skip-blame because just b'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D4422
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Aug 2018 16:57:18 -0700] rev 39361
tests: use {rev} instead of {node|short} and (glob) in narrow tests
I think we used {node|short} because they were first written for only
flat manifests and we didn't think to change the format when we
started testing tree manifests.
Differential Revision: https://phab.mercurial-scm.org/D4421
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Aug 2018 15:49:11 -0700] rev 39360
shortest: fix an off-by-1 when disambiguating against revnums
Revision "5" is an unambiguous hex prefix in a repo with 5 revisions;
it's only "4" and lower that are ambiguous.
Differential Revision: https://phab.mercurial-scm.org/D4420
Matt Harbison <matt_harbison@yahoo.com> [Wed, 29 Aug 2018 22:53:44 -0400] rev 39359
filemerge: fix an i18n comment typo
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 14:08:18 +0300] rev 39358
tests: add flat manifest case in test-narrow-widen-non-ellipsis.t
We had this test with tree manifest only because the tests were broken and we
were fixing them and maintaing two different cases of broken tests was bit hard.
Now that things work fine, let's add the flat manifest case.
The test shows that things work fine in both cases.
Differential Revision: https://phab.mercurial-scm.org/D4385
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 14:02:48 +0300] rev 39357
narrow: update the narrowspecs to new ones after pulling when widening
The ellipsis case updates the new narrowspecs at bundle2 handling code, and
non-ellipsis widening didn't use to work and never set the new narrowpats.
Previous pacth added server side logic for widening without ellipsis. This patch
adds the missing repo.setnarrowpats() so that we set the new narrowpats after
widening in non-ellipsis cases also.
This makes widening with non-ellipsis case work but there are certain things
which we can improve.
Differential Revision: https://phab.mercurial-scm.org/D4384
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 26 Aug 2018 20:20:34 +0300] rev 39356
narrow: add server logic to send cg while widening without ellipsis
Before this patch, if you try to widen a narrow clone without ellipsis enabled,
it will be broken and the exchange.pull() done by tracked command to widen the
clone will be no-op because no custom logic exists for this and server sees that
we have all csets and it says `no changes found`.
The widening with ellipsis send KILL for existing changegroups and send new
changegroups because of the change in ellipsis hash, but we can prevent that in
non-ellipsis cases.
This patch adds server side logic to send the changegroups for the changesets
which are on the client again with filelogs and manifests for the new includes.
This is a very starting implementation and we send changegroups and manifests
too while we can prevent them.
Following things can definitely be improved in the logic this patch adds:
1) Send just the filelogs and treemanifests
2) Send the filelogs only for the additions in the include
I tried 1) here but the code is coupled tightly and the way I was able to do
that was hacking into the changegroup generation code in a very dirty way, like
adding conditionals and preventing the yield.
This patch also adds a 'widen' kwarg to prevent other commands except widening
to go through that codepath.
The test changes demonstrate that the new implementation is correct and fixes
things.
Differential Revision: https://phab.mercurial-scm.org/D4383
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 13:30:08 +0300] rev 39355
tests: add test to show widening is broken without ellipsis
This patch adds a test to show that widening a narrow clone is broken if
ellipsis is disabled.
I don't think I can add cases to existing test-narrow-widen.t and check-in a
failing version of that. So I created a copy. Once the test is fixed, we can
merge this new test file back into the original one using testcases.
Also, this is just testing treemanifest case because having two cases and both
or are failing with different outputs is a bit hard to manage.
This is important because upcoming patches will try to fix the broken part.
Differential Revision: https://phab.mercurial-scm.org/D4382
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 09:05:56 -0700] rev 39354
stringutil: emit multiple chunks when pretty printing
This avoids concatenating output inside pprintgen() itself. But
the real reason for this is it will make it easier to add
indentation, as we'll need to account for indentation when emitting
each individual object in a collection.
The verbosity of this code compared to the original is a bit
unfortunate. But I suppose this is the price to pay for having
nice things (streaming and indenting).
We could probably abstract the "print a collection" bits into a
generic function to avoid some duplication. But I'm not
overly inclined to do this.
Differential Revision: https://phab.mercurial-scm.org/D4398
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 09:02:39 -0700] rev 39353
stringutil: refactor core of pprint so it emits chunks
This commit splits the core of pprint() to a new function that is
a generator of chunks instead of a function returning a single
value. This will make it possible to stream output without waiting for
all data to be formatted first. And it will make it easier to
implement support for indenting.
Differential Revision: https://phab.mercurial-scm.org/D4397
Augie Fackler <augie@google.com> [Wed, 25 Jul 2018 13:28:36 -0400] rev 39352
contrib: import the relnotes script from the release-tools repo
I figure this makes more sense to keep in the main repo, as it's a
guide of sorts on how to use the releasenotes extension in the
presence of commits that don't get relnotes annotations.
Ported to Python 3, cleaned up some logic in a few places, but for the
most part it's what we've been using for years.
Differential Revision: https://phab.mercurial-scm.org/D4291
Augie Fackler <augie@google.com> [Wed, 25 Jul 2018 13:45:28 -0400] rev 39351
hghave: move from requiring the PYTHON3 env var to looking for `python3`
We're starting to write new utility scripts in Python 3, and I think
it's reasonable to expect `python3` to be something we should use if
it's present. I wrote the regex to specifically ban Python 3 prior to
Python 3.5 because we won't ever support that.
I moved the only test that was using $PYTHON3 to just using `python3`
directly.
Differential Revision: https://phab.mercurial-scm.org/D4290
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Aug 2018 09:59:08 -0700] rev 39350
rename: return error status if any rename/copy failed
Ever since
447ea621e50e (copy: propagate errors properly, 2007-12-06),
we have returned an error status if the source file did not
exist. That commit did not return error status for any other errors,
and it's unclear if that was on purpose or not. It seems to me like we
should return an error in the other cases to, so that's what this
patch does.
Differential Revision: https://phab.mercurial-scm.org/D4419
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Aug 2018 09:54:50 -0700] rev 39349
rename: emit hint about using --after consistently
Both the code and the message for the case where the source file was
missing was inconsistent with the other similar messages.
Differential Revision: https://phab.mercurial-scm.org/D4418
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Aug 2018 09:50:39 -0700] rev 39348
rename: quote hg commands in warnings
I think we usally use single quotes around hg commands in messages.
Differential Revision: https://phab.mercurial-scm.org/D4417
Anton Shestakov <av6@dwimlabs.net> [Tue, 21 Aug 2018 21:05:01 +0800] rev 39347
zsh_completion: complete hg files
Differential Revision: https://phab.mercurial-scm.org/D4361
Anton Shestakov <av6@dwimlabs.net> [Tue, 21 Aug 2018 14:49:02 +0800] rev 39346
zsh_completion: adjust usage of common options
addremove, remove and serve accept -S/--subrepos, and purge actually doesn't.
qnew accepts -I/--include and -X/--exclude.
qrefresh accepts -D/--currentdate, -U/--currentuser, -d/--date and -u/--user.
rebase accepts -n/--dry-run.
Differential Revision: https://phab.mercurial-scm.org/D4360
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 26 Aug 2018 15:23:03 -0400] rev 39345
resolve: make condition clearer, and able to handle a new flag
Differential Revision: https://phab.mercurial-scm.org/D4377
Boris Feld <boris.feld@octobus.net> [Wed, 06 Jun 2018 00:48:24 +0200] rev 39344
shelve: drop mention of obsshelve file
Core shelve extension does not use obsolescence, we clean up this unused file
before adding a new info file.
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 11:40:40 +0200] rev 39343
shelve: rename method for data write/read
There are no user of this code nor any code related to obsshelve in the
extensions right now, so we rename the function before using them.
Note: The shelvedfile looks a bit strange. We should probably refactor it,
however, this is an adventure for another series.
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 00:51:38 +0200] rev 39342
shelve: move createcmd next to _docreatecmd
It is simpler not to have to jump around the file all the time.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 13:34:04 +0900] rev 39341
minirst: filter blocks by full path to section
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 13:34:58 +0900] rev 39340
minirst: mark getsections() as an internal helper
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 12:42:10 +0900] rev 39339
help: rewrite parsing of help topic to not drop section name with dots
A subtopic is no longer lowercased since it should be considered a part of
a topic path, not a section filter.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 12:48:02 +0900] rev 39338
test-help: add tests showing that sections can't be filtered by dotted name
Boris Feld <boris.feld@octobus.net> [Sat, 18 Aug 2018 08:41:36 +0200] rev 39337
revlogdeltas: move finddeltainfo filtering inside _candidategroups
Now all "simple" filtering logic is gathered in one place. The `finddeltainfo`
method is more straightforward and the `_candidate_groups` function knows more
about filtering revisions before we compute a delta against them.
Boris Feld <boris.feld@octobus.net> [Wed, 29 Aug 2018 09:55:11 -0700] rev 39336
revlogdeltas: split candidate groups selection from the filtering logic
The group iteration has two main components:
* walking candidates, the logic that we are about to extend to build
intermediate snapshots,
* Making sure we test diffs against interesting bases. No duplicated tests,
skipping empty revisions, etc.
We split `_candidategroups` to separate the two components. This achieves two
goals:
* It will be simpler to update the walking logic for intermediate snapshots,
* We can gather the filtering logic from `finddeltainfo` into
`_candidategroups` to centralize it.
Boris Feld <boris.feld@octobus.net> [Sat, 18 Aug 2018 07:32:05 +0200] rev 39335
revlogdeltas: pass revision number to _candidatesgroups
The `_candidates_groups` logic works on revisions, so the nodes are currently
just converted to revs at the top of the function. It seems cleaner to instead
pass revision numbers to the function.
Having this conversion out of the way will help for further cleanups.
Boris Feld <boris.feld@octobus.net> [Sat, 18 Aug 2018 07:27:34 +0200] rev 39334
revlogdeltas: extract _getcandidaterevs in a function
The logic barely uses the object it is attached to. This is an important
function that we will clean up in the coming changesets. Moving it at the top
level helps us with that cleanup.
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 04:38:57 +0200] rev 39333
revlogdeltas: always return a delta info object in finddeltainfo
Previously, the method returned `None` when a full snapshot was needed. The
caller had to determine how to produce one itself.
In practice, building a `_deltainfo` object for a full snapshot is simple. So
we build it at the `finddeltainfo` level and always return a `_deltainfo`
object.
The caller can now simply process the `_deltainfo` return in all cases.
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 04:20:34 +0200] rev 39332
revlogdeltas: move special cases around raw revisions in finddeltainfo
The method already contains logic for no-diff cases. Having everything in the
same place is more consistent and unlocks other code improvements.
Boris Feld <boris.feld@octobus.net> [Wed, 29 Aug 2018 09:41:04 -0700] rev 39331
revlogdeltas: extra fulltext building in its own function
The process of building a full text from a delta is complex enough to deserve
isolation. The previous function mixed cache management and computation, we
now have clearer boundaries and simpler functions/methods.
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 02:53:42 +0200] rev 39330
revlog: split functionality related to deltas computation in a new module
The revlog module is getting big and this logic is getting more and more
advanced. Moving it to `mercurial.revlogutils.deltas` split a lot off
revlog.py and will help this logic to become less interleaved with revlog.
The code is simply moved without modification (but for namespace changes).
Refactoring and improvement will be made in later changesets.
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 02:08:13 +0200] rev 39329
revlog: split constants into a new `revlogutils.constants` module
We want to split some logic out of the main revlog file (the delta computing
logic). However, this logic needs access to multiple constants related to the
revlog. So we move all revlog related constants into a new module that could
be imported from multiple places.
We don't copy the file (preserving blame history) because there are only a few
moving lines. Also, copying the file would result in annoying merge conflicts
with ongoing work from others contributors.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Jul 2018 12:11:20 -0700] rev 39328
rebase: skip extinct revisions even if it has no successor in rebase set
Differential Revision: https://phab.mercurial-scm.org/D4408
Martin von Zweigbergk <martinvonz@google.com> [Wed, 11 Jul 2018 12:26:44 -0700] rev 39327
tests: add test showing that rebase of extinct commit with successor fails
As the test case shows, attempting to rebase a commit that has a
successor that is not in the rebase set and not in the destination
currently fails because it "will cause divergences". However, it
doesn't seem like there's any harm in skipping the extinct commit. I
suspect this case missed simply because extinct revisions are usually
hidden.
Differential Revision: https://phab.mercurial-scm.org/D4407
Martin von Zweigbergk <martinvonz@google.com> [Mon, 27 Aug 2018 10:44:43 -0700] rev 39326
tests: add log output after stripping for context for next test
It's not obvious what the repo state will be after stripping some
nodes and obsmarkers, so let's include the log output to make it
easier to follow the test case that comes after.
Differential Revision: https://phab.mercurial-scm.org/D4406
Martin von Zweigbergk <martinvonz@google.com> [Tue, 28 Aug 2018 15:09:18 -0700] rev 39325
obsutil: make sure "addedmarkers" is not None in getobsoleted()
Similar reasoning as in
52e6171ec822 (obsutil: make sure "addedrevs"
is not None in getobsoleted(), 2018-08-25).
Differential Revision: https://phab.mercurial-scm.org/D4411
Martin von Zweigbergk <martinvonz@google.com> [Tue, 28 Aug 2018 13:29:47 -0700] rev 39324
revsetlang: fix position of '-' in spaceless 'a-b' expressions
I don't know if there is an observable difference, but it seems like
an obvious fix.
Differential Revision: https://phab.mercurial-scm.org/D4410
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 23:05:23 +0000] rev 39323
tests: mark manifestfulltextcache as conditional on revlog store
This file is currently specific to the revlog store. Other stores
may not implement it. Mark it as such in test output.
Differential Revision: https://phab.mercurial-scm.org/D4395
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 20:23:45 +0000] rev 39322
manifest: use fulltextcache instead of _fulltextcache
fulltextcache is part of the documented interface and is aliased
to _fulltextcache.
Differential Revision: https://phab.mercurial-scm.org/D4394
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 19:58:06 +0000] rev 39321
manifest: rename manifestlog._revlog to _rootstore
Because it may not be a revlog.
Differential Revision: https://phab.mercurial-scm.org/D4393
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 19:53:02 +0000] rev 39320
manifest: use public API for obtaining storage object
We should not be accessing private attributes on the manifestlog,
since its behavior is governed by an interface.
Differential Revision: https://phab.mercurial-scm.org/D4392
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 08:58:25 -0700] rev 39319
perf: add function for obtaining manifest revision
This will use the modern API if available or fall back to the
legacy direct revlog access case. Without this, the perf command
won't work on all code bases.
Differential Revision: https://phab.mercurial-scm.org/D4391
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 19:45:39 +0000] rev 39318
perf: use storage API for resolving manifest node
lookup() isn't part of the storage API. And this code shouldn't
be accessing manifestlog._revlog directly for the modern code base.
So let's port it to the modern API.
Note that the previous code was busted for cases where we needed
to call lookup() because lookup() isn't exposed by manifestrevlog
any more.
This change is strictly BC breaking because we no longer support
resolving partial nodes. But it is a perf* command and I don't
think we should flag the change as such.
Differential Revision: https://phab.mercurial-scm.org/D4390
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 08:52:33 -0700] rev 39317
manifest: change terminology for storage in context classes
Storage may not be backed by revlogs. So it is wrong to refer
to storage as "revlog" or use abbreviations like "rl."
This commit replaces revlog terminology in manifest context classes
and starts referring to things as "store" or "storage."
Differential Revision: https://phab.mercurial-scm.org/D4389
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 08:55:24 -0700] rev 39316
manifest: don't go through revlog to access node symbols
The revlog module re-exports some node.* symbols courtesy of
importing them. Let's access the node.* symbols via our local
import.
Differential Revision: https://phab.mercurial-scm.org/D4388
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 15 Aug 2018 16:50:44 +0000] rev 39315
manifest: make tree a public attribute
changegroup generation accesses this attribute. We should make it
public and expose it on the interface.
Differential Revision: https://phab.mercurial-scm.org/D4387
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 27 Aug 2018 10:15:15 -0700] rev 39314
manifest: proxy to revlog instance instead of inheriting
Previously, manifestrevlog inherited revlog.revlog and therefore
exposed all its APIs. This inevitably resulted in consumers calling
low-level revlog APIs.
As part of abstracting storage, we want to formalize the interface
for manifest storage. The revlog API is much too large to define as
the interface.
Like we did for filelog, this commit divorces the manifest class
from revlog so that we can standardize on a smaller API surface.
The way I went about this commit was I broke the inheritance, ran
tests, and added proxies until all tests passed. Like filelog, there
are a handful of attributes that don't belong on the interface.
And like filelog, we'll tease these out in the future.
As part of this, we formalize an interface for manifest storage and
add checks that manifestrevlog conforms to the interface.
Adding proxies will introduce some overhead due to extra attribute
lookups and function calls. On the mozilla-unified repository:
$ hg verify
before: real 627.220 secs (user 525.870+0.000 sys 18.800+0.000)
after: real 628.930 secs (user 532.050+0.000 sys 18.320+0.000)
$ hg serve (for a clone)
before: user 223.580+0.000 sys 14.270+0.000
after: user 227.720+0.000 sys 13.920+0.000
$ hg clone
before: user 506.390+0.000 sys 29.720+0.000
after: user 513.080+0.000 sys 28.280+0.000
There appears to be some overhead here. But it appears to be 1-2%.
I think that is an appropriate price to pay for storage abstraction,
which will eventually let us have much nicer things. If the overhead
is noticed in other operations (whose CPU time isn't likely dwarfed by
fulltext resolution) or if we want to cut down on the overhead, we
could dynamically build up a type whose methods are effectively
aliased to a revlog instance's. I'm inclined to punt on that problem
for now. We may have to do it for the changelog. At which point it
could be implemented in a generic way and ported to filelog and
manifestrevlog easily enough I would think.
.. api:: manifest.manifestrevlog no longer inherits from revlog
The manifestrevlog class now wraps a revlog instance instead of
inheriting from revlog. Various attributes and methods on instances
are no longer available.
Differential Revision: https://phab.mercurial-scm.org/D4386
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Sun, 26 Aug 2018 13:09:35 -0400] rev 39313
pager: do not enable when TERM=dumb
Before this, running hg in emacs' M-x shell started `less`, which
would complain about the terminal not being fully functional.
Differential Revision: https://phab.mercurial-scm.org/D4376
Yuya Nishihara <yuya@tcha.org> [Wed, 22 Aug 2018 20:52:36 +0900] rev 39312
localrepo: do not cache auditor/nofsauditor which would make reference cycle
Before, self.auditor and self.nofsauditor held self through self._checknested,
and the following code couldn't free a repo by ref-counting.
def main():
repo = localrepo.localrepository(uimod.ui(), '../testrepos/hello')
main()
With this change, the cache of the nofsauditor is limited to a single match
session. I think that's okay as the nofsauditor doesn't do any filesystem
access. Alternatively, maybe we can remove the callback from nofsauditor
since it isn't used unless realfs=True, but I have no idea whether it is
a bug or not.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 13:13:06 +0900] rev 39311
minirst: remove unused function decorateblocks()
It was added at
ee6988aea74e "minirst: add decorateblocks search helper",
but it's been unused since then.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 12:11:19 +0900] rev 39310
minirst: make format() simply return a formatted text
It's a source of bugs to change the type of the return value conditionally.
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 12:20:43 +0900] rev 39309
help: reorder section filtering flow to not format help text twice
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 12:06:07 +0900] rev 39308
help: inline minirst.format()
I'm going to make minirst.format() always returns a formatted text, not
text | (text, pruned).
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 11:43:05 +0900] rev 39307
minirst: extract function that formats parsed blocks as plain text
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 11:39:52 +0900] rev 39306
minirst: unindent "if True" block in filtersections()
Yuya Nishihara <yuya@tcha.org> [Sun, 05 Aug 2018 11:38:56 +0900] rev 39305
minirst: extract function that filters parsed blocks by section name
I'll move some bits from minirst.format() to caller to make the function
interface simpler.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Aug 2018 20:19:27 +0900] rev 39304
bookmarks: adjust exception type so present(bookmark(.)) works as expected
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Aug 2018 20:16:28 +0900] rev 39303
revset: expand bookmark(.) to the active bookmark
We do that in several places. I'm not pretty sure if "literal:." should be
expanded or not, so it's disabled for now.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Aug 2018 15:33:15 +0900] rev 39302
pycompat: remove membershiprange which is no longer used
Backed out changeset
45e05d39d9ce
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Aug 2018 15:28:48 +0900] rev 39301
transaction: remember original len(repo) instead of tracking added revs (API)
It's silly to keep updating xrange(len(changelog), len(changelog) + 1) for
each added revision. Instead, let's simply remember the first revision to
be added.
The test output slightly changed as the branch cache is also warmed up by
stream clone, which seems more consistent.
.. api::
``tr.changes['revs']`` is replaced by ``tr.changes['origrepolen']`` which
is the first revision number to be added.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Aug 2018 15:19:43 +0900] rev 39300
obsutil: make sure "addedrevs" is not None in getobsoleted()
If it were None, "rev in addedrevs" would crash. So tr.changes["revs"]
should be a mandatory parameter here.
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 18:13:19 +0200] rev 39299
phases: enforce internal phase support
We should not use the internal phase for repository without the requirement.
Otherwise, older clients could have a look at the repository and see the
internal changesets.
For now, we introduce a low-level Programming error, more UI friendly error
will be introduced later.
Boris Feld <boris.feld@octobus.net> [Thu, 24 May 2018 09:59:10 +0200] rev 39298
phases: add a repository requirement about internal phase
For internal changeset to be properly hidden, the client version needs to
support it. So we introduce a new repository requirement that will make sure
clients touching a repository that uses internal phase supports the feature.
Boris Feld <boris.feld@octobus.net> [Sat, 25 Aug 2018 01:19:48 +0200] rev 39297
phases: add an internal phases
The phase is meant to be used for internal commit that are a byproduct of
command operation (eg:shelve).
This changeset focus on getting the most important feature in, more advanced
API is to be introduced in later changesets.
The phase approach to handle internal has multiple advantages:
* simple to implement, reuse optimized code,
* fits well with existing phases. We don't want internal changeset to be
exchanged or served.
* easy to extend to for lifecycle handling.
More thinking about internal changeset at https://www.mercurial-scm.org/wiki/InternalsPlan
We add this new phases with a high number to leave some room to possible other
phases. We also try out playing with the idea of "flag" for phases, each flag
would convey a distinct meaning. We can drop the flag idea in the future
(keeping the existing numbers). The flag property should still move in a
monotonic direction (enabled -> disabled) or be immutable like the "internal"
flag.
To simplify the addition of this new phase, we introduce many placeholder
phases. They are not meant to be used for now. Keeping `allphases` as a list
ensure existing algorithm works fine.
The full performance impact of adding that many hollow phases is unclear so
far. The impact on phase computation is visible but not worrisome.
Runnin `hg perfphase` in my mercurial development repository.
Before: ! wall 0.001807 comb 0.000000 user 0.000000 sys 0.000000 (median of 1597)
after: ! wall 0.001906 comb 0.000000 user 0.000000 sys 0.000000 (median of 1521)
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 22 Aug 2018 11:58:36 -0700] rev 39296
stringutil: teach pprint() to recognize generators
Otherwise they get serialized as e.g.
<generator object X at 0x
7f543d3d68c0>
Differential Revision: https://phab.mercurial-scm.org/D4396
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 27 Aug 2018 16:03:00 -0400] rev 39295
commitextras: no need to special case extras=[]
Differential Revision: https://phab.mercurial-scm.org/D4405
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Mon, 27 Aug 2018 16:01:55 -0400] rev 39294
commitextras: work nicely with other extensions
Before this change, it doesn't add these extra fields when loaded
alongside another extension that does a bunch of things, including
wrapping commit.
I did not investigate exactly why, but
- the documentation of extensions.wrapfunction says to use subclassing
to play nicely with other extensions
- using subclassing does make commitextras work when loaded alongside
my other extension
Differential Revision: https://phab.mercurial-scm.org/D4404
Boris Feld <boris.feld@octobus.net> [Sat, 25 Aug 2018 11:20:13 +0200] rev 39293
phases: simplify revset in updatephases
(Pointed by Yuya Nishihara)
Anton Shestakov <av6@dwimlabs.net> [Tue, 28 Aug 2018 00:32:10 +0800] rev 39292
context: use new names for unstable changesets in docstrings
Plus slight corrections.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 08:45:18 -0700] rev 39291
index: embed nodetree in index object to avoid reference cycle
Since the index has a reference to a nodetree and the nodetree has a
reference back to the index, there is a reference cycle, so the index
(and its nodetree) can never be freed. This patch fixes that by making
"nodetree" a plan C struct that the index can embed, and also
introduces a new "nodetreeObject" that is a Python type wrapping the
nodetree struct.
Thanks to Yuya for noticing this and for suggesting the solution.
All tests passed on the first attempt once it compiled (I guess C is
like Haskell in this regard?).
Differential Revision: https://phab.mercurial-scm.org/D4372
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 20:45:52 +0300] rev 39290
catapipe: make the file executable
This silences test-check-execute.t.
Differential Revision: https://phab.mercurial-scm.org/D4403
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 20:41:31 +0300] rev 39289
run-tests: fix the remaining failure of test-run-tests.py
Looks like durin42 misindented this. This makes test-run-tests.py passes but I
cannot reason why.
Differential Revision: https://phab.mercurial-scm.org/D4402
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 27 Aug 2018 20:39:32 +0300] rev 39288
run-tests: don't append rtendtracing logs if pipe is /dev/null
If HGCATAPULTSERVERPIPE is not set, we set it to /dev/null, so we need to make
sure the value is not /dev/null before appending logs.
This fixes some of test-run-tests.t failures.
Differential Revision: https://phab.mercurial-scm.org/D4401
Sushil khanchi <sushilkhanchi97@gmail.com> [Mon, 27 Aug 2018 04:31:09 +0530] rev 39287
cmdutil: fix typo in revert()
Differential Revision: https://phab.mercurial-scm.org/D4381
Kyle Lippincott <spectral@google.com> [Thu, 23 Aug 2018 13:33:19 -0700] rev 39286
log: respect graphshorten on terminal nodes (collapsing o-~ to just o~)
Internally we have a custom template that's inspired by ones that we have seen
in the community. Normally, this looks something like:
o
0834ec17 spectral tip
| crecord: support x to toggle single, X to toggle a range
o
ee932990 spectral @
| filemerge: allow specifying $hgeditor as merge-tools.X.executable
@
66f04611 matt_harbison
| cext: fix truncation warnings in revlog on Windows
o
42cc76d0 matt_harbison
| cext: fix revlog compiler error on Windows
~
o
bd63ada7 stable boris
| phases: drop dead code in `newheads`
~
With graphshorten on, and the descriptions of the public nodes hidden, it looks
like this, note that the commits right before the ~ are still "full height":
o
0834ec17 spectral tip
| crecord: support x to toggle single, X to toggle a range
o
ee932990 spectral @
| filemerge: allow specifying $hgeditor as merge-tools.X.executable
@
66f04611 matt_harbison
o
42cc76d0 matt_harbison
|
~
o
bd63ada7 stable boris
|
~
This patch makes them look like this, removing the | but keeping the ~:
o
0834ec17 spectral tip
| crecord: support x to toggle single, X to toggle a range
o
ee932990 spectral @
| filemerge: allow specifying $hgeditor as merge-tools.X.executable
@
66f04611 matt_harbison
o
42cc76d0 matt_harbison
~
o
bd63ada7 stable boris
~
This originally removed the ~s entirely, but this was determined to be too much
information loss and potentially confusing. This would have looked like the
following (note that the last commit is on a different branch than all of the
ones above it, and they are *not* linearly related):
o
0834ec17 spectral tip
| crecord: support x to toggle single, X to toggle a range
o
ee932990 spectral @
| filemerge: allow specifying $hgeditor as merge-tools.X.executable
@
66f04611 matt_harbison
o
42cc76d0 matt_harbison
o
bd63ada7 stable boris
Differential Revision: https://phab.mercurial-scm.org/D4363
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 26 Aug 2018 19:14:26 +0300] rev 39285
filemerge: fix the wrong placements of messages in prompt
Mistakenly, the local-changed-other-deleted-message was put in
other-change-local-deleted and vice versa. This followups on D4336.
Thanks to Yuya who spotted this.
Differential Revision: https://phab.mercurial-scm.org/D4375
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 25 Aug 2018 21:17:34 +0300] rev 39284
filemerge: print the filename in quotes in prompt
This is better as the filename is in quotes and user can understand better what
the filename is and what is important part in the prompt.
Differential Revision: https://phab.mercurial-scm.org/D4373
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Aug 2018 17:00:32 +0000] rev 39283
filelog: remove proxies to revlog
These proxy attributes and methods were added to facilitate various
debug* and perf* commands. Now that cmdutil.openrevlog() returns
an actual revlog, we no longer need these on the filelog class.
There's probably a few other attributes that could be removed. But
this feels like a worthy start.
Differential Revision: https://phab.mercurial-scm.org/D4359
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 21 Aug 2018 00:01:54 +0000] rev 39282
debugcommands: introduce debugrevlogindex (BC)
`hg debugindex` was originally invented for displaying revlog index
data and is highly tailored towards that. e.g. it accepts a --format
option to display index data for a particular revlog version and
displays things like offset and length.
As we support non-revlog storage, it makes sense for `hg debugindex`
to display generic index data and for there to exist storage-specific
or storage-aware debug* commands for dumping non-generic index data.
This commit effectively renames `hg debugindex` to
`hg debugrevlogindex` and replaces `hg debugindex` with a version that
is storage agnostic.
Tests using --format have been updated to use `hg debugrevlogindex`.
Output is backwards compatible. The replacement command uses the
formatter, which means output can be templatized.
At some point, we may want to tweak output (e.g. to add the revision
size). But I don't feel like taking a bigger BC break at the moment.
The renamed command/function had to be moved because check-code
enforces alphabetical ordering of commands in this file.
Differential Revision: https://phab.mercurial-scm.org/D4358
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 23:08:57 +0000] rev 39281
debugcommands: use openstorage() in debugdata (BC)
Nothing we're doing here requires a revlog. So use openstorage().
.. bc::
`hg debugdata` no longer accepts the path to a revlog file.
Differential Revision: https://phab.mercurial-scm.org/D4357
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 23:06:47 +0000] rev 39280
tests: use inline Python for revlog test
`hg debugdata` will soon stop accepting the raw path to a revlog file.
Adjust a test accordingly.
The changed test is for a security bug. So this should be reviewed
with scrutiny.
Differential Revision: https://phab.mercurial-scm.org/D4356
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 20 Aug 2018 21:01:05 +0000] rev 39279
debugcommands: use openstorage() in debugindexdot
And add test coverage for changelog and manifests.
Differential Revision: https://phab.mercurial-scm.org/D4355
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 14 Aug 2018 16:28:21 +0000] rev 39278
cmdutil: return a revlog from openrevlog() and split function
The filelog class is a wrapper around a revlog instance. I have plans
to give manifests and the changelog a similar treatment.
When filelog was ported away from revlog and when I started writing
patches to do the same for manifests, I noticed that a lot of
debug* and perf* commands were relying on low-level revlog APIs
like start(), end(), deltaparent(), etc. For filelog, I added these
to the interface, even though I didn't want to because they don't
belong on a generic storage interface.
For manifest (and eventually changelog), the pain is too much to bear.
We need to cut the tight coupling.
These debug* and perf* commands use cmdutil.openrevlog() to obtain
a revlog instance.
This commit effectively renames openrevlog() to openstorage(), adds
an argument to ensure a revlog instance is returned, and introduces a
replacement openrevlog() that calls openstorage() such that a revlog
instance is returned.
By doing things this way, we allow the debug* and perf* commands to
still work on revlog-based repositories without having to expose
low-level revlog APIs in the storage interfaces.
The practical side-effect of this on the current code base is we return
a revlog instance instead of a filelog. The manifest and changelog are
not affected at this time.
Some of filelog's storage APIs are different from revlog. For example,
read() strips the optional header containing copy/rename metadata. This
may impact some perf* commands. But I don't think the impact is
worth worrying about.
Upcoming commits will port existing consumers to openstorage(), where
appropriate.
This commit does cause some test regressions when using the simple
store. These will be fixed as commands are ported to use storage APIs.
.. api:: cmdutil.openrevlog() now returns a revlog instance or aborts
Previously, it would return a storage object, which may not be a
revlog instance.
Use the new cmdutil.openstorage() API to return an object conforming
to the storage interface of the thing you are accessing if you don't
need a revlog instance.
Differential Revision: https://phab.mercurial-scm.org/D4354
Augie Fackler <augie@google.com> [Mon, 20 Aug 2018 13:29:48 -0400] rev 39277
merge: improve interactive one-changed one-deleted message (
issue5550)
I like the wording from the bug, so I figured I'd package it up in a
change and see what people think.
Differential Revision: https://phab.mercurial-scm.org/D4336
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 17:19:27 +0200] rev 39276
bookmark: add an --active flag to display the active bookmark
There is currently no official simple way to retrieve the current bookmark. In
particular for automation.
We add a `--active` flag to the `hg bookmarks` command. When set, the command
display the current bookmark name if any or return 1.
For now, this flag is read-only. However sensible combinations exist with
`--delete`, `--rename` and `--rev` and can be implemented later.
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:48:39 +0200] rev 39275
phase: use `_phase` revset instead of string interpolation
The previous code was hackyer and assume all phases had an associated revset.
The later might no longer be true once we introduce more internal phase.
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:48:26 +0200] rev 39274
phase: expose a `_phase(idx)` revset
Internally phase related revset are calling the `_phase` function. We expose
it as an internal revset. This is useful to refer to phase in revset doing
debatable things around the phase name.
Boris Feld <boris.feld@octobus.net> [Thu, 23 Aug 2018 01:15:19 +0200] rev 39273
phase: handle phase with no command flag
Before this changeset, all existing phases have a corresponding flag on the `hg
phase` command. (eg: `hg phase --draft`).
After this changeset, a phase can exists without having an associated flag.
This is useful to introduce a new internal phase that we do not want to expose
to user.
Boris Feld <boris.feld@octobus.net> [Tue, 05 Jun 2018 20:47:52 +0200] rev 39272
phase: explicitly exclude secret phase and above
The comment explicitly mention the secret phase so we should as well use that in
the code.
Boris Feld <boris.feld@octobus.net> [Tue, 05 Jun 2018 18:16:07 +0200] rev 39271
phase: use `trackedphases` in `_getphaserevsnative`
Instead of manually listing secret and draft, simply use the `trackedphases`
constant. The constant is already used by `_getphaserevsnative`.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 24 Aug 2018 17:45:46 -0400] rev 39270
lfs: add a progress bar when searching for blobs to upload
The search itself can take an extreme amount of time if there are a lot of
revisions involved. I've got a local repo that took 6 minutes to push 1850
commits, and 60% of that time was spent here (there are ~70K files):
\ 58.1% wrapper.py: extractpointers line 297: pointers = extractpointers(...
| 57.7% wrapper.py: pointersfromctx line 352: for p in pointersfromctx(ct...
| 57.4% wrapper.py: pointerfromctx line 397: p = pointerfromctx(ctx, f, ...
\ 38.7% context.py: __contains__ line 368: if f not in ctx:
| 38.7% util.py: __get__ line 82: return key in self._manifest
| 38.7% context.py: _manifest line 1416: result = self.func(obj)
| 38.7% manifest.py: read line 472: return self._manifestctx.re...
\ 25.6% revlog.py: revision line 1562: text = rl.revision(self._node)
\ 12.8% revlog.py: _chunks line 2217: bins = self._chunks(chain, ...
| 12.0% revlog.py: decompressline 2112: ladd(decomp(buffer(data, ch...
\ 7.8% revlog.py: checkhash line 2232: self.checkhash(text, node, ...
| 7.8% revlog.py: hash line 2315: if node != self.hash(text, ...
| 7.8% revlog.py: hash line 2242: return hash(text, p1, p2)
\ 12.0% manifest.py: __init__ line 1565: self._data = manifestdict(t...
\ 16.8% context.py: filenode line 378: if not _islfs(fctx.filelog(...
| 15.7% util.py: __get__ line 706: return self._filelog
| 14.8% context.py: _filelog line 1416: result = self.func(obj)
| 14.8% localrepo.py: file line 629: return self._repo.file(self...
| 14.8% filelog.py: __init__ line 1134: return filelog.filelog(self...
| 14.5% revlog.py: __init__ line 24: censorable=True)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:37:56 +0900] rev 39269
i18n: merge i18n comments of translatable texts correctly
Before this patch, i18n comments of translatable texts are lost at
creation of hg.pot file, if:
- same translatable text appears multiple times,
- the 1st appearance does not have i18n comment, and
- any of rest has it
For example, previous patch for filemerge.py adds translatable texts
with i18n comments, but these comments are lost, because:
- automatically added texts in docstring of internal merge tools are
picked up earlier than these translatable texts, because of
location in filemerge.py
- but docstring has no i18n comment
This patch makes addentry() of posplit merge i18n comments of later
translatable texts, in order to keep them at creation of hg.pot.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:22:59 +0900] rev 39268
help: revise explanation about capability check while selecting merge tool
This is follow up of
7c6044634957 and
cded904f7acc.
This patch adds explanations about:
- notation in capability columns in the table
- how capabilities of external merge tools are treated
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 14:08:27 +0900] rev 39267
filemerge: avoid putting translated text into docstring
This is follow up of my mistake in
e09fad982ef5.
There is no merge tool, which has only one of binary or symlink
capabilities, but this patch lists up all combinations of them for
safety in the future. Maybe, it is too paranoid, though.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 22 Aug 2018 13:57:01 +0900] rev 39266
filemerge: make capability check for internal tools ignore merge-tools section
This is follow up of
4d7b11877dd0.
Before this patch, capability check of internal merge tools falls back
to _toolbool(), which examines configurations in "merge-tools" section.
But "hg help config" explicitly says that "merge-tools" section
configures external merge tools.
Therefore, this patch makes capability check for internal tools in
hascapability() always ignore configurations in merge-tools section.
In this patch, command line configurations below are added at tests in
tests/test-merge-tools.t, in order to confirm that explicit
configuration is intentionally ignored at tool selection.
--config merge-tools.:INTERNAL_TOOL.CAPABILITY=true
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 22:21:04 -0700] rev 39265
merge with stable
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 24 Aug 2018 18:21:55 -0700] rev 39264
scmutil: avoid quadratic membership testing (
issue5969)
tr.changes['revs'] is an xrange, which has an O(n) __contains__
implementation. The `rev not in newrevs` lookup a few lines below
will therefore be O(n^2) if all incoming changesets are public.
This issue isn't present on @ because
45e05d39d9ce introduced
a custom type implementing an xrange primitive with O(1) contains
and switched tr.changes['revs'] to be an instance of that type.
We work around the problem on the stable branch by casting the
xrange to a set. This is a bit hacky because it requires allocating
memory to hold each integer in the range. But we are already
holding the full set of pulled revision numbers in memory
multiple times (such as in `tr.changes['phases']`). So this is
a relatively minor problem.
This issue has been present since the phases reporting code was
introduced in the 4.7 cycle by
eb9835014d20.
This change should be reverted/ignored when stable is merged into
default.
On the mozilla-unified repository with 483492 changesets, `hg clone`
time improves substantially:
before: 1843.700s user; 29.810s sys
after: 461.170s user; 29.360s sys
Kyle Lippincott <spectral@google.com> [Wed, 15 Aug 2018 14:41:27 -0700] rev 39263
copies: correctly skip directories that have already been considered
Previously, `if dsrc in invalid` would never be true, since we added
`dsrc +"/"` to invalid, not `dsrc` itself. Since it's much more common for
individual files (not whole directories) to be moved, it seemed cleaner to
delay appending the "/" until we know we have some directory moves to
actually consider.
I haven't benchmarked this, but I imagine this is a mild performance win.
Differential Revision: https://phab.mercurial-scm.org/D4284
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Aug 2018 12:55:05 -0700] rev 39262
merge with stable
Kyle Lippincott <spectral@google.com> [Fri, 24 Aug 2018 10:19:31 -0700] rev 39261
match: make exactmatcher.visitchildrenset return file children as well
Previously, if we had an exactmatcher like ['foo.txt', 'a/bar.txt', 'a/b/c/baz.txt'], we'd
get back the following data:
'.': {'a'}
'a': {'b'}
'a/b': {'c'}
'a/b/c': 'this'
'a/b/c/d': set()
This was incorrect, since visitchildrenset explicitly says not to pay attention
to 'foo.txt' and 'a/bar.txt' by not returning them or 'this'. Given the near
impossibility of making visitchildrenset reliabbly produce only subdirectories,
a previous commit has made it documented and expected that visitchildrenset can
return a set containing both files and subdirectories to visit, instead of
implying/requiring that visitchildrenset() return 'this' if there are files to
visit. This makes the code for exactmatcher match this clarified documentation.
Differential Revision: https://phab.mercurial-scm.org/D4365
Kyle Lippincott <spectral@google.com> [Thu, 23 Aug 2018 18:04:15 -0700] rev 39260
match: document that visitchildrenset might return files
At least when using includematcher, and probably most matchers, we do not know
if a/b/f refers to a file 'f' in a/b, or a subdirectory 'f' in a/b, so most
matchers will return {'f'} for visitchildrenset('a/b'). Arguably, all matchers
could/should - for exactmatcher, we know that 'f' is a file, but there's no
reason to return 'this' for visitchildrenset('a/b') causing code to investigate
'a/b/x', for example.
Differential Revision: https://phab.mercurial-scm.org/D4364
Augie Fackler <augie@google.com> [Fri, 24 Aug 2018 10:13:27 -0700] rev 39259
util: make timedcm require the label (API)
Differential Revision: https://phab.mercurial-scm.org/D4350
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:15:51 -0400] rev 39258
cleanup: make all uses of timedcm specify what they're timing
It's not used in the timing itself, but it's valuable for the trace
events we emit.
Differential Revision: https://phab.mercurial-scm.org/D4349
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 17:13:35 -0400] rev 39257
util: make timedcm context manager also emit trace events
Differential Revision: https://phab.mercurial-scm.org/D4348
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:27:30 -0400] rev 39256
demandimport: instrument python 2 code with trace events
This causes the evaluation of an import in Python 3 to emit some trace
data. There's some interesting wrinkles in here, like the fact that
before we even hit dispatch we've demand-imported `sys` several times,
despite the fact that `sys` was already fully loaded as one of the
first few statements in the `hg` script. I don't think that's actually
costing us a ton of performance, but it's probably something we should
investigate fixing some day.
Differential Revision: https://phab.mercurial-scm.org/D4347
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:25:07 -0400] rev 39255
dispatch: have dispatch.dispatch and dispatch._runcatch emit trace events
Differential Revision: https://phab.mercurial-scm.org/D4345
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:24:20 -0400] rev 39254
tracing: new module to make tracing events in hg easier
This lives in hgdemandimport because I want to instrument a bunch of
low-level stuff including the bare `hg` script and demandimport, so it
can't live at a higher layer.
Differential Revision: https://phab.mercurial-scm.org/D4344
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:23:01 -0400] rev 39253
tests: add support for emitting trace events to run-tests
Right now this is pretty basic, but it's a start.
Differential Revision: https://phab.mercurial-scm.org/D4343
Augie Fackler <augie@google.com> [Tue, 21 Aug 2018 15:01:09 -0400] rev 39252
contrib: new script to read events from a named pipe and emit catapult traces
I'm starting to get more serious about getting some insight into where
we're spending our time, both in hg itself but also in the test
suite. As a first pass, I'm going to try and produce catapult
traces[0] that can be viewed with Chrome's `about:tracing` tool.
0: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit#heading=h.nso4gcezn7n1
Differential Revision: https://phab.mercurial-scm.org/D4342
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:49:08 -0400] rev 39251
fastannotate: pconvert paths from the server for Windows
I'm guessing that the right thing to do here is to convert the paths on the
server, but I know this is a WIP, and I don't know where that needs to happen.
I'm just trying to eliminate the malicious path warnings in the tests.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 22:34:32 -0400] rev 39250
test-fastannotate: close fd before unlinking to keep Windows happy
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:43:44 -0400] rev 39249
test-fastannotate: fix trivial output differences on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:29:10 -0400] rev 39248
fastannotate: make the default value for `fastannotate.useflock` dynamic
fcntl.flock isn't available on Windows.
Pulkit Goyal <pulkit@yandex-team.ru> [Wed, 08 Aug 2018 13:56:53 +0300] rev 39247
narrow: add a --narrowspec flag to clone command
This patch adds a --narrowspec flag to `hg clone` command in narrow extension
which can be used to read a file and parse narrowspecs from it and use it while
cloning a repository.
The --narrowspec flag assumes that the user wanted to narrow the clone.
Tests are added both for ellipsis and non-ellipsis mode.
Differential Revision: https://phab.mercurial-scm.org/D4156
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 16:01:19 -0700] rev 39246
manifest: use rev() instead of nodemap.__contains__
nodemap is an implementation detail of revlogs and isn't
appropriate to expose on the manifest storage API.
While revlogs don't have a __contains__, they do have lookup()
for resolving a value to a node. And this calls rev(), whose API
is documented to raise LookupError if a node doesn't exist. And
the parameters to LookupError are identical to what was being
raised here. So this change should be backwards compatible.
Differential Revision: https://phab.mercurial-scm.org/D4279
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:06:41 -0700] rev 39245
manifest: rename manifestlog._treeinmem to ._treemanifests
Not sure what "inmem" was supposed to indicate. This object is an
interface to manifest data on disk as well as "in memory" (assuming
that's what "inmem" means).
Differential Revision: https://phab.mercurial-scm.org/D4278
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 15:01:06 -0700] rev 39244
manifest: add getstorage() to manifestlog and use it globally
It is a common pattern to obtain a directory manifest storage instance
(a manifestrevlog) by going through manifestlog._revlog.dirlog().
Why access to storage and caching of other manifests is done through
manifestrevlog instead of manifestlog, I don't know.
This commit establishes a getstorage(tree) API on manifestlog and
imanifestlog that provides a public API for accessing manifest storage.
All consumers previously using private attributes have been updated
to use this new method.
.. api:: manifestlog now has a getstorage(tree) method
It should be used for obtaining an object representing the
manifest's storage implementation. Accessing
manifestlog._revlog should be avoided.
Differential Revision: https://phab.mercurial-scm.org/D4277
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:44:50 -0700] rev 39243
manifest: rename dir argument and attribute to tree
dir shadows a built-in. We use it throughout the manifest code, which
is unfortunate.
This commit updates just manifestrevlog to be more well behaved.
.. api:: renamed manifest.manifestrevlog.__init__ dir argument to tree
Differential Revision: https://phab.mercurial-scm.org/D4276
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:40:02 -0700] rev 39242
manifest: set appropriate cache entry when clearing _dirlogcache()
manifestrevlog applies to any manifest, not just the root manifest.
Resetting the cache and populating its root entry with self is not
correct when the instance does not refer to the root manifest.
This has no test fallout. So I'm guessing we only ever call
clearcaches() on the root manifest. Or we have no test coverage that
are impacted by a bad cache on a non-root manifestrevlog.
Differential Revision: https://phab.mercurial-scm.org/D4275
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 14:20:47 -0700] rev 39241
manifest: remove addgroup() from manifestlog and imanifestlog
addgroup() is part of the storage interface for manifests.
Unfortunately, we don't yet have a formal storage interface
for manifests. (One will be established in subsequent commits.)
One thing is for sure, addgroup() doesn't belong on imanifestlog -
at least not unless we extend that interface to encompass storage.
For now, let's access addgroup() on the _revlog attribute, just like
we do for tree manifests. Even though this violates visibility,
it is consistent.
Differential Revision: https://phab.mercurial-scm.org/D4274
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:59:27 -0700] rev 39240
repository: clarify role of imanifestlog
Looking at the implementation of manifest.manifestlog, it is highly
tailored towards servicing the root manifest. So clarify that in the
interface docstring.
Differential Revision: https://phab.mercurial-scm.org/D4273
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 13:43:26 -0700] rev 39239
changegroup: change topics during generation
Changegroup generation and consumption currently uses different sets of
topics. Generation uses "bundling" and consumption uses the name of the
thing being consumed.
This commit makes the topic and unit names consistent on both ends.
The reason I chose to change the generation side is because when
"bundling" is used for 3 different stages, it is unclear which stage
of changegroup generation we're in. By making the topics "changesets,"
"manifests," and "files," one can get a better feel for how far along
in the bundling process we are.
Differential Revision: https://phab.mercurial-scm.org/D4272
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:44:15 -0700] rev 39238
changegroup: rename mfs to manifests
In the name of readability.
Differential Revision: https://phab.mercurial-scm.org/D4271
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:42:00 -0700] rev 39237
changegroup: clean up changelog callback
changelog.read() calls changelog.changelogrevion() then turns it into
a tuple. Let's call changelogrevision() directly and used named
attributes to make code easier to read.
While we're here, also change some variable names to make code easier
to read.
Differential Revision: https://phab.mercurial-scm.org/D4270
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 12:08:45 -0700] rev 39236
changegroup: call rev() on manifestlog instance
rev() is part of the imanifestlog interface and should be used instead
of using the private revlog instance, which is an implementation
detail.
Differential Revision: https://phab.mercurial-scm.org/D4269
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 10 Aug 2018 11:00:06 -0700] rev 39235
manifest: rename dir to tree to avoid shadowing built-in
And update the argument name in the imanifestlog interface.
Differential Revision: https://phab.mercurial-scm.org/D4268
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 19:27:54 -0700] rev 39234
repository: remove candelta() from ifileindex
candelta() was previously called by changegroup code. With delta
generation moved to the storage API, there are no more external
consumers of this method and it can be removed from the storage
interface.
Differential Revision: https://phab.mercurial-scm.org/D4236
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 19:30:36 -0700] rev 39233
changegroup: rename dir to tree to avoid shadowing a built-in
Differential Revision: https://phab.mercurial-scm.org/D4235
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 16:11:24 -0700] rev 39232
repository: remove storedeltachains from ifilestorage
The ifilestorage interface was bootstrapped from requirements of
callers outside the storage implementation (revlogs). I believe we
even made some members public so they could be part of the interface!
Historically, the changegroup code was a gross offender when it
came to accessing low-level storage primitives. There are a handful
of members on the ifilestorage interface that are/were used only
for changegroup code.
With the recent refactor of changegroup code and the establishment
of a formal API on the storage interface for producing revision
deltas, the changegroup code is no longer accessing these low-level
primitives related to delta generation directly. Instead, things
are abstracted away in the storage implementation.
This means we can remove elements from the storage interface that
are no longer needed.
We start with "storedeltachains."
We remove it from the interface. Then we make it a private
attribute and update all references.
.. api:: storedeltachains has been dropped from ifilestorage interface
.. api:: storedeltachains on revlog classes is now _storedeltachains
Differential Revision: https://phab.mercurial-scm.org/D4227
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 16:02:14 -0700] rev 39231
repository: establish API for emitting revision deltas
With our revision delta and revision delta request interfaces
defined, it is now time to define a method on storage interfaces
for using them.
So far, the only storage interface that is well-defined and used
is file storage. So that is the only interface we need to add a
method on.
We define an ``emitrevisiondeltas()`` method that takes an
iterable of ``irevisiondeltarequest``s and turns them into
``irevisiondelta`` instances.
changegroup._handlerevisiondeltarequest() and the looping logic
from changegroup.deltagroup() has effectively been moved to
revlog.emitrevisiondeltas().
Our filelog wrapper class proxies its emitrevisiondeltas() to
the internal revlog instance.
The simple store test extension used to verify sanity of storage
abstractions has also implemented emitrevisiondeltas() for
file storage and the test harness when run with this extension doesn't
seem to exhibit any regressions.
Rather than create a shared type to represent revision deltas,
each storage backend has its own type and the class name identifies
where the revision delta was derived from.
Differential Revision: https://phab.mercurial-scm.org/D4226
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 15:40:14 -0700] rev 39230
repository: formalize interfaces for revision deltas and requests
Now that we've sufficiently abstracted how revision deltas are
produced in changegroup code, we can now start the process of
formalizing that as part of the interfaces defined in the
repository module.
This commit essentially converts the revisiondelta and
revisiondeltarequest classes into well-defined interfaces. This
is not strictly necessary. But I want all types formalized by the
storage interface to have interfaces. This makes it much easier
to test for interface conformance and for implementing new
storage backends.
Because the interface is documented, comments and docstrings from
changegroup.py have been dropped.
Differential Revision: https://phab.mercurial-scm.org/D4225
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 09 Aug 2018 14:31:25 -0700] rev 39229
changegroup: move node sorting into deltagroup()
The 3 callers of deltagroup() all sort nodes and convert to
integer revs immediately before calling deltagroup().
Stepping back a bit, aside from the constraints on node ordering
that always apply (namely that a node must follow its ancestor),
it makes sense for sorting to be an implementation detail of the
store. Moving the sorting into deltagroup() will open the door
for moving sorting into a storage API.
The test for the changelog in deltagroup() to impact the sorting
method is a bit hacky. I suspect this will be resolved once
we establish a formal interface for delta group generation
and port changelog to it.
Differential Revision: https://phab.mercurial-scm.org/D4224
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 21:05:15 -0400] rev 39228
cext: fix truncation warnings in revlog on Windows
Matt Harbison <matt_harbison@yahoo.com> [Tue, 21 Aug 2018 20:57:58 -0400] rev 39227
cext: fix revlog compiler error on Windows
Martin von Zweigbergk <martinvonz@google.com> [Sun, 05 Aug 2018 00:42:07 -0700] rev 39226
shortest: use nodetree for finding shortest node within revset
This speeds up `hg log -T '{shortest(node,1)}\n'` in my repo from 12s
to 4.5s. That's very close to the 4.1s it takes without the
disambiguation revset configured. My repo has 69.5k revisions, of
which 550 were in the configured revset ("not public()").
Differential Revision: https://phab.mercurial-scm.org/D4120
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Aug 2018 15:57:03 -0700] rev 39225
index: fix a comment about overflow-checking
There's no "argument-checking" done in this method. This was a bad
copy paste.
Differential Revision: https://phab.mercurial-scm.org/D4339
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Aug 2018 16:19:36 -0400] rev 39224
tests: demonstrate a problem with renames on the p2 side of a conversion
I think this is related to the octopus merge being sloppy, and that's having a
cascading affect on the fixup merge. If this change is made on p1 (specifically
with the 'Added parent file' commit), the failure doesn't occur.
The file modification with the rename doesn't seem to be necessary, but it's
what's happening in a production repo where I first noticed, so I left it. This
is an example of the manifest divergence I'd been seeing, which wasn't fixed by
Yuya's recent changes. This is separate from the changelog divergence I was
also seeing[1]. Probably nobody cares about bzr anymore, but this will also
affect git, since the octopus fixup code is in the hg sink.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-August/120473.html
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Jul 2018 15:03:15 -0400] rev 39223
tests: add a test to show the added/modified/removed files in a bzr convert
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Jul 2018 12:33:06 -0400] rev 39222
tests: show added/modified/removed files when logging repos converted from bzr
There's a bug related to incorrect status values that can be triggered by an
octopus fixup merge. Seeing what the current status is (instead of just the
aggregate list) will hopefully help track this down.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Aug 2018 22:04:22 -0400] rev 39221
tests: drop an unnecessary redirect to /dev/null
This eliminates the need to conditionalize the color output, because NUL on
Windows is a tty. Credit to Yuya for recognizing this.
Augie Fackler <augie@google.com> [Mon, 20 Aug 2018 11:29:43 -0400] rev 39220
py3: whitelist another test caught by the ratchet
Differential Revision: https://phab.mercurial-scm.org/D4335
Martin von Zweigbergk <martinvonz@google.com> [Fri, 03 Aug 2018 23:03:13 -0700] rev 39219
index: move raise_revlog_error() further up
I will add another caller below it.
Differential Revision: https://phab.mercurial-scm.org/D4119
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Jul 2018 07:53:23 -0700] rev 39218
index: make node tree a Python object
Differential Revision: https://phab.mercurial-scm.org/D4118
Martin von Zweigbergk <martinvonz@google.com> [Sun, 19 Aug 2018 22:30:32 -0700] rev 39217
index: rename _fix_index() since it no longer fixes the index
Since
c0d411ea6639 (index: drop support for negative indexes into the
index, 2018-07-20), it always returns the input (unless it raises).
Differential Revision: https://phab.mercurial-scm.org/D4334
Martin von Zweigbergk <martinvonz@google.com> [Sat, 18 Aug 2018 00:01:31 -0700] rev 39216
index: don't include nullid in boundary check in pure code
Yet another change that should probably have been part of
a3dacabd476b
(index: don't allow index[len(index)] to mean nullid, 2018-07-20).
Differential Revision: https://phab.mercurial-scm.org/D4333
Augie Fackler <augie@google.com> [Mon, 20 Aug 2018 16:13:17 -0400] rev 39215
fastannotate: address pyflakes concerns
Two unused imports, one unused local variable assignment.
Differential Revision: https://phab.mercurial-scm.org/D4337
Augie Fackler <augie@google.com> [Thu, 09 Aug 2018 15:08:32 -0400] rev 39214
fastannotate: move some global state mutation to extsetup()
Differential Revision: https://phab.mercurial-scm.org/D4202
Augie Fackler <augie@google.com> [Thu, 09 Aug 2018 15:05:43 -0400] rev 39213
fastannotate: rip out specialized support for remotefilelog
remotefilelog can choose to collaborate with fastannotate for now if
it needs to, and in the future when we make good on our longstanding
desire to move remotefilelog-like features in-house we'll make sure
things are well-supported via a reasonable interface.
Differential Revision: https://phab.mercurial-scm.org/D4201
Augie Fackler <augie@google.com> [Thu, 09 Aug 2018 14:56:29 -0400] rev 39212
fastannotate: record some TODO items from indygreg's review
Some of these I'll address more or less right away, but some will take
a while for us to resolve.
Differential Revision: https://phab.mercurial-scm.org/D4200
Augie Fackler <augie@google.com> [Wed, 01 Aug 2018 11:10:41 -0400] rev 39211
fastannotate: write out files from server in a predictable order
This is mostly for test output stabilization, but it *might* be
slightly better with a ton of annotate caches because we'll write to
one directory at a time rather than bouncing around randomly.
Differential Revision: https://phab.mercurial-scm.org/D3995
Augie Fackler <augie@google.com> [Mon, 30 Jul 2018 22:50:00 -0400] rev 39210
fastannotate: initial import from Facebook's hg-experimental
I made as few changes as I could to get the tests to pass, but this
was a bit involved due to some churn in the blame code since someone
last gave fastannotate any TLC.
There's still follow-up work here to rip out support for old versions
of hg and to integrate the protocol with modern standards.
Some performance numbers (all on my 2016 MacBook Pro with a 2.6Ghz i7):
Mercurial mercurial/manifest.py
traditional blame
time: real 1.050 secs (user 0.990+0.000 sys 0.060+0.000)
build cache
time: real 5.900 secs (user 5.720+0.000 sys 0.110+0.000)
fastannotate
time: real 0.120 secs (user 0.100+0.000 sys 0.020+0.000)
Mercurial mercurial/localrepo.py
traditional blame
time: real 3.330 secs (user 3.220+0.000 sys 0.070+0.000)
build cache
time: real 30.610 secs (user 30.190+0.000 sys 0.230+0.000)
fastannotate
time: real 0.180 secs (user 0.160+0.000 sys 0.020+0.000)
mozilla-central dom/ipc/ContentParent.cpp
traditional blame
time: real 7.640 secs (user 7.210+0.000 sys 0.380+0.000)
build cache
time: real 98.650 secs (user 97.000+0.000 sys 0.950+0.000)
fastannotate
time: real 1.580 secs (user 1.340+0.000 sys 0.240+0.000)
mozilla-central dom/base/nsDocument.cpp
traditional blame
time: real 17.110 secs (user 16.490+0.000 sys 0.500+0.000)
build cache
time: real 399.750 secs (user 394.520+0.000 sys 2.610+0.000)
fastannotate
time: real 1.780 secs (user 1.530+0.000 sys 0.240+0.000)
So building the cache is expensive (but might be faster with xdiff
enabled), but the blame results are *way* faster.
Differential Revision: https://phab.mercurial-scm.org/D3994
Joerg Sonnenberger <joerg@bec.de> [Thu, 16 Aug 2018 05:50:49 +0200] rev 39209
util: improve handling of truncated compressed streams
If the compressed stream is over as marked by the reader providing
nothing new and the compression engine is not providing data, bail out.
This can happen in practise when the server misbehaves and would result
in an infinite loop otherwise.
Differential Revision: https://phab.mercurial-scm.org/D4297
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 23:24:33 +0800] rev 39208
zsh_completion: update all options
It's just too hard to further split this patch. What it does:
- adds missing flags
- removes flags that are no longer there
- updates flag descriptions and argument names
- adds * where using the same option many times is okay
- groups with () mutually exclusive flags that can't be used together
- adds + and = to options that need arguments
- removes + and = from options that don't take any arguments
- fixes minor issues and a typo
Differential Revision: https://phab.mercurial-scm.org/D4267
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 14:46:56 +0800] rev 39207
zsh_completion: run hg with HGPLAINEXCEPT=alias to list commands
This is what contrib/bash_completion does, looks like a sensible thing to do.
Differential Revision: https://phab.mercurial-scm.org/D4266
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 14:41:41 +0800] rev 39206
zsh_completion: remove completion for obsolete graphlog extension
Differential Revision: https://phab.mercurial-scm.org/D4265
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 09:09:52 +0800] rev 39205
zsh_completion: declare appropriate local parameters for ->string form
When ->string form is used for _arguments, the function that calls it must
declare appropriate local parameters.
Managing local return value is needed to tell the completion system if our
function succeeded in suggesting something or not, plus without that `hg diff
-<TAB>` doesn't look right.
While at it, fix a copypaste error (s/diff_files/revert_files/).
Docs: http://zsh.sourceforge.net/Doc/Release/Completion-System.html
Differential Revision: https://phab.mercurial-scm.org/D4264
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 08:59:52 +0800] rev 39204
zsh_completion: complete files from `hg st -mar` for commit and diff
Useful to have and is consistent with our bash completion file.
This is also an improvement coming from upstream, downstream or sidestream
(depends on how you look at it) hg completion file -- the one that lives in
zsh's own repo.
Differential Revision: https://phab.mercurial-scm.org/D4263
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 08:33:27 +0800] rev 39203
zsh_completion: drop -w, add -S to _arguments
From the docs: http://zsh.sourceforge.net/Doc/Release/Completion-System.html
_arguments -w: "allow option stacking even if one or more of the options take
arguments", so something like "-xy xarg yarg". Mercurial's command line parser
doesn't support that, so the flag got removed in zsh
92584634d3d3 and
bf8b61182043.
_arguments -S: "do not complete options after a ‘--’ appearing on the line". By
options it means things like "-x" and "--foo", but it will still complete
arguments like files.
Differential Revision: https://phab.mercurial-scm.org/D4262
Anton Shestakov <av6@dwimlabs.net> [Fri, 10 Aug 2018 08:19:36 +0800] rev 39202
zsh_completion: rename _hg_style_opts to _hg_template_opts
--style is a deprecated alias for --template, and doesn't show up in help
without --verbose, so completing it doesn't make much sense.
Let's s/style/template/ this variable to be more consistent with cmdutil.py,
which is helpful to look at in parallel next time someone wants to update the
completion rules.
Differential Revision: https://phab.mercurial-scm.org/D4261
Joerg Sonnenberger <joerg@bec.de> [Fri, 17 Aug 2018 00:51:46 +0200] rev 39201
pycompat: wrap xrange for py2 to provide efficient __contains__
The C implementation of xrange in Python 2 provides a O(n) membership
test, which is noticable on pull-based clones of large repositories.
Avoid this by providing a wrapper class with O(1) membership test based
on the edges of the range.
Differential Revision: https://phab.mercurial-scm.org/D4313
Boris Feld <boris.feld@octobus.net> [Sat, 18 Aug 2018 10:24:57 +0200] rev 39200
phases: drop dead code in `newheads`
There are new code earlier in the function achieving the same result.
Spotted by Yuya Nishihara.
Boris Feld <boris.feld@octobus.net> [Sat, 18 Aug 2018 10:24:16 +0200] rev 39199
phases: fix `nullid` reference in newheads
Spotted by Yuya Nishihara.
Augie Fackler <augie@google.com> [Mon, 20 Aug 2018 16:33:48 -0400] rev 39198
beautifygraph: don't warn about busted terminal if HGPLAIN is set
This was breaking some automation for users that discovered the
extension and turned it on.
Differential Revision: https://phab.mercurial-scm.org/D4338
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Aug 2018 09:48:08 -0700] rev 39197
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sun, 19 Aug 2018 13:27:02 +0900] rev 39196
merge: do not delete untracked files silently (
issue5962)
37450a122128,
2a774cae3a03, and
656ac240f392 weren't enough to prevent data
loss. No unknown "files" weren't deleted before
7a8a16f8ea22, "context: also
consider path conflicts when clearing unknown files."
Yuya Nishihara <yuya@tcha.org> [Sat, 18 Aug 2018 10:06:56 +0900] rev 39195
node: correct hex representation of pseudo node ids
Augie Fackler <augie@google.com> [Sun, 19 Aug 2018 21:53:41 -0400] rev 39194
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sat, 18 Aug 2018 10:33:03 +0900] rev 39193
perf: fix typo in perfphasesremote()
Boris Feld <boris.feld@octobus.net> [Thu, 16 Aug 2018 04:50:32 +0200] rev 39192
revlog: fix typo in 'buildtext' name
There are no such things as 'deltacomputer._buildtext'. I'm not sure why this
code never ran, but we better fix the typo.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 18 Aug 2018 23:17:06 -0700] rev 39191
revlog: fix pure version of _partialmatch() to include nullid
Before this patch, test-
issue842.t and a few more tests fail when they
try to refer to the null revision by using a "000.." prefix of it (or
because they use the "shortest" template function which internally
does that).
This should have been part of my
a3dacabd476b (index: don't allow
index[len(index)] to mean nullid, 2018-07-20), but I had forgotten to
update another part of the pure code there, so it didn't fail until
a1f934573c0b (parsers: adjust pure-python version to mimic
a3dacabd476b, 2018-08-09) and
65d5de1169dd (revlog: fix pure nodemap
to not access missing index entry, 2018-08-17) fixed the other things
I had missed.
Differential Revision: https://phab.mercurial-scm.org/D4332
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 15:15:04 -0400] rev 39190
tests: conditionalize color output on abort
This broke in
afc4ad706f9c. I'm not sure why other aborts don't need to be
conditionalized, but `hg help foo` does abort in red for both msys and cmd.exe.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 14:03:11 -0400] rev 39189
tests: conditionalize out tests that msys is mangling
This was exposed by
ac0a87160012. The paths for convert and ssh respectively
are being turned into:
$TESTTMP\bzr+ssh:\foobar@selenic.com\baz\.hg
'C:\\C:\\Users\\Matt\\AppData\\Local\\Temp\\hgtests.8awa9x\\child1\\test-ssh-bundle1.t-sshv2\\nonexistent\\.hg
The errno value raised is 123, and the message is
The filename, directory name, or volume label syntax is incorrect
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 13:27:33 -0400] rev 39188
test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 12:35:47 -0400] rev 39187
test-graft: add a missing output line for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 01:07:43 -0400] rev 39186
share: allow more than one level of directories to be created
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 00:51:26 -0400] rev 39185
clone: allow local cloning to create more than one level of directories
I figure cloning a remote repository is more common, thus it's more likely that
some people might be relying on the less restrictive behavior. Additionally,
`hg init` will also create more than one level of missing directories.
I also have a use case for reading the subrepos from .hgsub, and sharing them
into the normal nested location on the server. SCM Manager doesn't host
subrepos in the normal nested location, which is nice for deduplicating the
repository data, but confuses `hg verify`. Some of the subrepos are in the root
of the repositories, while others are one or two directories deep. So not
having to build up the parent path first is desirable.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 17 Aug 2018 23:28:37 -0400] rev 39184
tests: demonstrate an inconsistency when cloning to a missing directory tree
I noticed that `hg share` is unable to create more than one missing directory on
the path, and thought it was inconsistent with clone. It turns out that the
path for copying/linking the remote store has the same limitation, but cloning
from a remote repo doesn't.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 18 Aug 2018 23:39:26 -0400] rev 39183
tests: stabilize test-merge-tools.t on Windows
More fun with `hg import --bypass` to work around Windows limitations. The
diffs were generated on Linux, and had a tab to terminate the `+++b/...` lines.
But check-code complained about trailing whitespace, and it seems to run without
them.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 21:26:34 +0000] rev 39182
dagutil: remove module
The previous commit removed the last consumer of this module.
.. api:: dagutil module has been removed
Some functionality has been moved to the dagop module. Other
functionality can be accomplished via revsets.
Differential Revision: https://phab.mercurial-scm.org/D4330
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 21:21:50 +0000] rev 39181
dagop: port revlogdag.linearize() to standalone function
The code should functionally be identical.
We also port the one consumer in changegroup to use the new
standalone function.
After this commit, dagutil is no longer used!
Differential Revision: https://phab.mercurial-scm.org/D4329
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 19:48:52 +0000] rev 39180
dagutil: use revlog.parentrevs() for resolving parent revisions
And remove parents() since it is no longer used.
revlog.parentrevs() is almost the same as parents(). The main
difference is that parentrevs() can return nullrev. dagop.headrevs()
already handles nullrev. We add an inline check for nullrev in the
other call site to account for the difference.
.. api:: parents() removed from dagutil classes
Use parentrevs() on the storage object instead.
Differential Revision: https://phab.mercurial-scm.org/D4328
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 19:45:13 +0000] rev 39179
dagop: extract headsetofconnecteds() from dagutil
The functionality for resolving the set of DAG heads from a
subset simply requires a function to resolve parent revisions.
Let's establish a function in the dagop module to do this, which
seems to be where generic DAG functionality goes these days.
Differential Revision: https://phab.mercurial-scm.org/D4327
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 19:35:24 +0000] rev 39178
setdiscovery: precompute children revisions to avoid quadratic lookup
Moving away from dagutil a few commits ago introduced quadratic
behavior when resolving children revisions during discovery.
This commit introduces a precompute step of the children revisions
to avoid the bad behavior.
I believe the new code should have near identical performance to
what dagutil was doing before. Behavior is still slightly different
because we take into account filtered revisions. But this change was
made when we moved off dagutil.
I added a comment about multiple invocations of this function
redundantly calculating the children revisions. I believe this
potentially undesirable behavior was present when we used dagutil,
as the call to inverse() previously in this function created a new
object and required computing children on every invocation. I thought
we should document the potential for a performance issue rather than
let it go undocumented.
Differential Revision: https://phab.mercurial-scm.org/D4326
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 19:24:36 +0000] rev 39177
dagutil: remove unused classes
We only directly use revlogdag in changegroup code. We don't need
all this abstraction. So remove various classes and levels
of inheritance.
Differential Revision: https://phab.mercurial-scm.org/D4325
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 18:23:47 +0000] rev 39176
setdiscovery: use revset for resolving DAG heads in a subset
This was the final use of dagutil in setdiscovery!
For reasons I didn't investigate, feeding a set with nullrev
into the heads() revset resulted in a bunch of tests failing.
Filtering out nullrev from the input set fixes things.
Differential Revision: https://phab.mercurial-scm.org/D4324
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 19:12:25 +0000] rev 39175
dagutil: remove ability to invert instances
The previous commit removed the last consumer of this feature.
.. api:: remove inverse() methods from classes in dagutil
Differential Revision: https://phab.mercurial-scm.org/D4323
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 18:22:10 +0000] rev 39174
setdiscovery: don't use dagutil for parent resolution
_updatesample()'s one remaining use of revlogdag is for resolving
the parents of a revision.
In 2 cases, we actually resolve parents. In 1, we operate on the
inverted DAG and resolve children.
This commit teaches _updatesample() to receive an argument defining
the function to resolve "parent" revisions. Call sites pass in
changelog.parentrevs() or a wrapper around changelog.children()
accordingly.
The use of children() is semantically correct. But it is quadratic,
since revlog.children() does a range scan over all revisions starting
at its input and effectively calls parentrevs() to build up the list
of children. So calling it repeatedly in a loop is a recipe for
bad performance. I will be implementing something better in a
subsequent commit. I wanted to get the porting off of dagutil done
in a way that was simple and correct.
Like other patches in this series, this change is potentially impacted
but revlogdag's ignorance of filtered revisions. The new code is
filtering aware, since changelog's revs() (used by children() will
skip filtered revisions and therefore hidden children won't appear.
This is potentially backwards incompatible. But no tests fail and
I think this code should respect visibility.
Differential Revision: https://phab.mercurial-scm.org/D4322
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 18:05:36 +0000] rev 39173
setdiscovery: use revsets for computing a subset's heads and roots
revlogdag.headsetofconnecteds() obtains the set of DAG heads in a
given set of revs.
revlogdag.inverse() inverts the DAG order and makes
headsetofconnecteds() obtain the DAG roots in a given subset.
Both of these can be expressed with a revset.
Like other patches in this series, revlogdag uses revlog.index
and thus doesn't take filtering into account. Revsets do. So there
is a chance for regressions with this change. But no tests fail.
And I think this code should take filtering into account since
hidden changesets shouldn't factor into discovery (unless operating
on the hidden repository).
Differential Revision: https://phab.mercurial-scm.org/D4321
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:59:16 +0000] rev 39172
dagutil: remove heads() and localsubset from revlogdag.__init__
The previous commit removed the last consumer of this API.
I'm not going to mark as API incompatible because I doubt anybody
used this functionality (outside of possibly passing an argument
to revlogdag.__init__). I intend to remove revlogdag later in
this series and its API annotation will cover this one.
Differential Revision: https://phab.mercurial-scm.org/D4320
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:54:10 +0000] rev 39171
setdiscovery: pass head revisions into sample functions
This eliminates the last remaining consumer of heads() and
related functionality in dagutil.
Differential Revision: https://phab.mercurial-scm.org/D4319
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:48:15 +0000] rev 39170
setdiscovery: pass heads into _updatesample()
In preparation for eliminating the use of dagutil. Since
_takefullsample() operates on the inverted DAG, it is easier
to have the caller pass in the relevant set instead of teaching
_updatesample() about when to invert the DAG.
We keep the logic identical for now: future commits will remove
dagutil.
Differential Revision: https://phab.mercurial-scm.org/D4318
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:26:07 +0000] rev 39169
setdiscovery: use a revset for finding DAG heads in a subset
The march towards moving away from dagutil continues.
Like other patches moving us away from dagutil, there is the
potential for regressions to occur because revlogdag's
headsetofconnecteds() uses revlog.index, which doesn't take
filtering into account. The revset layer does. But no tests
fail, so we appear to be in the clear.
Differential Revision: https://phab.mercurial-scm.org/D4317
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:21:11 +0000] rev 39168
setdiscovery: reflect use of revs instead of nodes
This code all operates on revision numbers. Update variable names
and comments accordingly.
Differential Revision: https://phab.mercurial-scm.org/D4316
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:15:09 +0000] rev 39167
dagutil: remove descendantset() and ancestorset()
descendantset() is unused after the previous commit. And
ancestorset() was only used by descendantset(), so it can be removed
as well.
.. api:: descendantset() and ancestorset() removed from dagutil
Use a revset instead when operating on the changelog. Or use
various functionality in the ancestor or dagop modules.
Differential Revision: https://phab.mercurial-scm.org/D4315
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 17:13:26 +0000] rev 39166
setdiscovery: use a revset instead of dagutil.descendantset()
This is the only use of descendantset() in the repo.
Strictly speaking, the revset behaves slightly differently than
dagutil. The reason is that dagutil is using revlog.index for
DAG traversal and this data structure isn't aware of visibility /
filtering. So it can operate on revisions it shouldn't operate on.
But our test coverage of this code is pretty comprehensive and
this change causes no tests to fail. So I think we are good.
Also, the revset parser failed to parse `%ld:: - %ld::`, hence
the use of descendants(). I'm not sure if that is a feature or
a bug.
Differential Revision: https://phab.mercurial-scm.org/D4314
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 20:23:10 +0000] rev 39165
setdiscovery: don't use dagutil to compute heads
This is a relatively trivial operation to perform. We don't
need to use dagutil.
This brings us one step closer to eliminating dagutil.
We still need to populate the heads on revlogdag because later
functionality relies on it.
Differential Revision: https://phab.mercurial-scm.org/D4310
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 20:11:45 +0000] rev 39164
dagutil: remove nodeset()
AFAICT this was unused since the code was introduced by
cb98fed52495
in 2011!
Differential Revision: https://phab.mercurial-scm.org/D4309
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:55:55 +0000] rev 39163
debugcommands: use a revset instead of dagutil
All this code was doing was finding the nodes that are heads
from the ancestors of an input set. This can easily be expressed
with a revset without having to go through dagutil.
This was the last use of ancestorset() outside of dagutil itself.
Differential Revision: https://phab.mercurial-scm.org/D4308
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:51:01 +0000] rev 39162
dagutil: remove internalize() and internalizeall()
The previous commit removed the last consumer.
.. api:: removed internalize() and internalizeall() from dagutil
Use .rev(node) on storage objects to convert nodes to revisions.
Differential Revision: https://phab.mercurial-scm.org/D4307
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:47:30 +0000] rev 39161
setdiscovery: don't use dagutil for node -> rev conversion
The node -> rev conversion is possible using standard storage APIs
and doesn't need to involve the dagutil module.
Differential Revision: https://phab.mercurial-scm.org/D4306
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:40:46 +0000] rev 39160
dagutil: remove externalize() and externalizeall()
They are unused after the previous commit.
.. api:: externalize() and externalizeall() removed from dagutil
Use .node() on a storage primitive to perform revision to node
conversions.
Differential Revision: https://phab.mercurial-scm.org/D4305
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:39:47 +0000] rev 39159
setdiscovery: don't use dagutil for rev -> node conversions
We don't need to use dagutil to perform a simple rev -> node
conversion.
I haven't measured, but the new code is likely faster, as we
avoid extra function calls and avoid some attribute lookups.
Differential Revision: https://phab.mercurial-scm.org/D4304
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 16 Aug 2018 19:23:24 +0000] rev 39158
exchange: don't use dagutil
We were only using it for simple node -> rev and parent revision
lookups. These are exposed via the storage interface and we don't
need to go through dagutil.
Differential Revision: https://phab.mercurial-scm.org/D4303
Paul Morelle <paul.morelle@octobus.net> [Fri, 20 Jul 2018 13:20:01 +0200] rev 39157
revlog: only consider the span of the delta section
Since the number of snapshots is limited we can exclude them from the logic
checking size and number of reads. Limiting the span computation to the delta
section will allow for further optimization.
Boris Feld <boris.feld@octobus.net> [Mon, 23 Jul 2018 16:21:58 +0200] rev 39156
revlog: ensure intermediate snapshot have decreasing size
If the intermediate snapshot is bigger than the previous one, there is likely
a better snapshot to be made at a different level.
Paul Morelle <paul.morelle@octobus.net> [Wed, 07 Mar 2018 12:28:04 +0100] rev 39155
revlog: bound number of snapshots in a chain
To limit the number of snapshot chained, we enforce them to be smaller and
smaller. This guarantee the number of snapshot in a chain will be bounded to a
small number.
Boris Feld <boris.feld@octobus.net> [Fri, 20 Jul 2018 14:32:56 +0200] rev 39154
revlog: compute snapshot depth on delta info
We need the information to be available when choosing delta.
Boris Feld <boris.feld@octobus.net> [Wed, 15 Aug 2018 12:30:30 +0200] rev 39153
debugrevlog: display snapshot details per depth
This help in understanding the final structure of build manifest. All data
about snapshot (full and intermediate) are gathered into a sub-list for
clarity.
Since we do not produce such snapshots yet, the only thing changing in test
output is the way the information is presented.
Boris Feld <boris.feld@octobus.net> [Wed, 15 Aug 2018 12:09:14 +0200] rev 39152
revlog: add a method to retrieve snapshot depth
Some snapshot property (eg: maximum size) will depend on their depth.
Boris Feld <boris.feld@octobus.net> [Fri, 27 Jul 2018 10:52:43 +0200] rev 39151
debugrevlog: include information about intermediate snapshots
As we are about to create intermediate snapshots, we need to have a way to
debug them. We start by adding very simple debug output and more detailed
output will comes in next changesets.
Paul Morelle <paul.morelle@octobus.net> [Fri, 20 Jul 2018 13:34:48 +0200] rev 39150
revlog: also detect intermediate snapshots
Also detect intermediate-snapshot done against another previous snapshot.
Doing an intermediate snapshot instead of a full one can reduce the number of
full snapshots we need. They are especially useful for content with a lot of
churn on the same line (eg: the manifest) where having a delta over multiple
revisions can end up being significantly smaller than the sum of these
revision deltas.
A revlog built using intermediate snapshots can be a bit smaller and reuse
snapshot much more efficiently. This last property is useful combined with
constraints on chain length. Using intermediate snapshot can produce
repository with delta chain ten times shorter without impact on the storage
size. Shorter chain lengths are faster to restore, greatly improving read
performance.
This changesets (and the following ones) focus on getting the core principle
of intermediate snapshots into Mercurial core. Later changeset will introduce
the strategy to create them.
Paul Morelle <paul.morelle@octobus.net> [Fri, 20 Jul 2018 13:32:17 +0200] rev 39149
revlog: add a method to tells whether rev is stored as a snapshot
For now we only have one type of snapshot: full snapshot versus nullrev.
However we are looking into adding intermediate snapshot where a large diff
against another snapshot is performed instead of storing a full new text.
The conditional is a bit strange and is done in order to help readability of a
some later changesets.
Boris Feld <boris.feld@octobus.net> [Wed, 15 Aug 2018 15:20:44 +0200] rev 39148
debugrevlog: fix for non-manifest object
The `filelog` object is no longer an actual revlog. Instead, the actual revlog
is stored in the `_revlog` attribute.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 17 Aug 2018 16:11:35 -0700] rev 39147
merge with stable