Fossil SCM

corrected -L 0 for deconstruct

wolfgang 2010-09-27 12:29 wolfgangFormat2CSS_2
Commit f7fd676575928f8499187f20ca47a5e6b72ecfde
1 file changed +6 -2
+6 -2
--- src/rebuild.c
+++ src/rebuild.c
@@ -472,11 +472,11 @@
472472
**
473473
** This command exports all artifacts of o given repository and
474474
** writes all artifacts to the file system. The DESTINATION directory
475475
** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
476476
** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.
477
-** Ivf -L|--prefixlength is given, the length (default 2) of the directory
477
+** If -L|--prefixlength is given, the length (default 2) of the directory
478478
** prefix can be set to 0,1,..,9 characters.
479479
*/
480480
void deconstruct_cmd(void){
481481
const char *zDestDir;
482482
const char *zPrefixOpt;
@@ -510,11 +510,15 @@
510510
case '8': prefixLength = 8;break;
511511
case '9': prefixLength = 9;break;
512512
default: fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt);
513513
}
514514
}
515
- zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
515
+ if (prefixLength){
516
+ zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
517
+ }else{
518
+ zAFileOutFormat = mprintf("%%s/%%s");
519
+ }
516520
#ifndef _WIN32
517521
if( access(zDestDir, W_OK) ){
518522
fossil_panic("DESTINATION(%s) is not writeable!",zDestDir);
519523
}
520524
#else
521525
--- src/rebuild.c
+++ src/rebuild.c
@@ -472,11 +472,11 @@
472 **
473 ** This command exports all artifacts of o given repository and
474 ** writes all artifacts to the file system. The DESTINATION directory
475 ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
476 ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.
477 ** Ivf -L|--prefixlength is given, the length (default 2) of the directory
478 ** prefix can be set to 0,1,..,9 characters.
479 */
480 void deconstruct_cmd(void){
481 const char *zDestDir;
482 const char *zPrefixOpt;
@@ -510,11 +510,15 @@
510 case '8': prefixLength = 8;break;
511 case '9': prefixLength = 9;break;
512 default: fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt);
513 }
514 }
515 zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
 
 
 
 
516 #ifndef _WIN32
517 if( access(zDestDir, W_OK) ){
518 fossil_panic("DESTINATION(%s) is not writeable!",zDestDir);
519 }
520 #else
521
--- src/rebuild.c
+++ src/rebuild.c
@@ -472,11 +472,11 @@
472 **
473 ** This command exports all artifacts of o given repository and
474 ** writes all artifacts to the file system. The DESTINATION directory
475 ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
476 ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.
477 ** If -L|--prefixlength is given, the length (default 2) of the directory
478 ** prefix can be set to 0,1,..,9 characters.
479 */
480 void deconstruct_cmd(void){
481 const char *zDestDir;
482 const char *zPrefixOpt;
@@ -510,11 +510,15 @@
510 case '8': prefixLength = 8;break;
511 case '9': prefixLength = 9;break;
512 default: fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt);
513 }
514 }
515 if (prefixLength){
516 zAFileOutFormat = mprintf("%%s/%%.%ds/%%s",prefixLength);
517 }else{
518 zAFileOutFormat = mprintf("%%s/%%s");
519 }
520 #ifndef _WIN32
521 if( access(zDestDir, W_OK) ){
522 fossil_panic("DESTINATION(%s) is not writeable!",zDestDir);
523 }
524 #else
525

Keyboard Shortcuts

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