Martin von Zweigbergk <martinvonz@google.com> [Thu, 20 Jan 2022 14:46:16 -0800] rev 48576
filemerge: remove unnecessary check for empty string
Looking at the statement just before, the string is clearly never
empty (or otherwise falsy).
Differential Revision: https://phab.mercurial-scm.org/D12011
Martin von Zweigbergk <martinvonz@google.com> [Thu, 20 Jan 2022 23:07:35 -0800] rev 48575
tests: also test spaces in conflict marker labels
Our fake merge tool printed the arguments using `$1` etc. without
quotes, which means that the shell collapsed repeated spaces within
the argument. That resulted in tests that did not pick up changes to
the number of spaces.
Differential Revision: https://phab.mercurial-scm.org/D12010
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 17 Jan 2022 21:20:46 -0500] rev 48574
blackbox: change year in logs to ISO 8601 format
AFAIK, year/month/day is not a format than anyone uses. It seems more
sensible to me to use ISO 8601, as that's standard and unambiguously
year-month-day.
Compatibility-wise, I think it's acceptable to change the default
format. It's most for human consumption. It's plausible that a few
tools parse this format, but it has already changed in the past (for
instance to add the current revision).
Differential Revision: https://phab.mercurial-scm.org/D12006
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 17 Jan 2022 21:00:33 -0500] rev 48573
blackbox: add milliseconds to blackbox logs by default
The current second granularity is often not specific enough to
determine whether an hg command is happening before or after some
other event.
Given that starting a process takes on the order of 1ms (well, for
native processes. It's quite a bit more for python processes),
microseconds seems like unnecessary noise.
This also lines up behavior with the rust version, where we already
switched to millisecond precision.
Differential Revision: https://phab.mercurial-scm.org/D12005
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com> [Mon, 17 Jan 2022 20:47:46 -0500] rev 48572
blackbox: correct date format doc
Differential Revision: https://phab.mercurial-scm.org/D12004
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 20 Jan 2022 14:06:36 +0000] rev 48571
revlog: fix a bug where transaction can be aborted partially
Fix a repo corruption bug caused by a partial transaction rollback.
Differential Revision: https://phab.mercurial-scm.org/D12009
Arseniy Alekseyev <aalekseyev@janestreet.com> [Thu, 20 Jan 2022 14:02:58 +0000] rev 48570
revlog: demonstrate a bug where transaction can be aborted partially
Differential Revision: https://phab.mercurial-scm.org/D12008
Raphaël Gomès <rgomes@octobus.net> [Tue, 18 Jan 2022 10:27:13 +0100] rev 48569
branching: merge with stable
Dan Villiom Podlaski Christiansen <danchr@gmail.com> [Thu, 30 Dec 2021 13:25:44 +0100] rev 48568
rust: fix build errors on darwin
I'm not all _that_ versed in Rust, but I think the root cause is that
some constants are u16 rather than u32 on Darwin. I checked that the
code still compiles on the latest Ubuntu.
Differential Revision: https://phab.mercurial-scm.org/D11955
Simon Sapin <simon.sapin@octobus.net> [Mon, 17 Jan 2022 12:50:13 +0100] rev 48567
rust: Fix outdated comments in OwningDirstateMap
OwningDirstateMap used to own a PyBytes, but was generalized to be
more generic when it was moved from hg-cpython to hg-core.
This fixes some comments that were still referencing PyBytes.
Differential Revision: https://phab.mercurial-scm.org/D12003
Martin von Zweigbergk <martinvonz@google.com> [Fri, 14 Jan 2022 09:28:44 -0800] rev 48566
merge: consider the file merged when using :merge-{local,other}
Returning `None` from `simplemerge()` means that the caller interprets
it as "no merge was necessary (because two sides matched)". See
6217040b2780 and
issue2680 for some background. However,
`simplemerge()` shouldn't even get called in such scenarios, and
returning `None` means that the file is not considered merged, even
though the contents actually were. See the affected test cases.
Differential Revision: https://phab.mercurial-scm.org/D11999
Martin von Zweigbergk <martinvonz@google.com> [Fri, 14 Jan 2022 08:44:36 -0800] rev 48565
simplemerge: delete unused exception class `CantReprocessAndShowBase`
The only user was removed in
f18830651811 (simplemerge: burn "minimal"
feature to the ground, 2014-08-05).
Differential Revision: https://phab.mercurial-scm.org/D11998
Martin von Zweigbergk <martinvonz@google.com> [Tue, 11 Jan 2022 22:13:56 -0800] rev 48564
simplemerge: change _minimize() to minimize a single conflict
`_minimize()` is weird in that it changes `a_lines` and `b_lines` but
leaves `base_lines` unchanged, which means they'll be
inconsistent. That was fine because the caller never used
`base_lines`. With the recent refactorings of this code, we can now
make this function cleaner by having it minimize a single conflict and
not care about `base_lines`.
This also makes the code simpler and makes the code for each
`render_*()` function more similar.
Differential Revision: https://phab.mercurial-scm.org/D11981
Martin von Zweigbergk <martinvonz@google.com> [Tue, 11 Jan 2022 22:03:55 -0800] rev 48563
simplemerge: make minimize() a free function
IMO, `Merge3Text` should be about merging text without knowing about
conflict markers. "Conflict minimization" is about making conflict
markers smaller, so it should be moved out. This patch does that. I'll
refactor it next.
Differential Revision: https://phab.mercurial-scm.org/D11980
Martin von Zweigbergk <martinvonz@google.com> [Tue, 11 Jan 2022 21:56:27 -0800] rev 48562
simplemerge: simplify and rename `render_markers()`
`render_markers()` now always renders minimized 2-way markers, so
let's simplify and rename it accordingly.
Differential Revision: https://phab.mercurial-scm.org/D11979
Martin von Zweigbergk <martinvonz@google.com> [Tue, 11 Jan 2022 16:23:10 -0800] rev 48561
simplemerge: split out function for rendering :merge3 conflict markers
The results in some duplicate, but the code is very straight-forward
and I think it's worth it to have each conflict marker style in a
separate function.
Differential Revision: https://phab.mercurial-scm.org/D11978
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Jan 2022 23:29:19 -0800] rev 48560
simplemerge: move default labels to simplemerge extension
I want to remove knowledge of paths from the `simplemerge` core
module. As part of that, let's move the default labels from the core
module to the extension.
Differential Revision: https://phab.mercurial-scm.org/D11977
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Jan 2022 22:23:44 -0800] rev 48559
simplemerge: use same newline detection for :mergediff as for :merge[3]
The `:merge` and `:merge3` markers used the newline style detected
from the base input. The `:mergediff` style always used LF as newline
character. This patch teaches `:mergediff` to use the same detection
as the others did.
Differential Revision: https://phab.mercurial-scm.org/D11976
Martin von Zweigbergk <martinvonz@google.com> [Tue, 11 Jan 2022 16:54:42 -0800] rev 48558
simplemerge: clarify names of functions that render conflict markers
Differential Revision: https://phab.mercurial-scm.org/D11975
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Jan 2022 22:16:22 -0800] rev 48557
simplemerge: make merge_lines() a free function
IMO, the rendering of a conflict as text with merge markers should be
separate from the code for resolving conflicts. The latter is what
`Merge3Text` is mostly about already.
Differential Revision: https://phab.mercurial-scm.org/D11974
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Jan 2022 18:42:31 -0800] rev 48556
simplemerge: convert `merge_lines()` away from generator
We always consume all the lines and put them in a list anyway. By
making the function not a generator, we can later make it return an
additional value (to indicate if there were conflicts).
Differential Revision: https://phab.mercurial-scm.org/D11973
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 Dec 2021 13:12:56 -0800] rev 48555
simplemerge: use 3-way markers if mode=='merge3', ignoring number of labels
Before this patch, we use a combination of `mode` and `labels` to
decide which marker style to use. That's mostly my own fault because I
was the one who added the `mergediff` as a "mode" instead of adding a
separate argument for marker style. Still, let's make these arguments
more orthogonal by ignoring the number of labels when deciding which
marker style to use.
This refactoring makes it a little clearer in the simplemerge
*extension* that passing more than 2 `--label` arguments changes the
marker style.
Differential Revision: https://phab.mercurial-scm.org/D11972
Martin von Zweigbergk <martinvonz@google.com> [Fri, 14 Jan 2022 10:25:45 -0800] rev 48554
rust: upgrade `rand*` crates
`test-check-cargo-lock.t` is failing for me and I was hoping this
would help. It doesn't, but we might as well take the upgrade now that
I've done the (small amount of) work for it.
Differential Revision: https://phab.mercurial-scm.org/D12000
Martin von Zweigbergk <martinvonz@google.com> [Thu, 06 Jan 2022 22:09:40 -0800] rev 48553
logcmdutil: raise `StateError` when file to follow doesn't exist
Differential Revision: https://phab.mercurial-scm.org/D11969