[Bug 6514] New: hg status --include with regex does not work correctly with Rust extensions

2021-05-03 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6514 Bug ID: 6514 Summary: hg status --include with regex does not work correctly with Rust extensions Product: Mercurial Version: stable branch Hardware: All

Failed pipeline for branch/default | mercurial-devel | 9dbade55

2021-05-03 Thread Heptapod
Pipeline #21533 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/default ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default ) Commit: 9dbade55 (

mercurial@47060: 3 new changesets (2 on stable)

2021-05-03 Thread Mercurial Commits
3 new changesets (2 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/381a10ef6a4a changeset: 47058:381a10ef6a4a branch: stable parent: 47056:067f2c53fb24 user:Pulkit Goyal <7895pul...@gmail.com> date:Mon May 03 22:52:56 2021 +0530 summary: Added

D10633: tests: ensure `$PYTHON` is quoted for Windows

2021-05-03 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Global installs of python3 go into "Program Files", and tons of tests fail with mysterious errors if this isn't quoted. Most of this is a followup to

D10637: tests: change the fixer commands to use the buffer attribute on stdio objects

2021-05-03 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Otherwise `\r` was getting injected into the fixed lines and throwing off the commit hashes on Windows when the fixer is invoked with py3. REPOSITORY rHG

D10634: tests: run python script through quoted interpreter instead of directly

2021-05-03 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This helps Windows when python is installed to %PROGRAMFILES%. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL

D10636: tests: stabilize test-persistent-nodemap.t on Windows

2021-05-03 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Several issues here: - Hooks can't invoke shell scripts on Windows, so use `sh` to launch - `dd` in MSYS only recognizes `status=noxfer` - The `PATH`

D10635: tests: invoke some shell scripts through the shell interpreter for Windows

2021-05-03 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Otherwise, Windows was prompting what program to use to open the file (or just opening it if there was a file association configured). REPOSITORY rHG

mercurial@47057: new changeset

2021-05-03 Thread Mercurial Commits
New changeset in mercurial: https://www.mercurial-scm.org/repo/hg/rev/7431f5ab0d2a changeset: 47057:7431f5ab0d2a bookmark:@ tag: tip parent: 47043:12450fbea288 parent: 47056:067f2c53fb24 user:Raphaël Gomès date:Mon May 03 18:55:19 2021 +0200 summary:

Failed pipeline for branch/default | mercurial-devel | e5f7bd5c

2021-05-03 Thread Heptapod
Pipeline #21529 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/default ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default ) Commit: e5f7bd5c (

mercurial@47056: 45 new changesets (16 on stable)

2021-05-03 Thread Mercurial Commits
45 new changesets (16 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/d55b71393907 changeset: 47012:d55b71393907 parent: 46992:5fa019ceb499 user:Joerg Sonnenberger date:Mon Mar 29 01:52:06 2021 +0200 summary: node: replace nullid and friends with

Failed pipeline for branch/default | mercurial-devel | 1aa371ed

2021-05-03 Thread Heptapod
Pipeline #21506 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/default ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default ) Commit: 1aa371ed (

D10632: revlogv2: also keep track for the size of the "data" file

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is useful to make sure we always start writing at the right location, without effort. REPOSITORY rHG Mercurial

D10631: revlogv2: track pending write in the docket and expose it to hooks

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The docket is now able to write pending data. We could have used a distinct intermediate files, however keeping everything

D10628: revlogv2: track current index size in the docket

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This help use to fix transaction safety on repos. See next changesets for details. REPOSITORY rHG Mercurial BRANCH

D10630: revlog: move the `trypending` logic from the `changelog` to the `revlog`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We move the -reading- logic for the pending's '.a' suffixed index within the revlog class. This is motivated by the fact the

D10629: revlogv2: delay the update of the changelog docket to transaction end

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This prevent external reader to see the transaction content before it is commited. However this also prevent the hooks to

D10625: revlogv2: store version information in the docket only

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Having it duplicated in the index was both useless and a risk of discrepancy. REPOSITORY rHG Mercurial BRANCH default

D10624: revlogv2: introduce a very basic docket file

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is the first stone toward using a docket file in revlogv2. Right now the docket is very basic and only store the

D10627: revlogv2: also test transactionality of revlog v2

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Without surprise, this is broken :-) Now that it is tested, we can fix it. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10617: sidedata: add a 'side-data' repository feature and use it

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Most code don't really care how sidedata support is added, but it needs to know if it is present. To achieve this. we use the `repo.features` attributes with

D10626: revlog: add a new test file focussed on testing transactionally issue

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY What we test here is currently also covered by `test-hooks.t`. However having our own test file allow for more focussed/deep testing and to cover more variant

D10623: revlogv2: mark revlogv2 as requires a full upgrade

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This was overlooked previously. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10623 AFFECTED FILES

D10620: side-data: drop the associated config and requirements

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is no longer and extensions of revlog v1, but a part of revlog v2. We no longer needs independent config and requirement management for that. REPOSITORY

D10622: revlog: unify flag processing when loading index

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The new code use a simple declaration to do centralised processing. This is clearer, shorter and less error prone. This will

D10621: revlog: unify checks for supported flag

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The new code use a simple declaration to do centralised checking. This is clearer, shorter and less error prone. This will

D10619: revlog: fix capitalisation of an error

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We don't start error message with capital letters. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10618: test: no longer directly use the sidedata config and requirements

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY They are on their way out, so we simply use revlogv2 in these cases. Some test does not requires explicite request for the revlogv2 format since the

D10613: revlog: determine sidedata support based on the revlog version

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Revlog version "2" support sidedata, previous version does not. So lets make the initialization simpler. REPOSITORY rHG

D10616: statichttp: add the missing `features` attribute

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This make statichttp closer to the interface it is "supposed" to follow. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10612: requirements: no longer drop `generaldelta` requirement with revlogv2

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY A repository could use a mix of revlogv1 and revlogv2, making the requirements still necessary. Overall we should move away from the "requirements" file being

D10614: upgrade: display sidedata before upgrade

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is a small gratuitous change that help making the test simpler to understand on its own. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10610: revlog: only use the `_indexfp` method for read operation

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will avoid "other" code to not overlook `_writing` usage. We introduces private method dedicated to writing to make use

D10615: sidedata: use revlogv2 requirement in the test helper

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We are about to drop the requirement dedicated to sidedata (since revlogv2 will support them unconditionally and previous version will not.). To prepare

D10609: revlog: use `_writing` in `rewrite_sidedata`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Special cases aren't special enough to break the rules. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10611: config: drop the `format.exp-revlogv2.2` option

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It is oddly named and not used at all. The one used by the code is still `experimental.revlogv2`. So we drop that one option for consistency. We move

D10608: revlog: open files in 'r+' instead of 'a+'

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The code doing actual writing is already doing the necessary seeking, so we could safely use 'r+'. This make the file objecs

D10607: revlog: pass a transaction object to `rewrite_sidedata`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `_writing` context need one, so we update the function signature before considering using `_writing` in rewrite_sidedata.

D10605: revlog: introduce a mandatory `_writing` context to update revlog content

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Before this change, various revlog methods where managing the opening and closing of the revlog files manually and passing

D10606: revlog: rename variable in `rewrite_sidedata` to match other code

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Let's call the index file object and `ifh` and the data file object `dfh` as the rest of the revlog code. This will make

D10604: revlog: preindent some code in _enforceinlinesize

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Indenting this beforehand will make a future changeset much simpler. REPOSITORY rHG Mercurial BRANCH default REVISION

D10603: revlog: preindent some code in addgroup

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Indenting this beforehand will make a future changeset much simpler. REPOSITORY rHG Mercurial BRANCH default REVISION

D10602: revlog: rename `indexdata` to entry_data

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Same reasoning as the previous changeset, we might not be looking at index data here. REPOSITORY rHG Mercurial BRANCH

D10601: revlog: use "entry_point" phrasing for loading the revlog

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The main entry for the revlog will not necessary be the index, but a small "docket". So we change the variable names and we

D10600: revlog: directly use self._format_flags when loading index

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The shorthand variable does not bring much, so we drop it to simplify the code. REPOSITORY rHG Mercurial BRANCH default

D10599: revlog: directly use self._format_version when loading index

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The shorthand variable does not bring much, so we drop it to simplify the code. REPOSITORY rHG Mercurial BRANCH default

D10598: revlog: use `_format_flags` to access flags instead of `header`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It seems better to reuse the variable we carefully extracted This also open the way to more flexible way to retrieve

D10597: revlog: rename `newversionflags` to `new_header`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This make it consistent with the previous changeset. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10596: revlog: rename `versionflags` to header

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The variable is named as such because it contains "version" information and "flags" information. However you mostly needs to

D10595: revlog: move index reading logic in a dedicated method

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY They are multiple motivation to do it: - The logic is complicated enough to deserver its own method. - We will need

D10594: revlog: define the actual index and datafile at loading time

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is just code movement, to make the code closer to where we actually use it and where it will be defined in the future.

D10593: revlog: simplify a conditionnal in _enforceinlinesize

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is a gratuitous change to make things a bit easier to read. REPOSITORY rHG Mercurial BRANCH default REVISION

D10592: revlog: drop `flush` parameter from `_peek_iscensored`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is not used anywhere. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10591: revlog: fix error message when data are missing

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The error message the message was not using the requested offset, but the adjusted offset to that read more data for

D10590: revlog: rename `nodemap_file` to `_nodemap_file`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Same reasoning as for `indexfile and datafile`, lets hide these implementation details. REPOSITORY rHG Mercurial BRANCH

D10589: revlog: use revlog.display_id in error related to bad revisions

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10589 AFFECTED FILES mercurial/revlog.py

D10586: revlog: use revlog.display_id in integrity error

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10586 AFFECTED FILES mercurial/revlog.py

D10588: revlog: use revlog.display_id in "revision too big" errors

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10588 AFFECTED FILES mercurial/revlog.py

D10587: revlog: use revlog.display_id in censor related errors

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10587 AFFECTED FILES mercurial/revlog.py

D10576: revlog: use a "radix" to address revlog

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Instead of pointing to the index directly and to derive the other file from that, we directly provide the radix and let the

D10585: revlog: use revlog.display_id in ambiguity errors

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10585 AFFECTED FILES mercurial/revlog.py

D10581: revlog: use revlog.display_id in LookupError

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10581 AFFECTED

D10583: revlog: use revlog.display_id in format related errors

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10583 AFFECTED FILES mercurial/revlog.py

D10584: revlog: use revlog.display_id for corruption error

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10584 AFFECTED FILES mercurial/revlog.py

D10582: revlog: use revlog.display_id in narrow error message

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10582 AFFECTED FILES mercurial/changegroup.py

D10574: revlog: rename `indexfile` to `_indexfile`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We want to make the actual location of the indexfile and location more of an implementation details than what is is

D10579: revlog: introduce a `display_id` property

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We currently using the "index file" to identify a revlog in error output. Since we are about to make the "index file"

D10580: revlog: use revlog.display_id for FilteredLookupError

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10580 AFFECTED FILES mercurial/repoview.py CHANGE DETAILS diff --git

D10575: revlog: rename `datafile` to `datafile`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We want to make the actual location of the datafile and location more of an implementation details than what is is

D10578: revlog: also use radix when computing nodemap data file

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We have a radix, lets use it! REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10578 AFFECTED FILES

D10577: revlog: stop usage of `_indexfile` to computing nodemap path

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We now have the radix explicitely lets use the radix explicitely REPOSITORY rHG Mercurial BRANCH default REVISION

D10565: revlog: split the `version` attribute into its two components

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `revlog.version` attribute contained an integer coding 2 different informations: - the revlog version number - a

D10572: manifest: drop the `indexfile` from `manifestrevlog`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since `manifestrevlog` object are not revlog (no really, they are not…) we drop the revlog specific attribute. We need to directly access the underlying

D10569: revlog: always "append" full size tuple

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Same reasoning as the previous patch. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10573: filelog: drop `indexfile` from `filelog`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since `filelog` objects are not revlog (no really, they are not…) we drop the revlog specific attribute. We need to directly access the underlying revlog in a

D10571: revlog: deal with special "postfix" explicitely

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY revlog usually use a straight forward '.i' and '.d' naming except for two cases "in-transaction" changelog, and censoring.

D10570: revlog: split the option initialisation in its own method

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The part of the code is huge, keeping it separated will keep the `_loadindex` method simpler and help keeping logic well

D10568: revlog: make the index always return the same tuple

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It is simpler to manage the diferrence in on disk format in the internal index code itself and lets the rest of the code always handle the same object.

D10563: revlog: replace flag check related to generaldelta with attribute check

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Same logic as the previous changesets. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10563 AFFECTED FILES

D10567: revlog: introduce an explicit `format_version` member in the index struct

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will allow for cleaner check than assuming each version has a different size. Unsurprisingly I am planning to use this to introduce more format variant.

D10566: revlog: rename `hdrsize` to `entry_size` in the C code

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is the size of and index entry, so lets make it clearer. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10562: revlog: replace REVLOGV2 check related to sidedata with `hassidedata` checks

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is more flexible and semantically more correct. The associated revlog's attribute exist since 827cb4fe62a3

D10564: verify: pass a revlog to `_checkrevlog` in `_verifymanifest`

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since `manifestrevlog` is not a `revlog`, we are passing strange thing to `_checkrevlog`. We fix this to avoid breakage during future change. REPOSITORY rHG

D10561: revlog: explicitely pass the "indexfile" parameter

2021-05-03 Thread marmoute (Pierre-Yves David)
marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Most of this was already done when introducing the `target` parameter, but some remained. Having "indexfile" passed explicitely will help us to change the way

D10558: rust: Use `` instead of `` in may APIs

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Getting the former (through `Deref`) is almost the only useful thing one can do with the latter anyway. With this changes, API become more flexible for the

D10557: dirstate-tree: Make `DirstateMap` borrow from a bytes buffer

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY … that has the contents of the `.hg/dirstate` file. This only applies to the tree-based flavor of `DirstateMap`. For now only the entire `&[u8]` slice

D10560: dirstate-tree: Borrow paths from the "on disk" bytes

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Use std::borrow::Cow to avoid some memory allocations and copying. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D10559: dirstate-tree: Borrow copy source paths from the "on disk" bytes

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Use std::borrow::Cow to avoid some memory allocations and copying. These particular allocations are not visible when profiling (as many files in a

D10555: rust: Remove handling of `parents` in `DirstateMap`

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The Python wrapper class `dirstatemap` can take care of it. This removes the need to have both `_rustmap` and `_inner_rustmap`. REPOSITORY rHG

D10556: rust: Read dirstate from disk in DirstateMap constructor

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Before this changeset, Python code first creates an empty `DirstateMap` Rust object, then immediately calls its `read` method with a byte string of the

D10547: dirstate-tree: Add the new `status()` algorithm

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY With the dirstate organized in a tree that mirrors the structure of the filesystem tree, we can traverse both trees at the same time in order to compare

D10553: dirstate-tree: Use HashMap instead of BTreeMap

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY BTreeMap has the advantage of its "natural" iteration order being the one we need in the status algorithm. With HashMap however, iteration order is

D10554: dirstate-tree: Fold "tracked descendants" counter update in main walk

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY For the purpose of implementing `has_tracked_dir` (which means "has tracked descendants) without an expensive sub-tree traversal, we maintaing a counter of

D10552: dirstate-tree: Add #[timed] attribute to `status` and `DirstateMap::read`

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY When running with a `RUST_LOG=trace` environment variable, the `micro_timer` crate prints the duration taken by each call to functions with that attribute.

D10546: dirstate-tree: Give to `status()` mutable access to the `DirstateMap`

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10546 AFFECTED FILES rust/hg-core/src/dirstate/status.rs

D10551: dirstate-tree: Paralellize the status algorithm with Rayon

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The `rayon` crate exposes "parallel iterators" that work like normal iterators but dispatch work on different items to an implicit global thread pool.

D10550: dirstate-tree: Avoid BTreeMap double-lookup when inserting a dirstate entry

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY The child nodes of a given node in the tree-shaped dirstate are kept in a `BTreeMap` where keys are file names as strings. Finding or inserting a value in

D10549: dirstate-tree: Handle I/O errors in status

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Errors such as insufficient permissions when listing a directory are logged, and the algorithm continues without considering that directory. REPOSITORY

D10548: dirstate-tree: Ignore FIFOs etc. in the status algorithm

2021-05-03 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY If a filesystem directory contains anything that is not: - a "normal" file - a symbolic link - or a directory … act as if that directory entry