Fossil SCM

prepare for svn branch importing

baruch 2014-10-21 12:32 svn-import
Commit bb1d783544b88de5c4d63f8bd0287b3921f25d63
1 file changed +14 -12
+14 -12
--- src/import.c
+++ src/import.c
@@ -1051,12 +1051,16 @@
10511051
** argument. If no input file is supplied the interchange format
10521052
** data is read from standard input.
10531053
**
10541054
** The following formats are currently understood by this command
10551055
**
1056
-** --git Import from the git-fast-export file format
1057
-** --svn Import from the svnadmin-dump file format
1056
+** git Import from the git-fast-export file format
1057
+**
1058
+** svn Import from the svnadmin-dump file format
1059
+** Options:
1060
+** --flat The whole dump is a single branch. The default
1061
+** is to use the trunk/branches/tags svn layout
10581062
**
10591063
** The --incremental option allows an existing repository to be extended
10601064
** with new content.
10611065
**
10621066
** Options:
@@ -1068,34 +1072,32 @@
10681072
char *zPassword;
10691073
FILE *pIn;
10701074
Stmt q;
10711075
int forceFlag = find_option("force", "f", 0)!=0;
10721076
int incrFlag = find_option("incremental", "i", 0)!=0;
1073
- int gitFlag = find_option("git",0,0)!=0;
1074
- int svnFlag = find_option("svn",0,0)!=0;
10751077
10761078
verify_all_options();
1077
- if( g.argc!=3 && g.argc!=4 ){
1079
+ if( g.argc!=4 && g.argc!=5 ){
10781080
usage("FORMAT REPOSITORY-NAME");
10791081
}
1080
- if( g.argc==4 ){
1081
- pIn = fossil_fopen(g.argv[3], "rb");
1082
+ if( g.argc==5 ){
1083
+ pIn = fossil_fopen(g.argv[4], "rb");
10821084
}else{
10831085
pIn = stdin;
10841086
fossil_binary_mode(pIn);
10851087
}
10861088
if( !incrFlag ){
1087
- if( forceFlag ) file_delete(g.argv[2]);
1088
- db_create_repository(g.argv[2]);
1089
+ if( forceFlag ) file_delete(g.argv[3]);
1090
+ db_create_repository(g.argv[3]);
10891091
}
1090
- db_open_repository(g.argv[2]);
1092
+ db_open_repository(g.argv[3]);
10911093
db_open_config(0);
10921094
10931095
db_begin_transaction();
10941096
if( !incrFlag ) db_initial_setup(0, 0, 0, 1);
10951097
1096
- if( gitFlag ){
1098
+ if( strncmp(g.argv[2], "git", 3)==0 ){
10971099
/* The following temp-tables are used to hold information needed for
10981100
** the import.
10991101
**
11001102
** The XMARK table provides a mapping from fast-import "marks" and symbols
11011103
** into artifact ids (UUIDs - the 40-byte hex SHA1 hash of artifacts).
@@ -1127,11 +1129,11 @@
11271129
fast_insert_content(&record, 0, 0);
11281130
import_reset(0);
11291131
}
11301132
db_finalize(&q);
11311133
}else
1132
- if( svnFlag ){
1134
+ if( strncmp(g.argv[2], "svn", 3)==0 ){
11331135
db_multi_exec(
11341136
"CREATE TEMP TABLE xrevisions("
11351137
" trev INT, tuser TEXT, tmsg TEXT, ttime DATETIME"
11361138
");"
11371139
"CREATE TEMP TABLE xfiles("
11381140
--- src/import.c
+++ src/import.c
@@ -1051,12 +1051,16 @@
1051 ** argument. If no input file is supplied the interchange format
1052 ** data is read from standard input.
1053 **
1054 ** The following formats are currently understood by this command
1055 **
1056 ** --git Import from the git-fast-export file format
1057 ** --svn Import from the svnadmin-dump file format
 
 
 
 
1058 **
1059 ** The --incremental option allows an existing repository to be extended
1060 ** with new content.
1061 **
1062 ** Options:
@@ -1068,34 +1072,32 @@
1068 char *zPassword;
1069 FILE *pIn;
1070 Stmt q;
1071 int forceFlag = find_option("force", "f", 0)!=0;
1072 int incrFlag = find_option("incremental", "i", 0)!=0;
1073 int gitFlag = find_option("git",0,0)!=0;
1074 int svnFlag = find_option("svn",0,0)!=0;
1075
1076 verify_all_options();
1077 if( g.argc!=3 && g.argc!=4 ){
1078 usage("FORMAT REPOSITORY-NAME");
1079 }
1080 if( g.argc==4 ){
1081 pIn = fossil_fopen(g.argv[3], "rb");
1082 }else{
1083 pIn = stdin;
1084 fossil_binary_mode(pIn);
1085 }
1086 if( !incrFlag ){
1087 if( forceFlag ) file_delete(g.argv[2]);
1088 db_create_repository(g.argv[2]);
1089 }
1090 db_open_repository(g.argv[2]);
1091 db_open_config(0);
1092
1093 db_begin_transaction();
1094 if( !incrFlag ) db_initial_setup(0, 0, 0, 1);
1095
1096 if( gitFlag ){
1097 /* The following temp-tables are used to hold information needed for
1098 ** the import.
1099 **
1100 ** The XMARK table provides a mapping from fast-import "marks" and symbols
1101 ** into artifact ids (UUIDs - the 40-byte hex SHA1 hash of artifacts).
@@ -1127,11 +1129,11 @@
1127 fast_insert_content(&record, 0, 0);
1128 import_reset(0);
1129 }
1130 db_finalize(&q);
1131 }else
1132 if( svnFlag ){
1133 db_multi_exec(
1134 "CREATE TEMP TABLE xrevisions("
1135 " trev INT, tuser TEXT, tmsg TEXT, ttime DATETIME"
1136 ");"
1137 "CREATE TEMP TABLE xfiles("
1138
--- src/import.c
+++ src/import.c
@@ -1051,12 +1051,16 @@
1051 ** argument. If no input file is supplied the interchange format
1052 ** data is read from standard input.
1053 **
1054 ** The following formats are currently understood by this command
1055 **
1056 ** git Import from the git-fast-export file format
1057 **
1058 ** svn Import from the svnadmin-dump file format
1059 ** Options:
1060 ** --flat The whole dump is a single branch. The default
1061 ** is to use the trunk/branches/tags svn layout
1062 **
1063 ** The --incremental option allows an existing repository to be extended
1064 ** with new content.
1065 **
1066 ** Options:
@@ -1068,34 +1072,32 @@
1072 char *zPassword;
1073 FILE *pIn;
1074 Stmt q;
1075 int forceFlag = find_option("force", "f", 0)!=0;
1076 int incrFlag = find_option("incremental", "i", 0)!=0;
 
 
1077
1078 verify_all_options();
1079 if( g.argc!=4 && g.argc!=5 ){
1080 usage("FORMAT REPOSITORY-NAME");
1081 }
1082 if( g.argc==5 ){
1083 pIn = fossil_fopen(g.argv[4], "rb");
1084 }else{
1085 pIn = stdin;
1086 fossil_binary_mode(pIn);
1087 }
1088 if( !incrFlag ){
1089 if( forceFlag ) file_delete(g.argv[3]);
1090 db_create_repository(g.argv[3]);
1091 }
1092 db_open_repository(g.argv[3]);
1093 db_open_config(0);
1094
1095 db_begin_transaction();
1096 if( !incrFlag ) db_initial_setup(0, 0, 0, 1);
1097
1098 if( strncmp(g.argv[2], "git", 3)==0 ){
1099 /* The following temp-tables are used to hold information needed for
1100 ** the import.
1101 **
1102 ** The XMARK table provides a mapping from fast-import "marks" and symbols
1103 ** into artifact ids (UUIDs - the 40-byte hex SHA1 hash of artifacts).
@@ -1127,11 +1129,11 @@
1129 fast_insert_content(&record, 0, 0);
1130 import_reset(0);
1131 }
1132 db_finalize(&q);
1133 }else
1134 if( strncmp(g.argv[2], "svn", 3)==0 ){
1135 db_multi_exec(
1136 "CREATE TEMP TABLE xrevisions("
1137 " trev INT, tuser TEXT, tmsg TEXT, ttime DATETIME"
1138 ");"
1139 "CREATE TEMP TABLE xfiles("
1140

Keyboard Shortcuts

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