Fossil SCM
Add the new option --keep-rid1 for the 'deconstruct' and 'reconstruct' commands.
Commit
79b51366085191c2b7e478a0dc23bc74a005a2f11be16f00d2a6920a0a80526b
Parent
62a00bc7284a827…
1 file changed
+12
-4
+12
-4
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -1073,21 +1073,26 @@ | ||
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | /* |
| 1076 | 1076 | ** COMMAND: reconstruct* |
| 1077 | 1077 | ** |
| 1078 | -** Usage: %fossil reconstruct FILENAME DIRECTORY | |
| 1078 | +** Usage: %fossil reconstruct ?OPTIONS? FILENAME DIRECTORY | |
| 1079 | 1079 | ** |
| 1080 | 1080 | ** This command studies the artifacts (files) in DIRECTORY and |
| 1081 | 1081 | ** reconstructs the fossil record from them. It places the new |
| 1082 | 1082 | ** fossil repository in FILENAME. Subdirectories are read, files |
| 1083 | 1083 | ** with leading '.' in the filename are ignored. |
| 1084 | 1084 | ** |
| 1085 | +** Options: | |
| 1086 | +** -K|--keep-rid1 Read the filename of the artifact with | |
| 1087 | +** RID=1 from the file .rid in DIRECTORY. | |
| 1088 | +** | |
| 1085 | 1089 | ** See also: deconstruct, rebuild |
| 1086 | 1090 | */ |
| 1087 | 1091 | void reconstruct_cmd(void) { |
| 1088 | 1092 | char *zPassword; |
| 1093 | + fKeepRid1 = find_option("keep-rid1",0,0)!=0; | |
| 1089 | 1094 | if( g.argc!=4 ){ |
| 1090 | 1095 | usage("FILENAME DIRECTORY"); |
| 1091 | 1096 | } |
| 1092 | 1097 | if( file_isdir(g.argv[3], ExtFILE)!=1 ){ |
| 1093 | 1098 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| @@ -1135,22 +1140,25 @@ | ||
| 1135 | 1140 | ** AABBBBBBBBB.. is the 40+ character artifact ID, AA the first 2 characters. |
| 1136 | 1141 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 1137 | 1142 | ** prefix can be set to 0,1,..,9 characters. |
| 1138 | 1143 | ** |
| 1139 | 1144 | ** Options: |
| 1140 | -** -R|--repository REPOSITORY deconstruct given REPOSITORY | |
| 1141 | -** -L|--prefixlength N set the length of the names of the DESTINATION | |
| 1142 | -** subdirectories to N | |
| 1145 | +** -R|--repository REPOSITORY Deconstruct given REPOSITORY. | |
| 1146 | +** -K|--keep-rid1 Save the filename of the artifact with RID=1 to | |
| 1147 | +** the file .rid1 in the DESTINATION directory. | |
| 1148 | +** -L|--prefixlength N Set the length of the names of the DESTINATION | |
| 1149 | +** subdirectories to N. | |
| 1143 | 1150 | ** --private Include private artifacts. |
| 1144 | 1151 | ** |
| 1145 | 1152 | ** See also: rebuild, reconstruct |
| 1146 | 1153 | */ |
| 1147 | 1154 | void deconstruct_cmd(void){ |
| 1148 | 1155 | const char *zPrefixOpt; |
| 1149 | 1156 | Stmt s; |
| 1150 | 1157 | int privateFlag; |
| 1151 | 1158 | |
| 1159 | + fKeepRid1 = find_option("keep-rid1","K",0)!=0; | |
| 1152 | 1160 | /* get and check prefix length argument and build format string */ |
| 1153 | 1161 | zPrefixOpt=find_option("prefixlength","L",1); |
| 1154 | 1162 | if( !zPrefixOpt ){ |
| 1155 | 1163 | prefixLength = 2; |
| 1156 | 1164 | }else{ |
| 1157 | 1165 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -1073,21 +1073,26 @@ | |
| 1073 | } |
| 1074 | |
| 1075 | /* |
| 1076 | ** COMMAND: reconstruct* |
| 1077 | ** |
| 1078 | ** Usage: %fossil reconstruct FILENAME DIRECTORY |
| 1079 | ** |
| 1080 | ** This command studies the artifacts (files) in DIRECTORY and |
| 1081 | ** reconstructs the fossil record from them. It places the new |
| 1082 | ** fossil repository in FILENAME. Subdirectories are read, files |
| 1083 | ** with leading '.' in the filename are ignored. |
| 1084 | ** |
| 1085 | ** See also: deconstruct, rebuild |
| 1086 | */ |
| 1087 | void reconstruct_cmd(void) { |
| 1088 | char *zPassword; |
| 1089 | if( g.argc!=4 ){ |
| 1090 | usage("FILENAME DIRECTORY"); |
| 1091 | } |
| 1092 | if( file_isdir(g.argv[3], ExtFILE)!=1 ){ |
| 1093 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| @@ -1135,22 +1140,25 @@ | |
| 1135 | ** AABBBBBBBBB.. is the 40+ character artifact ID, AA the first 2 characters. |
| 1136 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 1137 | ** prefix can be set to 0,1,..,9 characters. |
| 1138 | ** |
| 1139 | ** Options: |
| 1140 | ** -R|--repository REPOSITORY deconstruct given REPOSITORY |
| 1141 | ** -L|--prefixlength N set the length of the names of the DESTINATION |
| 1142 | ** subdirectories to N |
| 1143 | ** --private Include private artifacts. |
| 1144 | ** |
| 1145 | ** See also: rebuild, reconstruct |
| 1146 | */ |
| 1147 | void deconstruct_cmd(void){ |
| 1148 | const char *zPrefixOpt; |
| 1149 | Stmt s; |
| 1150 | int privateFlag; |
| 1151 | |
| 1152 | /* get and check prefix length argument and build format string */ |
| 1153 | zPrefixOpt=find_option("prefixlength","L",1); |
| 1154 | if( !zPrefixOpt ){ |
| 1155 | prefixLength = 2; |
| 1156 | }else{ |
| 1157 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -1073,21 +1073,26 @@ | |
| 1073 | } |
| 1074 | |
| 1075 | /* |
| 1076 | ** COMMAND: reconstruct* |
| 1077 | ** |
| 1078 | ** Usage: %fossil reconstruct ?OPTIONS? FILENAME DIRECTORY |
| 1079 | ** |
| 1080 | ** This command studies the artifacts (files) in DIRECTORY and |
| 1081 | ** reconstructs the fossil record from them. It places the new |
| 1082 | ** fossil repository in FILENAME. Subdirectories are read, files |
| 1083 | ** with leading '.' in the filename are ignored. |
| 1084 | ** |
| 1085 | ** Options: |
| 1086 | ** -K|--keep-rid1 Read the filename of the artifact with |
| 1087 | ** RID=1 from the file .rid in DIRECTORY. |
| 1088 | ** |
| 1089 | ** See also: deconstruct, rebuild |
| 1090 | */ |
| 1091 | void reconstruct_cmd(void) { |
| 1092 | char *zPassword; |
| 1093 | fKeepRid1 = find_option("keep-rid1",0,0)!=0; |
| 1094 | if( g.argc!=4 ){ |
| 1095 | usage("FILENAME DIRECTORY"); |
| 1096 | } |
| 1097 | if( file_isdir(g.argv[3], ExtFILE)!=1 ){ |
| 1098 | fossil_print("\"%s\" is not a directory\n\n", g.argv[3]); |
| @@ -1135,22 +1140,25 @@ | |
| 1140 | ** AABBBBBBBBB.. is the 40+ character artifact ID, AA the first 2 characters. |
| 1141 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 1142 | ** prefix can be set to 0,1,..,9 characters. |
| 1143 | ** |
| 1144 | ** Options: |
| 1145 | ** -R|--repository REPOSITORY Deconstruct given REPOSITORY. |
| 1146 | ** -K|--keep-rid1 Save the filename of the artifact with RID=1 to |
| 1147 | ** the file .rid1 in the DESTINATION directory. |
| 1148 | ** -L|--prefixlength N Set the length of the names of the DESTINATION |
| 1149 | ** subdirectories to N. |
| 1150 | ** --private Include private artifacts. |
| 1151 | ** |
| 1152 | ** See also: rebuild, reconstruct |
| 1153 | */ |
| 1154 | void deconstruct_cmd(void){ |
| 1155 | const char *zPrefixOpt; |
| 1156 | Stmt s; |
| 1157 | int privateFlag; |
| 1158 | |
| 1159 | fKeepRid1 = find_option("keep-rid1","K",0)!=0; |
| 1160 | /* get and check prefix length argument and build format string */ |
| 1161 | zPrefixOpt=find_option("prefixlength","L",1); |
| 1162 | if( !zPrefixOpt ){ |
| 1163 | prefixLength = 2; |
| 1164 | }else{ |
| 1165 |