Fossil SCM
Fixed handling of empty revisions.
Commit
bf0b70d5e08fe0d6747e3c6e6687b18aa531f3a9
Parent
d0305b305ad0a15…
1 file changed
+6
-2
| --- tools/cvs2fossil/lib/c2f_file.tcl | ||
| +++ tools/cvs2fossil/lib/c2f_file.tcl | ||
| @@ -382,12 +382,16 @@ | ||
| 382 | 382 | method Expand1 {chan dir graph node} { |
| 383 | 383 | set revnr [$graph node get $node revnr] |
| 384 | 384 | set fname r$revnr |
| 385 | 385 | struct::list assign [$graph node get $node text] offset length |
| 386 | 386 | |
| 387 | - seek $chan $offset start | |
| 388 | - set data [string map {@@ @} [read $chan $length]] | |
| 387 | + if {$length < 0} { | |
| 388 | + set data "" | |
| 389 | + } else { | |
| 390 | + seek $chan $offset start | |
| 391 | + set data [string map {@@ @} [read $chan $length]] | |
| 392 | + } | |
| 389 | 393 | |
| 390 | 394 | if {![$graph node keyexists $node __base__]} { |
| 391 | 395 | # Full text node. Get the data, decode it, and save. |
| 392 | 396 | |
| 393 | 397 | log write 2 file {Expanding <$revnr>, full text} |
| 394 | 398 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -382,12 +382,16 @@ | |
| 382 | method Expand1 {chan dir graph node} { |
| 383 | set revnr [$graph node get $node revnr] |
| 384 | set fname r$revnr |
| 385 | struct::list assign [$graph node get $node text] offset length |
| 386 | |
| 387 | seek $chan $offset start |
| 388 | set data [string map {@@ @} [read $chan $length]] |
| 389 | |
| 390 | if {![$graph node keyexists $node __base__]} { |
| 391 | # Full text node. Get the data, decode it, and save. |
| 392 | |
| 393 | log write 2 file {Expanding <$revnr>, full text} |
| 394 |
| --- tools/cvs2fossil/lib/c2f_file.tcl | |
| +++ tools/cvs2fossil/lib/c2f_file.tcl | |
| @@ -382,12 +382,16 @@ | |
| 382 | method Expand1 {chan dir graph node} { |
| 383 | set revnr [$graph node get $node revnr] |
| 384 | set fname r$revnr |
| 385 | struct::list assign [$graph node get $node text] offset length |
| 386 | |
| 387 | if {$length < 0} { |
| 388 | set data "" |
| 389 | } else { |
| 390 | seek $chan $offset start |
| 391 | set data [string map {@@ @} [read $chan $length]] |
| 392 | } |
| 393 | |
| 394 | if {![$graph node keyexists $node __base__]} { |
| 395 | # Full text node. Get the data, decode it, and save. |
| 396 | |
| 397 | log write 2 file {Expanding <$revnr>, full text} |
| 398 |