Fossil SCM

Add the new option --keep-rid1 for the 'deconstruct' and 'reconstruct' commands.

florian 2019-01-28 10:18 reconstruct-sha3
Commit 79b51366085191c2b7e478a0dc23bc74a005a2f11be16f00d2a6920a0a80526b
1 file changed +12 -4
+12 -4
--- src/rebuild.c
+++ src/rebuild.c
@@ -1073,21 +1073,26 @@
10731073
}
10741074
10751075
/*
10761076
** COMMAND: reconstruct*
10771077
**
1078
-** Usage: %fossil reconstruct FILENAME DIRECTORY
1078
+** Usage: %fossil reconstruct ?OPTIONS? FILENAME DIRECTORY
10791079
**
10801080
** This command studies the artifacts (files) in DIRECTORY and
10811081
** reconstructs the fossil record from them. It places the new
10821082
** fossil repository in FILENAME. Subdirectories are read, files
10831083
** with leading '.' in the filename are ignored.
10841084
**
1085
+** Options:
1086
+** -K|--keep-rid1 Read the filename of the artifact with
1087
+** RID=1 from the file .rid in DIRECTORY.
1088
+**
10851089
** See also: deconstruct, rebuild
10861090
*/
10871091
void reconstruct_cmd(void) {
10881092
char *zPassword;
1093
+ fKeepRid1 = find_option("keep-rid1",0,0)!=0;
10891094
if( g.argc!=4 ){
10901095
usage("FILENAME DIRECTORY");
10911096
}
10921097
if( file_isdir(g.argv[3], ExtFILE)!=1 ){
10931098
fossil_print("\"%s\" is not a directory\n\n", g.argv[3]);
@@ -1135,22 +1140,25 @@
11351140
** AABBBBBBBBB.. is the 40+ character artifact ID, AA the first 2 characters.
11361141
** If -L|--prefixlength is given, the length (default 2) of the directory
11371142
** prefix can be set to 0,1,..,9 characters.
11381143
**
11391144
** 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.
11431150
** --private Include private artifacts.
11441151
**
11451152
** See also: rebuild, reconstruct
11461153
*/
11471154
void deconstruct_cmd(void){
11481155
const char *zPrefixOpt;
11491156
Stmt s;
11501157
int privateFlag;
11511158
1159
+ fKeepRid1 = find_option("keep-rid1","K",0)!=0;
11521160
/* get and check prefix length argument and build format string */
11531161
zPrefixOpt=find_option("prefixlength","L",1);
11541162
if( !zPrefixOpt ){
11551163
prefixLength = 2;
11561164
}else{
11571165
--- 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

Keyboard Shortcuts

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