Pulkit Goyal <7895pulkit@gmail.com> [Tue, 01 Sep 2020 18:08:24 +0530] rev 45558
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 45557
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 45556
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 45555
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 45554
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 45553
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 45552
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 45551
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 45550
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 45549
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 45548
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 45547
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 45546
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 45545
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 45544
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 45543
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 45542
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 45541
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 45540
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 45539
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 45538
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 45537
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 45536
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 45535
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 45534
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 45533
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 45532
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 45531
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 45530
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
Augie Fackler <augie@google.com> [Mon, 21 Sep 2020 10:23:25 -0400] rev 45529
git: also convert timezone to int (issue6359)
Credit to moshez for testing this in the wild.
Differential Revision: https://phab.mercurial-scm.org/D9062
Jun Wu <quark@fb.com> [Fri, 18 Sep 2020 16:26:37 -0700] rev 45528
chg: fallback to original hg if stdio fds are missing
If stdio fds are missing (ex. fd 0 is not present), chg might open
fds that take the numbers 0, and attachio would send the wrong fds
to the client, which might cause unwanted behaviors. Avoid that by
detecting the missing fds and falling back to the original hg.
Differential Revision: https://phab.mercurial-scm.org/D9058
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 08:27:43 -0700] rev 45527
locking: remove support for inheriting locks in subprocess
This seems to have been added for merge driver, and since merge driver
is now gone...
Differential Revision: https://phab.mercurial-scm.org/D9053
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 22:34:36 -0700] rev 45526
mergedriver: delete it
The merge driver code was added in late 2015. I think
'406a654b::6f045b56 & user("sid0")' is a reasonable revset for finding
the relevant commits, including preparation for it. The code is very
poorly tested, which makes it very hard to maintain. It seems it's
only used by FB and they don't use this code base anymore, so let's
remove the code to make it easier for us to maintain our product.
Differential Revision: https://phab.mercurial-scm.org/D9041
Raphaël Gomès <rgomes@octobus.net> [Sun, 06 Sep 2020 10:33:12 +0200] rev 45525
rust-cpython: switch logging facade from `simple_logger` to `env_logger`
`simple_logger` is just too simple. `env_logger` supports logging to `stderr`,
and logging filtering, for example, which are becoming necessary now. The
project is nicely active.
Differential Revision: https://phab.mercurial-scm.org/D8990
Connor Sheehan <sheehan@mozilla.com> [Tue, 22 Sep 2020 09:06:09 -0400] rev 45524
git: pass `id` attribute of `pygit2.Tree` object
`pygit2`'s Repository object expects an instance of `Oid`
to return the corresponding object, instead of the object
itself.
After this change and D9062, `hg commit -i` seems to work,
unless it hits a case folding assertion (ie trying to add
a file like `README.md`).
Differential Revision: https://phab.mercurial-scm.org/D9068
Kyle Lippincott <spectral@google.com> [Wed, 16 Sep 2020 12:13:46 -0700] rev 45523
branchmap: add a cache validation cache, avoid expensive re-hash on every use
In a pathological `hg log` case, we end up executing the branchmap validity
checking twice per commit displayed. Or maybe we always do, and I just noticed
because it's really slow in this repo for some reason.
Before:
```
Time (mean ± σ): 9.816 s ± 0.071 s [User: 9.435 s, System: 0.392 s]
Range (min … max): 9.709 s … 9.920 s
```
After:
```
Time (mean ± σ): 8.671 s ± 0.078 s [User: 8.309 s, System: 0.392 s]
Range (min … max): 8.594 s … 8.816 s
```
Differential Revision: https://phab.mercurial-scm.org/D9023
Augie Fackler <augie@google.com> [Mon, 21 Sep 2020 15:05:38 -0400] rev 45522
merge with stable
Antoine cezar<acezar@chwitlabs.fr> [Wed, 16 Sep 2020 19:32:53 +0200] rev 45521
run-test: allow relative path in `--blacklist` and `--whitelist` (issue6351)
When specifying a test with `--blacklist` or `--whitelist` with path relatives
to the repository root (eg: `tests/test-check-commit.t`) the file is not taken
into account. It only works when the name of the test is given.
It would be better if `--blacklist` and `--whitelist` behaviors where compatible
with `--test-list`.
This patch allows to use relative path with `--blacklist` and `--whitelist`
while staying compatible with the old behavior by checking the test relative
path in addition to its name.
Differential Revision: https://phab.mercurial-scm.org/D9024
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 15:10:14 -0700] rev 45520
rebase: stop clearing on-disk mergestate when running in memory
In-memory merge no longer uses on-disk mergestate since 19590b126764
(merge: use in-memory mergestate when using in-memory context,
2020-09-15). This patch removes the clearing from two places in the
in-memory rebase code. I've verified that the one with a TODO was
indeed fixed by the aforementioned commit. The other instance doesn't
seem to have any test coverage, but I'm pretty confident it's also
safe to remove.
Differential Revision: https://phab.mercurial-scm.org/D9057
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 10:15:13 -0700] rev 45519
rebase: delete unused p1 argument to _concludenode()
Unused since a0192a03216d (rebase: remove now unnecessary logic to
allow empty commit when branch changes, 2020-07-09).
Differential Revision: https://phab.mercurial-scm.org/D9055
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Sep 2020 10:04:02 -0700] rev 45518
rebase: fix an inconsistent hyphenation in a debug message
We used "rebasing on disk" but "rebasing in-memory". I believe the
former is correct, so I used that.
Differential Revision: https://phab.mercurial-scm.org/D9054
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 15 Sep 2020 15:03:07 +0200] rev 45517
changing-files: implement equality checking
This makes debugging simpler.
Pierre-Yves David <pierre-yves.david@octobus.net> [Thu, 17 Sep 2020 11:21:13 +0200] rev 45516
changing-files: document the various sets
The content of some sets (eg: added, removed) is not always obvious so we
document them.
Augie Fackler <augie@google.com> [Fri, 18 Sep 2020 10:48:43 -0400] rev 45515
merge with stable
Yuya Nishihara <yuya@tcha.org> [Fri, 18 Sep 2020 20:19:52 +0900] rev 45514
share: do not write working-copy requirements twice
Follows up d252f51ab032. Maybe it is a copy-paste error.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 22:45:51 -0700] rev 45513
phabricator: fix loadhgrc() override broken by D8656
This fixes some failing `test-check*` tests (at least
`test-check-code.t` was broken).
Differential Revision: https://phab.mercurial-scm.org/D9044
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 23:09:47 -0700] rev 45512
mergestate: move commit() from base class to on-disk subclass
The commit message doesn't do anything in the in-memory case, and it's
`_makerecords()` is also not needed in that case, so let's move it
down to the on-disk subclass (i.e. the `mergestate` class). Sorry I
missed this earlier.
Differential Revision: https://phab.mercurial-scm.org/D9043
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 23:12:48 -0700] rev 45511
mergestate: make in-memory mergestate not clear on-disk mergestate on reset()
Oops, I thought I had remove the `rmtree()` call earlier. Maybe I
accidentally got it back in a histedit or something.
Differential Revision: https://phab.mercurial-scm.org/D9042
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 16:10:16 -0700] rev 45510
merge: use in-memory mergestate when using in-memory context
This is my version of Augie's D8568. It makes it so we don't touch the
mergestate on disk when using an in-memory context.
The reason that I want this is not the same as the reason that Augie
write his patch (though I agree with that reason too). My hope is to
make in-memory rebase not fall back to on-disk rebase when there are
conflict. I plan to do that by adding a
`overlayworkingctx.reflect_in_workingcopy()`. The idea is that that
will update the working copy, the dirstate and the mergestate as
necessary.
Differential Revision: https://phab.mercurial-scm.org/D9040
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 11:17:24 -0700] rev 45509
mergestate: extract a base class to be shared by future memmergestate
This extracts a new base class from `mergestate` and leaves all the
vfs-touching code in `mergestate`.
Differential Revision: https://phab.mercurial-scm.org/D9039
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 11:33:26 -0700] rev 45508
mergestate: extract overridable methods for making/restoring file backups
In-memory merge currently still uses on-disk mergestate. That's mostly
harmless (I don't think I've seen any problem it's actually
caused). It's still a little weird. I'm planning to add an in-memory
mergestate, which will be used with `overlayworkingctx`. This patch
prepares for that by extracting that logic, so it's easier to change
per subclass.
Differential Revision: https://phab.mercurial-scm.org/D9038
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 13:39:26 -0700] rev 45507
mergestate: initialize all properties in __init__()
This is hopefully not very controverial. I found the initialization
before this patch unorthodox. It wasn't clear which properties the
object was supposed to have.
Differential Revision: https://phab.mercurial-scm.org/D9037
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 19:33:55 -0700] rev 45506
mergestate: remove unnecessary clearing of `localctx` and `otherctx`
As noted in the previous commit, there are no callers that (re-)use
the instance after calling `reset()`. There are also no callers that
call `_read()` after doing anything with the instance (it's only
called right after an instance is created).
If reviewers feel that this is too risky, I can extract and reuse the
poisoning code that indygreg once added for poisining repo instances.
Differential Revision: https://phab.mercurial-scm.org/D9036
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 13:25:49 -0700] rev 45505
mergestate: move most of of reset() into start()
`ms.reset()` has somehow become a combination of two different things:
1. A constructor-like function creating an empty instance
2. A call to `shutil.rmtree()` to clear the mergestate.
It seems that all callers now care only about the latter (since we
changed one caller to use the new `ms.start()` method instead). Let's
move the code for the former into `start()`, since that's the only
place it's needed.
Differential Revision: https://phab.mercurial-scm.org/D9035
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 09:23:21 -0700] rev 45504
mergestate: make clean() only be about creating a clean mergestate
This is similar to the previous patch, but moves the separation one
step further out, to `merge.py`.
Differential Revision: https://phab.mercurial-scm.org/D9034
Martin von Zweigbergk <martinvonz@google.com> [Wed, 16 Sep 2020 10:09:37 -0700] rev 45503
mergestate: split up reset() for its two use cases
We only have one place that calls `ms.reset()` with any
arguments. That place is `mergestate.clean()`. The callers that call
the function with no arguments seem to all just want delete the
mergestate -- none of them look at the instance after calling
`reset()`. Let's separate out the two different use cases to make the
code clearer. I'll clean up further soon.
Differential Revision: https://phab.mercurial-scm.org/D9033
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 23:19:14 -0700] rev 45502
mergestate: simplify reset(), knowing that `other` and `node` go together
There's only one caller of `reset()` that passes any arguments at all,
and that originates from `merge.py:1371`. That code always passes
values for both `node` and `other`.
Differential Revision: https://phab.mercurial-scm.org/D9032
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Sep 2020 22:40:26 -0700] rev 45501
mergestate: make some callers not pass pointless node argument
The node argument is set on the created `mergestate` instance, but
these callers don't even look at that instance.
Differential Revision: https://phab.mercurial-scm.org/D9031
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Sep 2020 09:56:05 -0700] rev 45500
py3: don't risk passing a None value to error.ManifestLookupError()
This makes the test case added in 20dd2a259b0f (test-grep: add tests
for --follow with/without --diff and/or paths, 2020-09-11) pass on
Python 3.
Differential Revision: https://phab.mercurial-scm.org/D9030
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Sep 2020 13:25:29 +0530] rev 45499
merge: move initial handling of mergeactions near to later one
We build `mergeactions` in the beginning and use it in end. Let's build it just
before where it will be used. Helps making code much easier to understand.
Differential Revision: https://phab.mercurial-scm.org/D8983