Fossil SCM

Allow fossil update -n -v current to be used on the root directory (aborted with "outside of checkout tree" error before).

venkat 2010-11-08 05:23 venks-emacs
Commit b6bb1ee725ccf13bd9a9fd34851c65a6cc6644f0
1 file changed +9 -8
+9 -8
--- src/file.c
+++ src/file.c
@@ -432,20 +432,21 @@
432432
int n;
433433
Blob full;
434434
db_must_be_within_tree();
435435
file_canonical_name(zOrigName, &full);
436436
n = strlen(g.zLocalRoot);
437
- if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){
438
- blob_reset(&full);
439
- if( errFatal ){
437
+ if((blob_size(&full) == n-1 && !memcmp(g.zLocalRoot, blob_buffer(&full), n-1)) ||
438
+ (blob_size(&full) >= n && !memcmp(g.zLocalRoot, blob_buffer(&full), n))){
439
+ blob_zero(pOut);
440
+ blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);
441
+ return 1;
442
+ }
443
+ blob_reset(&full);
444
+ if( errFatal ){
440445
fossil_fatal("file outside of checkout tree: %s", zOrigName);
441
- }
442
- return 0;
443446
}
444
- blob_zero(pOut);
445
- blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);
446
- return 1;
447
+ return 0;
447448
}
448449
449450
/*
450451
** COMMAND: test-tree-name
451452
**
452453
--- src/file.c
+++ src/file.c
@@ -432,20 +432,21 @@
432 int n;
433 Blob full;
434 db_must_be_within_tree();
435 file_canonical_name(zOrigName, &full);
436 n = strlen(g.zLocalRoot);
437 if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){
438 blob_reset(&full);
439 if( errFatal ){
 
 
 
 
 
440 fossil_fatal("file outside of checkout tree: %s", zOrigName);
441 }
442 return 0;
443 }
444 blob_zero(pOut);
445 blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);
446 return 1;
447 }
448
449 /*
450 ** COMMAND: test-tree-name
451 **
452
--- src/file.c
+++ src/file.c
@@ -432,20 +432,21 @@
432 int n;
433 Blob full;
434 db_must_be_within_tree();
435 file_canonical_name(zOrigName, &full);
436 n = strlen(g.zLocalRoot);
437 if((blob_size(&full) == n-1 && !memcmp(g.zLocalRoot, blob_buffer(&full), n-1)) ||
438 (blob_size(&full) >= n && !memcmp(g.zLocalRoot, blob_buffer(&full), n))){
439 blob_zero(pOut);
440 blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);
441 return 1;
442 }
443 blob_reset(&full);
444 if( errFatal ){
445 fossil_fatal("file outside of checkout tree: %s", zOrigName);
 
 
446 }
447 return 0;
 
 
448 }
449
450 /*
451 ** COMMAND: test-tree-name
452 **
453

Keyboard Shortcuts

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