Fossil SCM
corrected -L 0 for deconstruct
Commit
f7fd676575928f8499187f20ca47a5e6b72ecfde
Parent
ab12d0f4d296aa6…
1 file changed
+6
-2
+6
-2
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -472,11 +472,11 @@ | ||
| 472 | 472 | ** |
| 473 | 473 | ** This command exports all artifacts of o given repository and |
| 474 | 474 | ** writes all artifacts to the file system. The DESTINATION directory |
| 475 | 475 | ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where |
| 476 | 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 | |
| 477 | +** If -L|--prefixlength is given, the length (default 2) of the directory | |
| 478 | 478 | ** prefix can be set to 0,1,..,9 characters. |
| 479 | 479 | */ |
| 480 | 480 | void deconstruct_cmd(void){ |
| 481 | 481 | const char *zDestDir; |
| 482 | 482 | const char *zPrefixOpt; |
| @@ -510,11 +510,15 @@ | ||
| 510 | 510 | case '8': prefixLength = 8;break; |
| 511 | 511 | case '9': prefixLength = 9;break; |
| 512 | 512 | default: fossil_panic("N(%s) is not a a valid prefix length!",zPrefixOpt); |
| 513 | 513 | } |
| 514 | 514 | } |
| 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 | + } | |
| 516 | 520 | #ifndef _WIN32 |
| 517 | 521 | if( access(zDestDir, W_OK) ){ |
| 518 | 522 | fossil_panic("DESTINATION(%s) is not writeable!",zDestDir); |
| 519 | 523 | } |
| 520 | 524 | #else |
| 521 | 525 |
| --- 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 |