Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 15:05:08 +0200] rev 45640
copies: directly pass a changes object to the copy tracing code
The object contains all the data we need. For example, the `is_merged` callback
can now use the associated precomputed data.
This will be useful again soon when the `salvaged` set will be introduce to
solve the issue with delete file reverted during a merge. See
4b582a93316a and
14be07d5603c for details.
Differential Revision: https://phab.mercurial-scm.org/D9117
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 14:54:43 +0200] rev 45639
copies: no longer change the sidedata flag
With the new sidedata storage that include data about all file changes, every
revision has one, so the sidedata flag is not longer a good way to spot
changeset with copy information. So we drop this check to simplify the code
We optimisation itself provided an interesting speedup, so we will likely
reintroduce something similar, with a dedicated flag, in the future.
Differential Revision: https://phab.mercurial-scm.org/D9116
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 14:52:34 +0200] rev 45638
copies: use dedicated `_revinfo_getter` function and call
We want to return data in a different form, so we need different revinfo
function. At that point it make sense to have different getter.
Differential Revision: https://phab.mercurial-scm.org/D9115
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 14:39:04 +0200] rev 45637
copies: make two version of the changeset centric algorithm
They are two main ways to run the changeset-centric copy-tracing algorithm. One
fed from data stored in side-data and still in development, and one based on
data stored in extra (with a "compatibility" mode).
The `extra` based is used in production at Google, but still experimental in
code. It is mostly unsuitable for other users because it affects the hash.
The side-data based storage and algorithm have been evolving to store more data, cover more cases
(mostly around merge, that Google do not really care about) and use lower level
storage for efficiency.
All this changes make is increasingly hard to maintain de common code base,
without impacting code complexity and performance. For example, the
compatibility mode requires to keep things at different level than what we
need for side-data.
So, I am duplicating the involved functions. The newly added `_extra` variants
will be kept as today, while I will do some deeper rework of the side data
versions.
Long terms, the side-data version should be more featureful and performant than
the extra based version, so I expect the duplicated `_extra` functions to
eventually get dropped.
Differential Revision: https://phab.mercurial-scm.org/D9114
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 10:55:30 +0200] rev 45636
changing-files: retrieve changelogrevision.files from the sidedata block
The `files` field is know to have issue, using a list with fixed, and fixable,
computation can only help. For example, using a fixes `files` field would be
enough to fix
issue6219 once this feature get usable in production.
We focus on having thing working for now, we will deal with performance later.
Right now we have a ironic situation were we parse sorted value from disk to
turn them into a set and then having to sort it again.
Differential Revision: https://phab.mercurial-scm.org/D9092
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 10:49:50 +0200] rev 45635
changing-files: drop the now useless changelogrevision argument
Since all filename are now included in the sidedata block, we no longer need to decode the `files` from the revision.
Differential Revision: https://phab.mercurial-scm.org/D9091
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 10:55:17 +0200] rev 45634
changing-files: rework the way we store changed files in side-data
We need to store new data so this is a good opportunity to rework this fully.
1) We directly store the list of affected file in the side data:
* This avoid having to fetch and parse the `files` list in the revision in
addition to the sidedata. Making the data more self sufficient.
* This work around situation where that `files` field contains wrong
information, and open the way to other bug fixing (eg:
issue6219)
* The format (fixed initial index, sorted files) allow for fast lookup of
filename within the structure.
* This unify the storage of affected files and copies sources and destination,
limiting the number filename stored redundantly.
* This prepare for the fact we should drop the `files` as soon as we do any
change affecting the revision schema.
* This rely on compression to avoid a significant increase of the changelog.d.
More testing on this will be done before we freeze the final format.
2) We can store additional data:
* The new "merged" field,
* A future "salvaged" set recording files that might have been deleted but have
were still present in the final result.
Differential Revision: https://phab.mercurial-scm.org/D9090
Joerg Sonnenberger <joerg@bec.de> [Mon, 05 Oct 2020 15:08:15 +0200] rev 45633
tests: skip doctests if not running from a hg repo
Differential Revision: https://phab.mercurial-scm.org/D9150
Raphaël Gomès <rgomes@octobus.net> [Mon, 05 Oct 2020 10:33:52 +0200] rev 45632
py3: use native string when comparing with a function's argspec
I only found two such bugs in `contrib/perf.py`
Differential Revision: https://phab.mercurial-scm.org/D9149
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Oct 2020 10:29:22 +0200] rev 45631
test: try to unflaky test-profile.t
That test rely on timing measurement, because it is about timing measurement. We
try to filter out the most common source of flakyness (slow disk stating)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Oct 2020 18:40:39 +0530] rev 45630
merge: check for conflicting actions irrespective of length of bids
We should for whether bids contain a combination of actions which conflict with
each other. Since right now we only have couple of such combination, and
combinations also consist of two actions, we were checking for them only when
length of bids is 2. Let's check that irrespective of the length of bids.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 02 Oct 2020 07:56:01 -0700] rev 45629
branching: merge with stable
Yuya Nishihara <yuya@tcha.org> [Thu, 10 Sep 2020 17:44:34 +0900] rev 45628
log: extract function that builds (revs, makefilematcher) from walkopts
"hg grep" and "hg churn" will use this interface.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 22:42:58 +0900] rev 45627
log: move --graph and topo sort options to walkopts
This is the last opts.get() found in getrevs(). It might be better to define
an enum, but for now, it is just a string.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 22:03:53 +0900] rev 45626
log: move miscellaneous filter/matcher options to walkopts
Maybe this is the most uninteresting patch. I want to remove the dependency
on untyped/unlabeled opts dict at all.
I thought --no-merges and --only-merges could be merged into a single enum
value, but actually they both can be set to filter out everything.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 21:54:58 +0900] rev 45625
log: map --removed to walkopts.force_changelog_traversal
This is the flag to forcibly enable the slowpath. I'm not sure if the
slowpath parameter should be merged with this flag, so let's keep it as
an immutable flag for now.
I'll add another flag to support "grep --all-files". These two will be the
flags which aren't directly mapped from the command-line options.
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 14:33:05 +0200] rev 45624
copies: rename some function to the new naming scheme
We are about to introduce more function and more variants, it seems better to
align everything on the new scheme, allowing `_` for clarify. We do this aligned
in a dedicated changeset to make the next changesets simpler.
Differential Revision: https://phab.mercurial-scm.org/D9113
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 28 Sep 2020 12:26:09 +0200] rev 45623
changing-files: cache the various property
We are going to start using them more having some basic caching would be good.
The focus is not about performance yet, however avoid some easy N² trap seems
reasonable.
Differential Revision: https://phab.mercurial-scm.org/D9112
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 14:16:35 +0200] rev 45622
changing-files: always use `mark_touched` to update the touched set
We use this function internally too because that will make cache invalidation
simpler.
Differential Revision: https://phab.mercurial-scm.org/D9111
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Oct 2020 08:57:43 +0200] rev 45621
changing-files: fix docstring
As pointed by Pulkit Goyal.
Differential Revision: https://phab.mercurial-scm.org/D9143
Martin von Zweigbergk <martinvonz@google.com> [Thu, 01 Oct 2020 09:09:35 -0700] rev 45620
rust: move rustfmt.toml to repo root so it can be used by `hg fix`
`hg fix` runs the formatters from the repo root so it doesn't pick up
the `rustfmt.toml` configs we had in each the `hg-core`, `hg-cpython`,
and `rhg` packages, which resulted in warnings about `async fn` not
existing in Rust 2015. This patch moves the `rustfmt.toml` file to the
root so `hg fix` will use it.
By putting the `rustfmt.toml` file in a higher-level directory, it
also applies to the `chg` and `hgcli` packages. That makes
`test-check-rust-format.t` fail, so this patch also applies the new
formatting rules to those packages.
Differential Revision: https://phab.mercurial-scm.org/D9142
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Sep 2020 18:07:21 +0530] rev 45619
merge: if CHANGED_DELETED and KEEP_NEW are actions, choose CHANGED_DELETED
ACTION_KEEP_NEW and ACTION_CHANGED_DELETED are conflicting actions as one says
that file is new while other says that file was present earlier and has
changed-delete conflicts.
Let's do changed-delete which will lead to conflicts and make user choose the
right way.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Sep 2020 17:51:40 +0530] rev 45618
tests: fix a typo in `desc()` revset in test-merge-criss-cross.t
I was looking into fixing the broken behavior only to find out that we had a
typo in the commit message and merge was not performed.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Sep 2020 15:46:54 +0530] rev 45617
merge: if DELETED_CHANGED and GET are in actions, choose DELETED_CHANGED
ACTION_GET represents that either the file is created on remote or it's newer on
the remote side. However, since we have a ACTION_DELETE_CHANGED too, it means
the file is not present locally and ACTION_GET is representing that file was
created on remote.
Having both ACTION_GET and ACTION_DELETED_CHANGED is conflicting because one
says that file was created on remote and other says file has delete-changed
conflicts.
Let's choose ACTION_DELETED_CHANGED which will result in conflicts and make user
choose the right way forward.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Sep 2020 15:09:25 +0530] rev 45616
tests: add newfilenode test case in test-merge-changedelete.t
Raphaël Gomès <rgomes@octobus.net> [Thu, 01 Oct 2020 09:49:33 +0200] rev 45615
rust: leverage improved match ergonomics
Differential Revision: https://phab.mercurial-scm.org/D9137
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Sep 2020 15:08:02 +0200] rev 45614
rust: update minimum supported Rust compiler version
Debian stable backported `rustc 1.41.1` for a Firefox release that needed it,
so we can finally update the compiler version to something that isn't more than
a year old.
This means that (among other things [1]), `async await` syntax is usable!
Differential Revision: https://phab.mercurial-scm.org/D9138
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 11:29:19 +0200] rev 45613
changing-files: add a utility to compute the merged files post-commit
We will need it in `_getsidedata` as soon as we start persisting that set.
Differential Revision: https://phab.mercurial-scm.org/D9089
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 25 Sep 2020 02:01:32 +0200] rev 45612
changing-files: record merged files at commit time
The data is easy to gather at commit time, and we need it for changeset centric
copy tracing. Right now, it is not persisted so we cannot use it. However we
will fix this part very soon, gathering something to persist was necessary
first.
Differential Revision: https://phab.mercurial-scm.org/D9088
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 24 Sep 2020 09:50:09 +0200] rev 45611
changing-files: add the ability to track merged files too
The set of merged files is used when doing changeset centric copy tracing (cf
`is_merged` in `mercurial/copies.py`. So tracking (and persisting) this set will
be useful. We start with adding the attribute on the new object.
Differential Revision: https://phab.mercurial-scm.org/D9087
Raphaël Gomès <rgomes@octobus.net> [Wed, 30 Sep 2020 18:10:29 +0200] rev 45610
rust: start plugging the dirstate tree behind a feature gate
The previous patch added the `dirstate-tree` feature gate to enable the two
dirstate implementations to co-habit while the tree-based one gets better.
This patch copies over the code that differs, be it because the algorithm
changed or because the borrowing rules are different.
Indeed, `DirstateTree` is not observationally equivalent to the std `HashMap` in
the APIs we use: it does not have the `Entry` API (yet?) and its iterator
returns owned values instead of references. This last point is because the
implementation needs to be changed to a more clever and efficient solution.
Differential Revision: https://phab.mercurial-scm.org/D9133
Raphaël Gomès <rgomes@octobus.net> [Wed, 30 Sep 2020 18:10:53 +0200] rev 45609
rust: introduce `dirstate-tree` cargo feature
This feature gates (at compile-time) the use of the newly-added dirstate tree.
The motivation for this is that the dirstate tree is currently *very* slow;
replacing the current hashmap-based dirstate is not a viable solution in terms
of performance... and why would you be using the Rust implementation if not
for performance?
The feature will also help reviewers better understand the differences that
will slowly appear as the dirstate tree gets better.
Differential Revision: https://phab.mercurial-scm.org/D9132
Raphaël Gomès <rgomes@octobus.net> [Wed, 30 Sep 2020 18:23:43 +0200] rev 45608
rust: fix formatting
Maybe there is a small divergence in the nightly formatter? This didn't seem to
trip the CI.
Differential Revision: https://phab.mercurial-scm.org/D9131
Raphaël Gomès <rgomes@octobus.net> [Wed, 23 Sep 2020 10:02:16 +0200] rev 45607
rust-matchers: make `Matcher` trait object-safe
Before this patch, it is not possible to create a `Matcher` trait-object (like
`Box<dyn Matcher>`), because of the use of a generic parameters in some methods,
namely `impl AsRef<HgPath>`.
While this makes the interface less flexible for callers in theory, it does not
change anything in the current codebase.
Until something like [1] is implemented, this is a "tradeoff" that we need to
make anyway.
[1] https://internals.rust-lang.org/t/pre-rfc-expand-object-safety/12693
Differential Revision: https://phab.mercurial-scm.org/D9071
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Sep 2020 14:07:00 +0200] rev 45606
rust: clippy pass
This removes some justified warnings and one hard error that, while technically
not a bug, was an ugly oversight on my part.
Differential Revision: https://phab.mercurial-scm.org/D9094
Martin von Zweigbergk <martinvonz@google.com> [Mon, 28 Sep 2020 08:07:09 -0700] rev 45605
updaterepo: add deprecation warning
We just moved all in-tree callers off of the function, but we're
leaving it here for a bit to help extension writers.
Differential Revision: https://phab.mercurial-scm.org/D9110
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 16:54:35 +0200] rev 45604
rhg: use `.or(Err(Error))` not `.map_err(|_| Error)` (D9100#inline-15067)
Differential Revision: https://phab.mercurial-scm.org/D9109
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 16:52:35 +0200] rev 45603
hg-core: use `.or(Err(Error))` not `.map_err(|_| Error)` (D9100#inline-15067)
Differential Revision: https://phab.mercurial-scm.org/D9108
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 15:21:56 +0200] rev 45602
hg-core: return Err if `offset != bytes.len()`
(D8958#inline-14994 followup 2/2)
[X] make `Index` owner of its bytes
[X] make `Index::new` return an error if `offset != bytes.len()`
Differential Revision: https://phab.mercurial-scm.org/D9107
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 15:13:51 +0200] rev 45601
hg-core: make `Index` owner of its bytes (D8958#inline-14994 followup 1/2)
Prevent building `Index` every time it is needed. It was a bad idea anyway.
When `Index::new` will return `Result` it will avoid things like `Revlog::len`
returning `Result<usize>` instead of `usize`.
[X] make `Index` owner of its bytes
[ ] make `Index::new` return an error if `offset != bytes.len()`
Differential Revision: https://phab.mercurial-scm.org/D9106
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:33:52 +0200] rev 45600
hg-core: renaming of `Chunk` offset methods (D8958#inline-15002 followup)
Differential Revision: https://phab.mercurial-scm.org/D9105
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:31:58 +0200] rev 45599
hg-core: minor rewording in docstring (D8958#inline-15005 followup)
Differential Revision: https://phab.mercurial-scm.org/D9104
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:29:05 +0200] rev 45598
hg-core: use anonymous lifetime for `impl Chunk` (D8958#inline-15003 followup)
Differential Revision: https://phab.mercurial-scm.org/D9103
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:27:04 +0200] rev 45597
hg-core: use `u32` instead of `i32` in `Chunk` (D8958#inline-15001 followup)
Differential Revision: https://phab.mercurial-scm.org/D9102
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:16:31 +0200] rev 45596
hg-core: use the term `chunk` instead of `frag` (D8958#inline-15000 followup)
Differential Revision: https://phab.mercurial-scm.org/D9101
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:06:23 +0200] rev 45595
hg-core: return `Err` on decompression error (D8958#inline-15004 followup)
Differential Revision: https://phab.mercurial-scm.org/D9100
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 14:01:57 +0200] rev 45594
hg-core: remove useless code (D8958#inline-14988 followup)
Differential Revision: https://phab.mercurial-scm.org/D9099
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 13:55:47 +0200] rev 45593
hg-core: minor docstring update (D8958#inline-14991 followup)
Differential Revision: https://phab.mercurial-scm.org/D9097
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 13:53:11 +0200] rev 45592
hg-core: minor code style change (D8958#inline-14986 followup)
Differential Revision: https://phab.mercurial-scm.org/D9096
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 13:51:16 +0200] rev 45591
hg-core: Explain offset override of first revision
(D8958#inline-14992 followup)
Differential Revision: https://phab.mercurial-scm.org/D9095
Antoine cezar<acezar@chwitlabs.fr> [Mon, 28 Sep 2020 13:46:14 +0200] rev 45590
hg-core: minor code style change (D8958#inline-14993 followup)
Differential Revision: https://phab.mercurial-scm.org/D9083
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 24 Sep 2020 09:32:07 +0200] rev 45589
changing-files: move default constructor value to None
According to Augie Fackler, using tuple as default value confuse PyType when
actual values are passed at init time.
Differential Revision: https://phab.mercurial-scm.org/D9086
Raphaël Gomès <rgomes@octobus.net> [Mon, 28 Sep 2020 11:16:12 +0200] rev 45588
rust: format with rustfmt
I suppose I ran the formatter on the tip but not on every patch.
Differential Revision: https://phab.mercurial-scm.org/D9093
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 24 Aug 2020 15:35:34 +0530] rev 45587
merge: store cases when a file is absent post merge in commitinfo
Some merges can result in file being absent form working directory. This can be
one of file was kept deleted or file was removed by merge code.
User might revert the file back before committing. In such cases we will like to
have better handling and create new filenodes.
We store this info in mergestate as commitinfo so that we can use it while
committing to create new filenode if required.
Differential Revision: https://phab.mercurial-scm.org/D9003
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Sep 2020 15:08:15 +0530] rev 45586
tests: add some more debugmergestate calls in `test-merge-criss-cross.t`
Differential Revision: https://phab.mercurial-scm.org/D9029
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Sep 2020 13:58:14 +0530] rev 45585
commit: force create a new filenode if it was set in mergestate by merge
For reasons mentioned in previous commits, we will like to forcefully create a
new filenode sometimes.
Combination of this patch and previous one, we fixed a case in
`test-merge-combination.t`.
This does not yet results in conflict where it should, I need to investigate
more about what's happening as it should be a change-delete conflict now.
Differential Revision: https://phab.mercurial-scm.org/D8989
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Sep 2020 13:44:06 +0530] rev 45584
merge: store commitinfo if these is a dc or cd conflict
delete-changed or changed-delete conflicts can either be resolved by mergetool,
if some tool is passed and using or by user choose something on prompt or user
doing some `hg revert` after choosing the file to remain conflicted.
If the user decides to keep the changed side, on commit we just reuse the parent
filenode. This is mostly fine unless we are in a distributed environment and
people are doing criss-cross merges.
Since, we don't have recursive merges or any other way of describing the end
result of the merge was an explicit choice and it should be differentiated from
it's ancestors, merge algo during criss-cross merges fails to take in account
the explicit choice made by user and end up with a what-can-be-said-wrong-merge.
The solution which we are trying to fix this is by creating a filenode on commit
instead of reusing the parent filenode. This helps differentiate between
pre-merged filenode and post-merge filenode and kind of tells about the choice
user made.
To implement creating new filenode functionality, we store info about these
files in mergestate so that we can read them on commit and force create a new
filenode.
Differential Revision: https://phab.mercurial-scm.org/D8988
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 25 Sep 2020 13:58:05 +0530] rev 45583
mergestate: update _stateextras instead of reassinging
`merge.applyupdates()` can store extras for a file and _stateextras may not be
empty always. Hence reassigning loses the old values.
We can directly update like this because we switched to using
`collections.defaultdict` for `_stateextras` sometime ago.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Sep 2020 14:11:45 +0530] rev 45582
tests: add some debugmergestate calls in `test-merge-criss-cross.t`
This will help notice the change in upcoming patches much better.
Differential Revision: https://phab.mercurial-scm.org/D9028
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Sep 2020 13:54:46 +0530] rev 45581
tests: add few debugrevlogindex and a log call to see changes in next test
In upcoming patches, we will create a new filenode in couple of cases. Let's add
some debugrevlogindex and a log call so that we can observe those changes
better.
Differential Revision: https://phab.mercurial-scm.org/D8987
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Sep 2020 14:40:12 +0530] rev 45580
merge: disable `m2-vs-ma` optimization if new filenode config is true
The `m2-vs-ma` optimization filters out the file which have not changed between
second parent and the ancestor of the merge. This results in the m1-vs-m2 diff
not processing those files. These files will be required when we are creating
new filenode for salvaged cases as we need to track them to store in mergestate
that file can be salvaged.
Differential Revision: https://phab.mercurial-scm.org/D9027
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 14 Sep 2020 14:31:23 +0530] rev 45579
configitems: add a new config option to control new filenode functionality
This series is adding functionality where we can force create a new filenode for
some files on a merge-commit. This is meant to represent an explicit choice made
by user and hence distingusing the file in the merged commit with the file in
parent by creating a new filenode instead of using the parent one.
This introduces a experimental config option under which this functionality
will be hidden.
A new testcase is added in tests/test-merge-criss-cross.t to test the new
functionality while making the option does not break other scenarios.
Differential Revision: https://phab.mercurial-scm.org/D9026
Connor Sheehan <sheehan@mozilla.com> [Wed, 23 Sep 2020 14:20:49 -0400] rev 45578
git: add test showing `hg commit -i` working on a git repo
Shows `hg commit -i` working on a git repo via the `git`
extension. Adds working directory changes to files `alpha` and
`beta`, then selects only `alpha` changes and commits them.
As of now this would fail for a filename that
includes uppercase characters due to the lack of case folding
support in the extension.
Differential Revision: https://phab.mercurial-scm.org/D9081
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Sep 2020 11:53:44 -0700] rev 45577
merge: replace calls to hg.updaterepo() by merge.update()
The former no longer buys us anything.
Differential Revision: https://phab.mercurial-scm.org/D9067
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Sep 2020 09:57:29 -0700] rev 45576
merge: add a higher-level update() for the common `hg update` use case
This is different from the `update()` function that I just made
private. The new function is specifically for the normal `hg update`
use case. It doesn't do a merge and it doesn't do a clean (forced)
update.
Differential Revision: https://phab.mercurial-scm.org/D9066
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Sep 2020 15:16:35 +0200] rev 45575
sidedata: simply read p2copies files from the `ChangingFiles` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Sep 2020 15:16:16 +0200] rev 45574
sidedata: simply read p1copies files from the `ChangingFiles` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Sep 2020 15:16:01 +0200] rev 45573
sidedata: simply read removed files from the `ChangingFiles` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Sep 2020 15:15:46 +0200] rev 45572
sidedata: simply read added files from the `ChangingFiles` object
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 23 Sep 2020 15:13:44 +0200] rev 45571
sidedata: add a `decode_files_sidedata` function
Right now the function mostly gather existing code to build a consistent object.
However having this function allow us prepare all user code independently from
the actual side data format change (and associated encoding/decoding changes)
Strictly speaking, we could not need to passe the sidedata explicitly since we
have access to it though the `changelogrevision` object. However, the short
term goal is to drop that first parameter to only pass the sidedata binaries.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 15:37:32 +0200] rev 45570
changelog: add a `changes` property on `changelogrevision`
For the sidedata storage we are moving toward "all in one" block containing the
equivalent of a "ChangingFiles" instance. We do various refactoring beforehand
to prepare the usage of theses new data in the code.
Since the object use slots, the "property cache" tricks cannot be used, and we
cache the value manually.
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 22 Sep 2020 10:27:35 +0200] rev 45569
sidedata: rename `encode_copies_sidedata` to `encode_files_sidedata`
We are storing more than copies information, so lets make it clear.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 21:45:37 +0900] rev 45568
log: pass around --rev option by walkopts
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 21:39:58 +0900] rev 45567
log: parse --limit option by logcmdutil.parseopts()
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 21:35:26 +0900] rev 45566
log: pass around --follow/--follow-first options by walkopts
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 21:06:16 +0900] rev 45565
log: introduce struct that carries log traversal options
I tried to refactor logcmdutil.getrevs() without using an options struct,
but none of these attempts didn't work out. Since every stage of getrevs()
needs various log command options (e.g. both matcher and revset query need
file patterns), it isn't possible to cleanly split getrevs() into a command
layer and a core logic.
So, this patch introduces a named struct to carry command options in slightly
abstracted way, which will be later used by "hg grep" and "hg churn". More
fields will be added to the walkopt struct.
Type hints aren't verified. I couldn't figure out how to teach pytype to
load its own attr type stubs in place of our .thirdparty.attr. Conditional
import didn't work. s/^from \.thirdparty // is the only way I found pytype
could parse the @attr.ib decorator.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 16:19:01 +0900] rev 45564
log: remove unused argument from _makerevset()
I want to make getrevs() reusable for other commands, but the dependency graph
of this getrevs() function is a mess. Let's minimize it first.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Sep 2020 16:11:10 +0900] rev 45563
log: remove stale comment about order of user revset
_makerevset() no longer depends on the computed revs since
ea3320015d54 "log:
remove dead code to follow descendants if ascending revisions specified."
Raphaël Gomès <rgomes@octobus.net> [Fri, 25 Sep 2020 17:51:34 +0200] rev 45562
rust: add `dirstate_tree` module
Mercurial needs to represent the filesystem hierarchy on which it operates, for
example in the dirstate. Its current on-disk representation is an unsorted, flat
structure that gets transformed in the current Rust code into a `HashMap`.
This loses the hierarchical information of the dirstate, leading to some
unfortunate performance and algorithmic compromises.
This module adds an implementation of a radix tree that is specialized for
representing the dirstate: its unit is the path component. I have made no
efforts to optimize either its memory footprint or its insertion speed: they're
pretty bad for now.
Following will be a few patches that modify the dirstate.status logic to use
that new hierarchical information, fixing issue 6335 in the same swing.
Differential Revision: https://phab.mercurial-scm.org/D9085
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Oct 2020 19:19:01 +0530] rev 45561
Added signature for changeset
07731064ac41
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Oct 2020 19:18:54 +0530] rev 45560
Added tag 5.5.2 for changeset
07731064ac41
Ludovic Chabant <ludovic@chabant.com> [Tue, 29 Sep 2020 14:38:46 -0700] rev 45559
hgdemandimport: exclude more sqlalchemy modules
We could potentially exclude the entire sqlalchemy library.
Raphaël Gomès <rgomes@octobus.net> [Fri, 24 Jul 2020 16:35:02 +0200] rev 45558
rust-dirstatemap: add #[timed] to dirstatemap read for comparison
Differential Revision: https://phab.mercurial-scm.org/D9084
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Sep 2020 11:12:58 -0700] rev 45557
merge: make low-level update() private (API)
We have very few callers left that call the low-level `merge.update()`
function. I think it's time to make it private. I'll remove the
remaining callers in coming patches, except for one call from the
`rebase` module. I hope to eventually fix that too, but it's more
complex because it requires teaching `merge.graft()` to work with a
dirty working copy.
Differential Revision: https://phab.mercurial-scm.org/D9065
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Sep 2020 10:09:39 -0700] rev 45556
merge: use merge.clean_update() when applicable
We have had this higher-level function (higher than `merge.update()`,
that is) for a while. Let's simply some callers by using it. I don't
know why I didn't do this when I introduced the function.
After this patch, there are no remaining callers that call
`hg.updaterepo()` with `overwrite=True`. We'll clean that up soon.
Differential Revision: https://phab.mercurial-scm.org/D9063
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 15:03:06 -0700] rev 45555
rebase: teach in-memory rebase to not restart with on-disk rebase on conflict
When in-memory rebase runs into conflicts, it redoes the whole rebase
operation. This patch teaches it to instead discard just the current
`overlayworkingctx` and redo that node on disk.
I've tested this by enabling in-memory rebase by default and checking
that there are no unexpected differences after this patch.
The next step is to make it so that `hg rebase --continue` can use
in-memory merge.
Differential Revision: https://phab.mercurial-scm.org/D9076
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Sep 2020 16:30:17 +0200] rev 45554
rust: update Cargo.lock
Differential Revision: https://phab.mercurial-scm.org/D9080
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Sep 2020 16:30:00 +0200] rev 45553
rust-tests: add test to check if `Cargo.lock` is up-to-date
An out-of-date `Cargo.lock` is the source of rebase conflicts, prevents a
reproductible build, introduces desync between the series that introduces a
change in dependencies and the one that eventually commits the `Cargo.lock`,
and is just a general annoyance.
This commit demonstrates that the test works, the next one fixes the
currently out-of-date `Cargo.lock`.
Differential Revision: https://phab.mercurial-scm.org/D9079
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 01 Sep 2020 18:08:24 +0530] rev 45552
scmutil: introduce function to check whether repo uses treemanifest or not
In an upcoming patch, I wanted to check whether current repo uses treemanifest
or not.
I looked for a function and found that at all places we manually check for the
requirement in repo requirements. I guess having a dedicated function for that
is much better.
Differential Revision: https://phab.mercurial-scm.org/D8981
Valentin Gatien-Baron <vgatien-baron@janestreet.com> [Thu, 03 Sep 2020 11:07:47 -0400] rev 45551
chg: make is possible to call by default an hg binary located next to chg
When a single version of hg is in use and it's in the PATH, using chg
is just a matter of calling chg.
But when there are multiple installations of hg+chg around, and hg is
referred to with an absolute path, using chg is more annoying because
it requires both changing the invocation to hg to use chg, but also
setting CHGHG.
Currently, we set HGPATH when we build chg to remove the need to set
CHGHG in the previous paragraph. But that means chg now hardcodes its
installation path, which makes the installation not relocatable. Hence
this proposal to make chg find ./hg relative to itself (as opposed to
CHGHG=./hg which find hg relative to cwd).
This only works on linux as written, but since it's opt-in, it sounds
fine.
Tested by hand, as I'm not sure how else to test this.
Differential Revision: https://phab.mercurial-scm.org/D9006
Joerg Sonnenberger <joerg@bec.de> [Wed, 23 Sep 2020 14:44:21 +0200] rev 45550
phases: fix performance regression with Python 2
Unlike Python 3, xrange doesn't support efficient "in" and uses a linear
time scan instead. Expand the condition to handle it fast.
Differential Revision: https://phab.mercurial-scm.org/D9072
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 09:04:32 -0700] rev 45549
rebase: move check for unresolved conflicts into lower-level rebasenode()
I want to add another call to `rebasenode()` and it's better to not
have to duplicate the check.
Differential Revision: https://phab.mercurial-scm.org/D9075
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 15:40:26 -0700] rev 45548
rebase: add dryrun property to rebaseruntime
I want to be able to check the property in
`rebaseruntime._rebasenode()`. Passing the value via the runtime is a
convenient way.
Differential Revision: https://phab.mercurial-scm.org/D9074
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 09:21:26 -0700] rev 45547
rebase: when collapsing, p1 == dest, so use the former only
`dest` is the destination we're rebasing onto, which is always the
same as `p1` when using `--collapse`. This lets us simplify a bit.
Differential Revision: https://phab.mercurial-scm.org/D9073
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 15:37:03 -0700] rev 45546
rebase: remove redundant isinmemory argument from _origrebase()
The argument is redundant with `rbst.inmemory`, which makes it unclear
what to do if they were somehow different.
Differential Revision: https://phab.mercurial-scm.org/D9070
Martin von Zweigbergk <martinvonz@google.com> [Tue, 22 Sep 2020 23:18:37 -0700] rev 45545
largefiles: prevent in-memory merge instead of switching to on-disk
I enabled in-memory merge by default while testing some changes. I
spent quite some time troubleshooting why largefiles was still
creating an on-disk mergestate. Then I found out that it ignores the
callers `wc` argument to `mergemod._update()` and always uses on-disk
merge. This patch changes that so we raise an error if largefiles is
used with in-memory merge. That way we'll notice if in-memory merge is
used with largefiles instead of silently replacing ignoring the
`overlayworkingctx` instance and updating the working copy instead.
I felt a little bad that this would break things more for users with
both largefiles and in-memory rebase enabled. So I also added a
higher-level override to make sure that largefiles disables in-memory
rebase. It turns out that that fixes `run-tests.py -k largefiles
--extra-config-opt rebase.experimental.inmemory=1`.
Differential Revision: https://phab.mercurial-scm.org/D9069
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Sep 2020 09:56:48 -0700] rev 45544
merge: add a back_out() function to encapsulate update()
I've sent several earlier patches adding `merge.clean_update()`,
`merge.merge()` etc, one function for each use case. This patch
continues that work. I plan to hide the complex `update()` eventually.
Differential Revision: https://phab.mercurial-scm.org/D9064
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 18 Sep 2020 17:19:49 +0530] rev 45543
tests: update test-share-safe to work with non-zstd versions
zstd is not available always like pure py versions. Hence we wrap that part
around `#if zstd`. To make sure the functionality is tested on pure version
as well, I have added another requirement addition test.
Differential Revision: https://phab.mercurial-scm.org/D9045
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 15 Sep 2020 16:51:11 +0200] rev 45542
rhg: add a limited `rhg cat -r` subcommand
It only supports revision specification (rev or full hash) and the list of files
to cat.
Differential Revision: https://phab.mercurial-scm.org/D9052
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 11 Sep 2020 17:32:53 +0200] rev 45541
hg-core: add a `CatRev` operation
Differential Revision: https://phab.mercurial-scm.org/D9051
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 15 Sep 2020 16:46:57 +0200] rev 45540
hg-core: add `files_with_nodes` to `Manifest`
Differential Revision: https://phab.mercurial-scm.org/D9050
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 15 Sep 2020 16:45:27 +0200] rev 45539
hg-core: add path_encode
Differential Revision: https://phab.mercurial-scm.org/D9049
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 15 Sep 2020 10:52:28 +0200] rev 45538
hg-core: impl TryFrom<PathBuff> for HgPathBuf
Differential Revision: https://phab.mercurial-scm.org/D9048
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 09 Sep 2020 14:53:15 +0200] rev 45537
rhg: add `--revision` argument to `rhg files`
Add the option to list the tracked files of a revision given its number
or full node id.
Benched on a clone of moz-central
where tip is 1671467:
81deaa1a68ebb28db0490954034ab38ab269409d
files -r
81deaa1a68ebb28db0490954034ab38ab269409d > out.txt
hg 0m1.633s
rhg 0m0.157s
files -r
81deaa1a68ebb28db0490954034ab38ab269409d > /dev/null
hg 0m0.415s
rhg 0m0.143s
Differential Revision: https://phab.mercurial-scm.org/D9015
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 18 Sep 2020 16:52:16 +0200] rev 45536
hg-core: add a `ListRevTrackedFiles` operation
List files tracked at a given revision.
Differential Revision: https://phab.mercurial-scm.org/D9014
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 09 Sep 2020 12:12:11 +0200] rev 45535
hg-core: simplify `list_tracked_files` operation
Use directly `ListDirstateTrackedFiles` rather than having an operation builder.
Differential Revision: https://phab.mercurial-scm.org/D9013
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 18 Sep 2020 16:52:08 +0200] rev 45534
hg-core: add `Revlog.get_node_rev`
Find the revision of a node given its full hash.
Differential Revision: https://phab.mercurial-scm.org/D9012
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 09 Sep 2020 14:50:58 +0200] rev 45533
hg-core: add `Manifest` a specialized `Revlog`
A facade to `Revlog` to provide a `manifest` specific interface.
Differential Revision: https://phab.mercurial-scm.org/D9011
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 09 Sep 2020 16:25:23 +0200] rev 45532
hg-core: add `Changlog` a specialized `Revlog`
A facade to `Revlog` to provide a `changelog` specific interface.
Differential Revision: https://phab.mercurial-scm.org/D9010
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 02 Sep 2020 15:23:25 +0200] rev 45531
hg-core: check data integrity in `Revlog`
Check that the hash of the data reconstructed from deltas
matches the hash stored in the revision.
Differential Revision: https://phab.mercurial-scm.org/D9005
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 23 Sep 2020 12:26:16 +0200] rev 45530
rhg: Add debug timing
Differential Revision: https://phab.mercurial-scm.org/D8962
Antoine Cezar <antoine.cezar@octobus.net> [Mon, 17 Aug 2020 16:56:39 +0200] rev 45529
rhg: add a limited `rhg debugdata` subcommand
Differential Revision: https://phab.mercurial-scm.org/D8961
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 09 Sep 2020 12:07:05 +0200] rev 45528
rhg: add a `DebugData` `Command` to prepare the `rhg debugdata` subcommand
Differential Revision: https://phab.mercurial-scm.org/D8960
Antoine Cezar <antoine.cezar@octobus.net> [Thu, 13 Aug 2020 16:22:15 +0200] rev 45527
hg-core: define a `DebugData` `Operation`
Read the content of a `revlog` at a given revision.
Differential Revision: https://phab.mercurial-scm.org/D8959
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 04 Sep 2020 11:55:07 +0200] rev 45526
hg-core: Add a limited read only `revlog` implementation
Only covers the needs of the upcoming `rhg debugdata` command.
Differential Revision: https://phab.mercurial-scm.org/D8958
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Sep 2020 18:09:32 +0530] rev 45525
mergestate: define NO_OP_ACTION in module scope instead of inside mergeresult
This makes sure it isn't intended to be overridden by subclasses.
Thanks to Yuya for the nice suggestion.
Differential Revision: https://phab.mercurial-scm.org/D9025
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 09 Sep 2020 16:49:19 +0530] rev 45524
mergestate: introduce a new ACTION_KEEP_NEW
`ACTION_KEEP` is overloaded and it's hard to figure out how we end up with this
KEEP, what was the state of things.
In a previous patch, we introduced `ACTION_KEEP_ABSENT` which represents files
which are kept absent in the working directory.
There is another special case where we keep the file when it's not present on
both ancestor and remote side. We introduce a dedicated action for that.
The goal is to use these information to make bid merge smarter.
Differential Revision: https://phab.mercurial-scm.org/D9002
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 15:36:15 -0700] rev 45523
repoview: don't crash if mergestate points to non-existent node
Differential Revision: https://phab.mercurial-scm.org/D9078
Martin von Zweigbergk <martinvonz@google.com> [Wed, 23 Sep 2020 16:07:14 -0700] rev 45522
tests: demonstrate crash caused by pinning of non-existent mergestate node
If the mergestate somehow contains a reference to a non-existent node,
it causes most commands to crash since
aaeccdb6e654 (repoview: pin
revisions for `local` and `other` when a merge is active,
2020-09-04). This patch adds a test showing that.
Differential Revision: https://phab.mercurial-scm.org/D9077
Augie Fackler <augie@google.com> [Mon, 21 Sep 2020 10:23:25 -0400] rev 45521
git: also convert timezone to int (
issue6359)
Credit to moshez for testing this in the wild.
Differential Revision: https://phab.mercurial-scm.org/D9062