Skip to content

Commit 01e9a24

Browse files
authored
Merge pull request #6187 from ocaml/revert-6183-processing-patches-2.2
Revert "[2.2 backport] Fix highly embarrassing mistake in patch transformation"
2 parents 05a669d + 27fe657 commit 01e9a24

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

master_changes.md

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ users)
9090
## Shell
9191

9292
## Internal
93-
* Fix error in `OpamSystem.transform_patch` - patches were only applied when debugging [#6182 @dra27 regression since #3449]
9493

9594
## Internal: Windows
9695

src/core/opamSystem.ml

+4-7
Original file line numberDiff line numberDiff line change
@@ -1485,12 +1485,10 @@ let translate_patch ~dir orig corrected =
14851485
process_state_transition `Header state transforms |> List.rev
14861486
in
14871487
let transforms = fold_lines `Header 1 [] in
1488-
if transforms = [] then begin
1489-
log ~level:1 "No patch translation needed for %s -> %s" orig corrected;
1488+
if transforms = [] then
14901489
copy_file orig corrected
1491-
end else begin
1490+
else begin
14921491
seek_in ch 0;
1493-
log ~level:1 "Transforming patch %s to %s" orig corrected;
14941492
let ch_out =
14951493
try open_out_bin corrected
14961494
with Sys_error _ ->
@@ -1505,13 +1503,12 @@ let translate_patch ~dir orig corrected =
15051503
else
15061504
(id, (fun s -> s ^ "\r"), strip 1)
15071505
in
1508-
if OpamConsole.debug () then begin
1506+
if OpamConsole.debug () then
15091507
let log_transform (first_line, last_line, add_cr) =
15101508
let indicator = if add_cr then '+' else '-' in
15111509
log ~level:3 "Transform %d-%d %c\\r" first_line last_line indicator
15121510
in
1513-
List.iter log_transform transforms
1514-
end;
1511+
List.iter log_transform transforms;
15151512
let rec fold_lines n transforms =
15161513
match input_line ch with
15171514
| line ->

tests/lib/patcher.expected

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ PATCH No CRLF adaptation necessary for b/test1
77
PATCH No CRLF adaptation necessary for b/test2
88
PATCH No CRLF adaptation necessary for b/test3
99
PATCH No CRLF adaptation necessary for b/will-null-file
10-
PATCH No patch translation needed for input.patch -> output.patch
1110
Before patch state of c:
1211
./always-crlf: CRLF
1312
./always-lf: LF
@@ -45,7 +44,6 @@ PATCH No CRLF adaptation necessary for b/test1
4544
PATCH Adding \r to patch chunks for b/test2
4645
PATCH No CRLF adaptation necessary for b/test3
4746
PATCH Adding \r to patch chunks for b/will-null-file
48-
PATCH Transforming patch input.patch to output.patch
4947
PATCH Transform 32-36 +\r
5048
PATCH Transform 62-67 +\r
5149
PATCH Transform 82-87 +\r

0 commit comments

Comments
 (0)