Fossil SCM

Fixed handling of empty revisions.

aku 2007-12-06 03:48 trunk
Commit bf0b70d5e08fe0d6747e3c6e6687b18aa531f3a9
--- tools/cvs2fossil/lib/c2f_file.tcl
+++ tools/cvs2fossil/lib/c2f_file.tcl
@@ -382,12 +382,16 @@
382382
method Expand1 {chan dir graph node} {
383383
set revnr [$graph node get $node revnr]
384384
set fname r$revnr
385385
struct::list assign [$graph node get $node text] offset length
386386
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
+ }
389393
390394
if {![$graph node keyexists $node __base__]} {
391395
# Full text node. Get the data, decode it, and save.
392396
393397
log write 2 file {Expanding <$revnr>, full text}
394398
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button