58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
if( isDir==1 ) continue;
if( isDir==0 ){
fossil_fatal("not found: %s", zName);
}
if( isDir==2 && access(zName, R_OK) ){
fossil_fatal("cannot open %s", zName);
}
file_tree_name(zName, &pathname);
zPath = blob_str(&pathname);
if( strcmp(zPath, "manifest")==0
|| strcmp(zPath, "_FOSSIL_")==0
|| strcmp(zPath, "manifest.uuid")==0
){
fossil_warning("cannot add %s", zPath);
}else{
|
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
if( isDir==1 ) continue;
if( isDir==0 ){
fossil_fatal("not found: %s", zName);
}
if( isDir==2 && access(zName, R_OK) ){
fossil_fatal("cannot open %s", zName);
}
file_tree_name(zName, &pathname, 1);
zPath = blob_str(&pathname);
if( strcmp(zPath, "manifest")==0
|| strcmp(zPath, "_FOSSIL_")==0
|| strcmp(zPath, "manifest.uuid")==0
){
fossil_warning("cannot add %s", zPath);
}else{
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
db_begin_transaction();
for(i=2; i<g.argc; i++){
char *zName;
char *zPath;
Blob pathname;
zName = mprintf("%/", g.argv[i]);
file_tree_name(zName, &pathname);
zPath = blob_str(&pathname);
if( !db_exists(
"SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
fossil_fatal("not in the repository: %s", zName);
}else{
db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zPath);
}
blob_reset(&pathname);
free(zName);
}
db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
db_end_transaction(0);
}
|
|
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
db_begin_transaction();
for(i=2; i<g.argc; i++){
char *zName;
char *zPath;
Blob pathname;
zName = mprintf("%/", g.argv[i]);
file_tree_name(zName, &pathname, 1);
zPath = blob_str(&pathname);
if( !db_exists(
"SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
fossil_fatal("not in the repository: %s", zName);
}else{
db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zPath);
}
blob_reset(&pathname);
free(zName);
}
db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
db_end_transaction(0);
}
|