Fossil SCM
cvs2fossil, fixed off-by-one errors in the application of RCS patches.
Commit
68cf3ecdb70a1157ee98653eea4eda72bf98dd43
Parent
f4aa6d09d347af8…
1 file changed
+12
-3
+12
-3
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -507,19 +507,28 @@ | ||
| 507 | 507 | incr sl -1 |
| 508 | 508 | incr el -1 |
| 509 | 509 | if {$sl < $ooff} { trouble internal {Deletion before last edit} } |
| 510 | 510 | if {$sl > $blen} { trouble internal {Deletion past file end} } |
| 511 | 511 | if {$el > $blen} { trouble internal {Deletion beyond file end} } |
| 512 | - foreach x [lrange $base $ooff $sl] { lappend res $x } | |
| 512 | + foreach x [lrange $base $ooff [expr {$sl - 1}]] { | |
| 513 | + log write 15 file {.|$x|} | |
| 514 | + lappend res $x | |
| 515 | + } | |
| 513 | 516 | set ooff $el |
| 514 | 517 | } |
| 515 | 518 | a { |
| 516 | 519 | if {$sl < $ooff} { trouble internal {Insert before last edit} } |
| 517 | 520 | if {$sl > $blen} { trouble internal {Insert past file end} } |
| 518 | 521 | |
| 519 | - foreach x [lrange $base $ooff $sl] { lappend res $x } | |
| 520 | - foreach x [lrange $lines $i [expr {$i + $cn}]] { lappend res $x } | |
| 522 | + foreach x [lrange $base $ooff [expr {$sl - 1}]] { | |
| 523 | + log write 15 file {.|$x|} | |
| 524 | + lappend res $x | |
| 525 | + } | |
| 526 | + foreach x [lrange $lines $i [expr {$i + $cn - 1}]] { | |
| 527 | + log write 15 file {+|$x|} | |
| 528 | + lappend res $x | |
| 529 | + } | |
| 521 | 530 | set ooff $sl |
| 522 | 531 | incr i $cn |
| 523 | 532 | } |
| 524 | 533 | } |
| 525 | 534 | } |
| 526 | 535 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -507,19 +507,28 @@ | |
| 507 | incr sl -1 |
| 508 | incr el -1 |
| 509 | if {$sl < $ooff} { trouble internal {Deletion before last edit} } |
| 510 | if {$sl > $blen} { trouble internal {Deletion past file end} } |
| 511 | if {$el > $blen} { trouble internal {Deletion beyond file end} } |
| 512 | foreach x [lrange $base $ooff $sl] { lappend res $x } |
| 513 | set ooff $el |
| 514 | } |
| 515 | a { |
| 516 | if {$sl < $ooff} { trouble internal {Insert before last edit} } |
| 517 | if {$sl > $blen} { trouble internal {Insert past file end} } |
| 518 | |
| 519 | foreach x [lrange $base $ooff $sl] { lappend res $x } |
| 520 | foreach x [lrange $lines $i [expr {$i + $cn}]] { lappend res $x } |
| 521 | set ooff $sl |
| 522 | incr i $cn |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -507,19 +507,28 @@ | |
| 507 | incr sl -1 |
| 508 | incr el -1 |
| 509 | if {$sl < $ooff} { trouble internal {Deletion before last edit} } |
| 510 | if {$sl > $blen} { trouble internal {Deletion past file end} } |
| 511 | if {$el > $blen} { trouble internal {Deletion beyond file end} } |
| 512 | foreach x [lrange $base $ooff [expr {$sl - 1}]] { |
| 513 | log write 15 file {.|$x|} |
| 514 | lappend res $x |
| 515 | } |
| 516 | set ooff $el |
| 517 | } |
| 518 | a { |
| 519 | if {$sl < $ooff} { trouble internal {Insert before last edit} } |
| 520 | if {$sl > $blen} { trouble internal {Insert past file end} } |
| 521 | |
| 522 | foreach x [lrange $base $ooff [expr {$sl - 1}]] { |
| 523 | log write 15 file {.|$x|} |
| 524 | lappend res $x |
| 525 | } |
| 526 | foreach x [lrange $lines $i [expr {$i + $cn - 1}]] { |
| 527 | log write 15 file {+|$x|} |
| 528 | lappend res $x |
| 529 | } |
| 530 | set ooff $sl |
| 531 | incr i $cn |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 |