Mercurial > hg
view contrib/merge-lists/Cargo.toml @ 49034:079197e94b24
crecord: avoid duplicating lines when reverting noeol->eol change
When reversing a patch that looks like this while using crecord:
```
@@ -301,4 +302,4 @@ zza
zzb
zzc
zzd
-zze
\ No newline at end of file
+zze
```
we would previously reverse the `-zze` line to be an add, encounter the "no
newline" line and stop inspecting lines. This caused us to duplicate the line,
producing `zzezze` (still without a newline).
`break` is the correct action if we know there will be no lines afterwards, as
would be the case in an eol -> noeol transition. It is incorrect if there are
lines afterward, such as if both sides are missing the newline or if only the
lhs is missing the newline.
Differential Revision: https://phab.mercurial-scm.org/D12441
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Mon, 04 Apr 2022 18:05:33 -0700 |
parents | 681b25ea579e |
children | 337bc83c1275 |
line wrap: on
line source
# A tool that performs a 3-way merge, resolving conflicts in sorted lists and # leaving other conflicts unchanged. This is useful with Mercurial's support # for partial merge tools (configured in `[partial-merge-tools]`). [package] name = "merge-lists" version = "0.1.0" edition = "2021" # We need https://github.com/rust-lang/rust/pull/89825 rust-version = "1.59" [dependencies] clap = { version = "3.1.6", features = ["derive"] } itertools = "0.10.3" regex = "1.5.5" similar = { version="2.1.0", features = ["bytes"] } [dev-dependencies] assert_cmd = "2.0.4" insta = "1.13.0" tempdir = "0.3.7"