Fossil SCM

fix manifest creation bugs

baruch 2014-10-21 12:18 svn-import
Commit ffd61eedf5a1e8f7761322da2985a499eddeb88f
2 files changed +7 -3 -2
+7 -3
--- src/import.c
+++ src/import.c
@@ -883,10 +883,11 @@
883883
884884
static void svn_create_manifests(){
885885
Blob manifest;
886886
Stmt qRev;
887887
Stmt qFiles;
888
+ int parentRid = 0;
888889
889890
blob_zero(&manifest);
890891
db_prepare(&qRev, "SELECT trev, tuser, tmsg, ttime FROM xrevisions"
891892
" ORDER BY trev");
892893
db_prepare(&qFiles, "SELECT tpath, uuid, tperm"
@@ -895,11 +896,10 @@
895896
while( db_step(&qRev)==SQLITE_ROW ){
896897
int rev = db_column_int(&qRev, 0);
897898
const char *zUser = db_column_text(&qRev, 1);
898899
const char *zMsg = db_column_text(&qRev, 2);
899900
const char *zTime = db_column_text(&qRev, 3);
900
- int parentRid = 0;
901901
Blob mcksum;
902902
blob_reset(&manifest);
903903
if( zMsg ){
904904
blob_appendf(&manifest, "C %F\n", zMsg);
905905
}else{
@@ -914,13 +914,17 @@
914914
blob_appendf(&manifest, "F %F %s %s\n", zFile, zUuid, zPerm);
915915
}
916916
db_reset(&qFiles);
917917
if( parentRid>0 ){
918918
const char *zParent;
919
- zParent = db_text(0, "SELECT uuid FROM blob WEHRE rid=%d", parentRid);
920
- blob_appendf(&manifest, "P %s", zParent);
919
+ zParent = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", parentRid);
920
+ blob_appendf(&manifest, "P %s\n", zParent);
921921
fossil_free(zParent);
922
+ }else{
923
+ blob_appendf(&manifest, "R d41d8cd98f00b204e9800998ecf8427e\n");
924
+ blob_appendf(&manifest, "T *branch * trunk\n");
925
+ blob_appendf(&manifest, "T *sym-trunk *\n");
922926
}
923927
if( zUser ){
924928
blob_appendf(&manifest, "U %F\n", zUser);
925929
}else{
926930
const char *zUserOvrd = find_option("user-override",0,1);
927931
--- src/import.c
+++ src/import.c
@@ -883,10 +883,11 @@
883
884 static void svn_create_manifests(){
885 Blob manifest;
886 Stmt qRev;
887 Stmt qFiles;
 
888
889 blob_zero(&manifest);
890 db_prepare(&qRev, "SELECT trev, tuser, tmsg, ttime FROM xrevisions"
891 " ORDER BY trev");
892 db_prepare(&qFiles, "SELECT tpath, uuid, tperm"
@@ -895,11 +896,10 @@
895 while( db_step(&qRev)==SQLITE_ROW ){
896 int rev = db_column_int(&qRev, 0);
897 const char *zUser = db_column_text(&qRev, 1);
898 const char *zMsg = db_column_text(&qRev, 2);
899 const char *zTime = db_column_text(&qRev, 3);
900 int parentRid = 0;
901 Blob mcksum;
902 blob_reset(&manifest);
903 if( zMsg ){
904 blob_appendf(&manifest, "C %F\n", zMsg);
905 }else{
@@ -914,13 +914,17 @@
914 blob_appendf(&manifest, "F %F %s %s\n", zFile, zUuid, zPerm);
915 }
916 db_reset(&qFiles);
917 if( parentRid>0 ){
918 const char *zParent;
919 zParent = db_text(0, "SELECT uuid FROM blob WEHRE rid=%d", parentRid);
920 blob_appendf(&manifest, "P %s", zParent);
921 fossil_free(zParent);
 
 
 
 
922 }
923 if( zUser ){
924 blob_appendf(&manifest, "U %F\n", zUser);
925 }else{
926 const char *zUserOvrd = find_option("user-override",0,1);
927
--- src/import.c
+++ src/import.c
@@ -883,10 +883,11 @@
883
884 static void svn_create_manifests(){
885 Blob manifest;
886 Stmt qRev;
887 Stmt qFiles;
888 int parentRid = 0;
889
890 blob_zero(&manifest);
891 db_prepare(&qRev, "SELECT trev, tuser, tmsg, ttime FROM xrevisions"
892 " ORDER BY trev");
893 db_prepare(&qFiles, "SELECT tpath, uuid, tperm"
@@ -895,11 +896,10 @@
896 while( db_step(&qRev)==SQLITE_ROW ){
897 int rev = db_column_int(&qRev, 0);
898 const char *zUser = db_column_text(&qRev, 1);
899 const char *zMsg = db_column_text(&qRev, 2);
900 const char *zTime = db_column_text(&qRev, 3);
 
901 Blob mcksum;
902 blob_reset(&manifest);
903 if( zMsg ){
904 blob_appendf(&manifest, "C %F\n", zMsg);
905 }else{
@@ -914,13 +914,17 @@
914 blob_appendf(&manifest, "F %F %s %s\n", zFile, zUuid, zPerm);
915 }
916 db_reset(&qFiles);
917 if( parentRid>0 ){
918 const char *zParent;
919 zParent = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", parentRid);
920 blob_appendf(&manifest, "P %s\n", zParent);
921 fossil_free(zParent);
922 }else{
923 blob_appendf(&manifest, "R d41d8cd98f00b204e9800998ecf8427e\n");
924 blob_appendf(&manifest, "T *branch * trunk\n");
925 blob_appendf(&manifest, "T *sym-trunk *\n");
926 }
927 if( zUser ){
928 blob_appendf(&manifest, "U %F\n", zUser);
929 }else{
930 const char *zUserOvrd = find_option("user-override",0,1);
931
--- src/manifest.c
+++ src/manifest.c
@@ -594,11 +594,10 @@
594594
SYNTAX("incorrect J-card sort order");
595595
}
596596
break;
597597
}
598598
599
-
600599
/*
601600
** K <uuid>
602601
**
603602
** A K-line gives the UUID for the ticket which this control file
604603
** is amending.
@@ -840,11 +839,10 @@
840839
if( x.z[0]!='\n' ) SYNTAX("W-card content no \\n terminated");
841840
x.z[0] = 0;
842841
x.z++;
843842
break;
844843
}
845
-
846844
847845
/*
848846
** Z <md5sum>
849847
**
850848
** MD5 checksum on this control file. The checksum is over all
851849
--- src/manifest.c
+++ src/manifest.c
@@ -594,11 +594,10 @@
594 SYNTAX("incorrect J-card sort order");
595 }
596 break;
597 }
598
599
600 /*
601 ** K <uuid>
602 **
603 ** A K-line gives the UUID for the ticket which this control file
604 ** is amending.
@@ -840,11 +839,10 @@
840 if( x.z[0]!='\n' ) SYNTAX("W-card content no \\n terminated");
841 x.z[0] = 0;
842 x.z++;
843 break;
844 }
845
846
847 /*
848 ** Z <md5sum>
849 **
850 ** MD5 checksum on this control file. The checksum is over all
851
--- src/manifest.c
+++ src/manifest.c
@@ -594,11 +594,10 @@
594 SYNTAX("incorrect J-card sort order");
595 }
596 break;
597 }
598
 
599 /*
600 ** K <uuid>
601 **
602 ** A K-line gives the UUID for the ticket which this control file
603 ** is amending.
@@ -840,11 +839,10 @@
839 if( x.z[0]!='\n' ) SYNTAX("W-card content no \\n terminated");
840 x.z[0] = 0;
841 x.z++;
842 break;
843 }
 
844
845 /*
846 ** Z <md5sum>
847 **
848 ** MD5 checksum on this control file. The checksum is over all
849

Keyboard Shortcuts

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