960
961
962
963
964
965
966
967
968
969
970
971
972
973
|
}
}
}
# Read a patch file and display it
proc displayPatch {} {
global diff Pref
set ch [open $diff(patchFile) r]
set style ""
set divider "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
set leftLine 1
|
>
>
>
>
|
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
|
}
}
}
# Read a patch file and display it
proc displayPatch {} {
global diff Pref
set diff(leftLabel) "Patch $diff(patchFile): old"
set diff(rightLabel) "Patch $diff(patchFile): new"
update idletasks
set ch [open $diff(patchFile) r]
set style ""
set divider "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
set leftLine 1
|
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
|
} else {
lappend rightLines [list $leftLine "+" $str]
incr rightLine
}
continue
}
}
close $ch
set diff(leftLabel) "Patch $diff(patchFile): old"
set diff(rightLabel) "Patch $diff(patchFile): new"
update idletasks
}
# Prepare for RCS/CVS diff. Checkout copies of the versions needed.
proc prepareRCS {} {
global diff Pref
set revs {}
|
>
>
>
>
<
<
<
|
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
|
} else {
lappend rightLines [list $leftLine "+" $str]
incr rightLine
}
continue
}
}
if {$state != "none"} {
displayOnePatch $leftLines $rightLines $leftLine $rightLine
}
close $ch
}
# Prepare for RCS/CVS diff. Checkout copies of the versions needed.
proc prepareRCS {} {
global diff Pref
set revs {}
|
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
|
}
regexp {\d+\.(\d+)} $index -> index
# Expand tabs to 8 chars
while 1 {
set i [string first \t $text]
if {$i == -1} break
set n [expr {(- $i - $index) % 8}]
set text [string replace $text $i $i [format %${n}s ""]]
}
return $text
}
# Main print function
proc printDiffs {{quiet 0}} {
|
|
|
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
|
}
regexp {\d+\.(\d+)} $index -> index
# Expand tabs to 8 chars
while 1 {
set i [string first \t $text]
if {$i == -1} break
set n [expr {(- $i - $index - 1) % 8 + 1}]
set text [string replace $text $i $i [format %${n}s ""]]
}
return $text
}
# Main print function
proc printDiffs {{quiet 0}} {
|