Raphaël Gomès <rgomes@octobus.net> [Wed, 07 Jul 2021 15:09:26 +0200] rev 47564
test-run-tests: add missing backslash for Windows
Differential Revision: https://phab.mercurial-scm.org/D11004
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Jun 2021 12:54:55 +0200] rev 47563
windows: use cpu-intensive task instead of real time in test
Windows profiling breaks when using real time instead of cpu, but we need the
extension function to show up, so make it do something instead of waiting.
I've also duplicated the test cases so that explicit real and CPU times are
tested (on platforms other than Windows)
Differential Revision: https://phab.mercurial-scm.org/D11003
Raphaël Gomès <rgomes@octobus.net> [Thu, 24 Jun 2021 12:51:53 +0200] rev 47562
windows: use shell function instead of variable substitution
This makes it compatible with Windows
Differential Revision: https://phab.mercurial-scm.org/D11002
Raphaël Gomès <rgomes@octobus.net> [Tue, 06 Jul 2021 10:51:41 +0200] rev 47561
compat: normalise path before comparison in revlog splitting test
This fixes the test on Window.
Differential Revision: https://phab.mercurial-scm.org/D10999
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Jul 2021 15:55:15 +0200] rev 47560
windows: replicate the normalizing behavior of os.environ
On Windows, `os.environ` normalizes environment variables to uppercase. Our
current bytes-based environ substitution object is a simple dict, so we add
the normalization behavior.
This fixes test-http-peer.t on Windows.
Differential Revision: https://phab.mercurial-scm.org/D10998
Raphaël Gomès <rgomes@octobus.net> [Thu, 08 Jul 2021 15:55:04 +0200] rev 47559
encoding: move case-related utils up
This will be useful for the next commit that needs this code earlier.
Differential Revision: https://phab.mercurial-scm.org/D11024
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:24:15 +0200] rev 47558
dirstate: drop the last explicit `state` usage in the module
The internal detail of the `state` bytes is not longer exposed to the dirstate
layer.
Differential Revision: https://phab.mercurial-scm.org/D10977
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Jul 2021 20:20:37 +0200] rev 47557
test: use a python script in `test-transaction-rollback-on-sigpipe.t`
This still does not work on Windows, but at least this is a python script now.
Differential Revision: https://phab.mercurial-scm.org/D10947
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Jul 2021 20:53:23 +0200] rev 47556
test: make sure we hit the SIGPIPE in test-transaction-rollback-on-sigpipe
With a coming change, we might not hit the sig pipe without issue and extra line
of output. We do this early to make the next change clearer.
Differential Revision: https://phab.mercurial-scm.org/D10946
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Jul 2021 20:22:56 +0200] rev 47555
test: clarify some output in `test-transaction-rollback-on-sigpipe`
We don't want a dirty transaction to remain, but need to check the transaction
was aborted. Otherwise it is easy to have no abandoned transaction if the
transaction succeed.
Differential Revision: https://phab.mercurial-scm.org/D10945
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Jun 2021 13:58:18 -0700] rev 47554
tests: add test case for issue 6262
If you split a commit, prune one of the sides, and then try to revive
that commit by adding a successor, it will incorrectly be considered
divergence.
Differential Revision: https://phab.mercurial-scm.org/D10916
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Jun 2021 14:02:34 -0700] rev 47553
rewriteutil: look up common predecessor on unfiltered repo
Before this patch, the code looking for divergence could crash when
tried to look up a common predecessor in the filtered repo. This patch
fixes that by looking up the common predecessor in an unfiltered repo.
Differential Revision: https://phab.mercurial-scm.org/D10917
Martin von Zweigbergk <martinvonz@google.com> [Wed, 07 Jul 2021 10:07:28 -0700] rev 47552
tests: demonstrate crash when common predecessor of divergence is hidden
Differential Revision: https://phab.mercurial-scm.org/D11009
Augie Fackler <augie@google.com> [Wed, 07 Jul 2021 11:48:08 -0400] rev 47551
shallowutil: dedent code after the previous change
Differential Revision: https://phab.mercurial-scm.org/D11008
Augie Fackler <augie@google.com> [Wed, 07 Jul 2021 11:47:02 -0400] rev 47550
shallowutil: narrow scope of try/except block
This will make this code easier to understand in the future.
Differential Revision: https://phab.mercurial-scm.org/D11007
Augie Fackler <augie@google.com> [Wed, 07 Jul 2021 11:45:17 -0400] rev 47549
remotefilelog: stop using RuntimeError for control flow
We introduce a new exception to handle the various failure categories,
rather than relying on RuntimeError.
Differential Revision: https://phab.mercurial-scm.org/D11006
Augie Fackler <augie@google.com> [Wed, 07 Jul 2021 13:20:47 -0400] rev 47548
remotefilelog: tweak corrupt cache test to grep more flexibly
I'm about to fix the abuse of RuntimeError here, which breaks the test
if I don't do this.
Differential Revision: https://phab.mercurial-scm.org/D11005
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 06:39:29 +0200] rev 47547
dirstatenonnormalcheck: fix some bytes formating on python3
Passing any object to `%s` no longer works, we need to explicitely convert the
representation to bytes.
Differential Revision: https://phab.mercurial-scm.org/D10993
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 06:38:58 +0200] rev 47546
dirstate-item: use the properties in `contrib/dirstatenonnormalcheck.py`
Differential Revision: https://phab.mercurial-scm.org/D10991
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 06:27:26 +0200] rev 47545
dirstate-item: use the properties in largefiles
I am now sure what large file is doing with then, but at least it is no longer
using the tuple API to access data.
Differential Revision: https://phab.mercurial-scm.org/D10990
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 06:45:32 +0200] rev 47544
dirstate-item: use the `state` property in debugpathcomplete
Ideally we would use narrower property, but this is a good start.
Differential Revision: https://phab.mercurial-scm.org/D10989
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 06:24:51 +0200] rev 47543
dirstate-item: use the properties in fakedirstatewritetime
Differential Revision: https://phab.mercurial-scm.org/D10987
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 03:58:38 +0200] rev 47542
dirstate-item: use the properties in dirstatemap
Differential Revision: https://phab.mercurial-scm.org/D10986
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 03:57:40 +0200] rev 47541
dirstate-item: use the properties in pathutil
Differential Revision: https://phab.mercurial-scm.org/D10985
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 05 Jul 2021 03:57:11 +0200] rev 47540
dirstate-item: use need_delay when packing dirstate
Differential Revision: https://phab.mercurial-scm.org/D10984
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 22:27:29 +0200] rev 47539
dirstate-item: rename the class to DirstateItem
The object is no longer a tuple, so it seems clearer to rename it (and its
associated method)
Differential Revision: https://phab.mercurial-scm.org/D10982
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:37:38 +0200] rev 47538
dirstate-entry: add a `mtime` property
This is clearer than "tuple" indexing.
Differential Revision: https://phab.mercurial-scm.org/D10981
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:34:24 +0200] rev 47537
dirstate-entry: add a `size` property
This is clearer than "tuple" indexing.
Differential Revision: https://phab.mercurial-scm.org/D10980
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:33:21 +0200] rev 47536
dirstate-entry: add a `mode` property
This is clearer than "tuple" indexing.
Differential Revision: https://phab.mercurial-scm.org/D10979
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:28:08 +0200] rev 47535
dirstate: no longer pass `oldstate` to the `dropfile`
The `oldstate` value come literally from `_map` so we don't need to pass tha
information along.
Differential Revision: https://phab.mercurial-scm.org/D10978
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:21:59 +0200] rev 47534
dirstate: drop last explicite `state` usage in status
Given that the previous conditional we can safely use `tracked` here.
Differential Revision: https://phab.mercurial-scm.org/D10976
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:15:41 +0200] rev 47533
dirstate: reorder "state" checking conditional
This is easier to read and will make this simpler to update in the next
changeset.
Differential Revision: https://phab.mercurial-scm.org/D10975
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:13:53 +0200] rev 47532
dirstate-entry: add a `need_delay` method
This abstract the internal processing need for entry that would have an
ambiguous mtime (If I understand things correctly).
Differential Revision: https://phab.mercurial-scm.org/D10974
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 02:12:54 +0200] rev 47531
dirstate-entry: add a `tracked` property
This abstract the individual `state` value and has a clear semantic.
Differential Revision: https://phab.mercurial-scm.org/D10973
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:59:41 +0200] rev 47530
dirstate: drop `state` to `_addpath`
All its value are inferred within the dirstatemap now.
Differential Revision: https://phab.mercurial-scm.org/D10972
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:58:03 +0200] rev 47529
dirstate: infer the 'n' state from `from_p2`
This flag is only used with 'n' so lets set the state based on that parameter in
this case.
Differential Revision: https://phab.mercurial-scm.org/D10971
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:57:28 +0200] rev 47528
dirstate: infer the 'n' state from `possibly_dirty`
This flag is only used with 'n' so lets set the state based on that parameter in
this case.
Differential Revision: https://phab.mercurial-scm.org/D10970
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:48:11 +0200] rev 47527
dirstate: use a `merged` parameter to _addpath
Differential Revision: https://phab.mercurial-scm.org/D10969
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:44:43 +0200] rev 47526
dirstate-entry: add a `added` property
Lets use more semantic property instead of the `state` implementation details.
Differential Revision: https://phab.mercurial-scm.org/D10968
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:42:10 +0200] rev 47525
dirstate: use a `added` parameter to _addpath
My next target are the explicit `state` byte, so let start with abstracting
their initial storage.
Differential Revision: https://phab.mercurial-scm.org/D10967
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 20:59:26 +0200] rev 47524
dirstate: no longer pass the `oldstate` value to the dirstatemap
The dirstatemap already have this information.
Differential Revision: https://phab.mercurial-scm.org/D10966
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 20:57:44 +0200] rev 47523
dirstate: stop using `oldstate` in `dirstate._addpath`
We don't need to pass the oldstate around, so lets use the new property
instead.
Differential Revision: https://phab.mercurial-scm.org/D10965
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 20:53:52 +0200] rev 47522
dirstate: drop the now unused magic constants for the dirstate module
We no longer need them for the dirstate logic. We only need them in the
dirstate map (and parsers) logic.
This smell like progress.
Differential Revision: https://phab.mercurial-scm.org/D10964
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 20:23:19 +0200] rev 47521
dirstate: move the handling of special case within the dirstatemap
The dirstatemap is as well, if not better, suited to decided how to encode the
various case. So we move the associated code in the dirstatemap `addfile`
method.
This means the dirstate no longer need to know about the various magic value
used in the dirstate V1 format.
The pain of the messy API start to be quite palpable in Rust, we should clean
this up once the current large refactoring is dealt with.
Differential Revision: https://phab.mercurial-scm.org/D10963
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 20:41:27 +0200] rev 47520
rust: bump rust-cpython version for 0.6.0
That function as a nice `is_none` method on `PyObject` that we will put to use.
Differential Revision: https://phab.mercurial-scm.org/D10962
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 20:40:10 +0200] rev 47519
rust-dirstate: make the MTIME_UNSET public
We will use it in the cpython layer soon.
Differential Revision: https://phab.mercurial-scm.org/D10961
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 19:42:03 +0200] rev 47518
rust-dirstatemap: expand the wrapping code a bit
This is easier to read.
Differential Revision: https://phab.mercurial-scm.org/D10960
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 01:14:15 +0200] rev 47517
dirstate-entry: restrict `from_p2` property to tracked file
The other case is now handled in `from_p2_removed`, and should ideally be moved
to a lower level. So we can drop the `state == 'n'` narrowing and move it in the
property itself.
Differential Revision: https://phab.mercurial-scm.org/D10959
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 20:34:09 +0200] rev 47516
dirstate-entry: `merged_removed` and `from_p2_removed` properties
Lets start to define and use more semantic property. These two might be a bit
too low level and could be shaved off later, however this seems an improvement
for now.
Differential Revision: https://phab.mercurial-scm.org/D10958
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 04:18:54 +0200] rev 47515
dirstate-entry: add a `removed` property
Lets start to define and use more semantic property.
Differential Revision: https://phab.mercurial-scm.org/D10957
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 04:26:28 +0200] rev 47514
dirstate-entry: add a `from_p2` property
Lets start to define and use more semantic property.
Differential Revision: https://phab.mercurial-scm.org/D10956
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 04:07:21 +0200] rev 47513
dirstate-entry: add a `merged` property
Lets start to define and use more semantic property.
Differential Revision: https://phab.mercurial-scm.org/D10955
Pierre-Yves David <pierre-yves.david@octobus.net> [Sun, 04 Jul 2021 03:29:20 +0200] rev 47512
dirstate-entry: add a `state` property (and use it)
This replace the [0] access. Ultimately is we should probably get ride of this
in its current form. However this is a good transitional solution to move away
for tuple indexing for now.
Differential Revision: https://phab.mercurial-scm.org/D10954
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 19:52:00 +0200] rev 47511
dirstate: move most of the `remove` logic with dirstatemap `removefile`
This code deal with special logic to preserving "merged" and "from_p2" information when removing a file. These are implementation details that are more suitable for the dirstatemap layer. Since the dirstatemap layer alreaday have most of the information necessary to do so, the move is easy.
This move helps us to encapsulate more implementation details within the dirstatemap and its entry. Easing the use of a different storage for dirstate v2.
Differential Revision: https://phab.mercurial-scm.org/D10953
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 20:12:46 +0200] rev 47510
dirstate: add a `in_merge` property
This factor the "p2 is not null" check and is fairly simpler to read.
Differential Revision: https://phab.mercurial-scm.org/D10952
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 04:01:17 +0200] rev 47509
dirstate-entry: introduce dedicated accessors for v1 serialization
In the spirit of changing the content and storage of the dirstate entry, we add
new method that the code doing v1 serialisation can use.
Adding such method to the C object is quite trivial.
Differential Revision: https://phab.mercurial-scm.org/D10951
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 03:55:23 +0200] rev 47508
dirstate-entry: goes through the `dirstatetuple` constructor in all cases
We need to make sure we build an object.
Differential Revision: https://phab.mercurial-scm.org/D10950
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 03 Jul 2021 03:48:35 +0200] rev 47507
dirstate-entry: turn dirstate tuple into a real object (like in C)
With dirstate V2, the stored information and actual format will change. This mean we need to start an a better abstraction for a dirstate entry that a tuple directly accessed.
By chance, the C code is already doing this and pretend to be a tuple. So it
should be fairly easy. We start with turning the tuple into an object, we will
slowly migrate the dirstate code to no longer use the tuple directly in later
changesets.
Differential Revision: https://phab.mercurial-scm.org/D10949
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Jul 2021 02:27:48 +0200] rev 47506
dirstate: split dirstatemap in its own file
The dirstate file is large enough and the dirstatemap is quite insulated logic
already.
Differential Revision: https://phab.mercurial-scm.org/D10934
Pierre-Yves David <pierre-yves.david@octobus.net> [Fri, 02 Jul 2021 23:09:44 +0200] rev 47505
run-tests: stop writing a `python3` symlink pointing to python2
Having `python3` actually pointing to `python2` is bad. So we stop doing so.
In addition we need to re-introduce a `python` executable since some of the
script really need to be able to say "current python" in their shbang. For
example, `hghave` is one of such script.
The faulty changes where introduced by c102b704edb5.
Differential Revision: https://phab.mercurial-scm.org/D10943