188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
if( find_option("dryrun","n",0)!=0 ){
syncFlags |= SYNC_UV_DRYRUN | SYNC_UV_TRACE | SYNC_VERBOSE;
}
return syncFlags;
}
/*
** COMMAND: unversioned
**
** Usage: %fossil unversioned SUBCOMMAND ARGS...
**
** Unversioned files (UV-files) are artifacts that are synced and are available
** for download but which do not preserve history. Only the most recent version
** of each UV-file is retained. Changes to an UV-file are permanent and cannot
** be undone, so use appropriate caution with this command.
**
** Subcommands:
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
if( find_option("dryrun","n",0)!=0 ){
syncFlags |= SYNC_UV_DRYRUN | SYNC_UV_TRACE | SYNC_VERBOSE;
}
return syncFlags;
}
/*
** Return true if the zName contains any whitespace
*/
static int contains_whitespace(const char *zName){
while( zName[0] ){
if( fossil_isspace(zName[0]) ) return 1;
zName++;
}
return 0;
}
/*
** COMMAND: uv*
** COMMAND: unversioned
**
** Usage: %fossil unversioned SUBCOMMAND ARGS...
** or: %fossil uv SUBCOMMAND ARGS..
**
** Unversioned files (UV-files) are artifacts that are synced and are available
** for download but which do not preserve history. Only the most recent version
** of each UV-file is retained. Changes to an UV-file are permanent and cannot
** be undone, so use appropriate caution with this command.
**
** Subcommands:
|
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
db_begin_transaction();
content_rcvid_init("#!fossil unversioned add");
for(i=3; i<g.argc; i++){
zIn = zAs ? zAs : g.argv[i];
if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
fossil_fatal("'%Q' is not an acceptable filename", zIn);
}
blob_init(&file,0,0);
blob_read_from_file(&file, g.argv[i]);
unversioned_write(zIn, &file, mtime);
blob_reset(&file);
}
db_end_transaction(0);
}else if( memcmp(zCmd, "cat", nCmd)==0 ){
|
>
>
>
|
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
|
db_begin_transaction();
content_rcvid_init("#!fossil unversioned add");
for(i=3; i<g.argc; i++){
zIn = zAs ? zAs : g.argv[i];
if( zIn[0]==0 || zIn[0]=='/' || !file_is_simple_pathname(zIn,1) ){
fossil_fatal("'%Q' is not an acceptable filename", zIn);
}
if( contains_whitespace(zIn) ){
fossil_fatal("names of unversioned files may not contain whitespace");
}
blob_init(&file,0,0);
blob_read_from_file(&file, g.argv[i]);
unversioned_write(zIn, &file, mtime);
blob_reset(&file);
}
db_end_transaction(0);
}else if( memcmp(zCmd, "cat", nCmd)==0 ){
|