| ︙ | | | ︙ | |
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
blob_reset(&repoName);
return nAdd;
}
/*
** COMMAND: add
**
** Usage: %fossil add ?OPTIONS? [--] FILE1 ?FILE2 ...?
**
** Make arrangements to add one or more files or directories to the
** current checkout at the next commit.
**
** When adding files or directories recursively, filenames that begin
** with "." are excluded by default. To include such files, add
** the "--dotfiles" option to the command-line.
|
|
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
blob_reset(&repoName);
return nAdd;
}
/*
** COMMAND: add
**
** Usage: %fossil add ?OPTIONS? ?--? FILE1 ?FILE2 ...?
**
** Make arrangements to add one or more files or directories to the
** current checkout at the next commit.
**
** When adding files or directories recursively, filenames that begin
** with "." are excluded by default. To include such files, add
** the "--dotfiles" option to the command-line.
|
| ︙ | | | ︙ | |
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
}
/*
** COMMAND: rm
** COMMAND: delete
** COMMAND: forget*
**
** Usage: %fossil rm|delete|forget ?OPTIONS? [--] FILE1 ?FILE2 ...?
**
** Remove one or more files or directories from the repository.
**
** The 'rm' and 'delete' commands do NOT normally remove the files from
** disk. They just mark the files as no longer being part of the project.
** In other words, future changes to the named files will not be versioned.
** However, the default behavior of this command may be overridden via the
|
|
|
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
}
/*
** COMMAND: rm
** COMMAND: delete
** COMMAND: forget*
**
** Usage: %fossil rm|delete|forget ?OPTIONS? ?--? FILE1 ?FILE2 ...?
**
** Remove one or more files or directories from the repository.
**
** The 'rm' and 'delete' commands do NOT normally remove the files from
** disk. They just mark the files as no longer being part of the project.
** In other words, future changes to the named files will not be versioned.
** However, the default behavior of this command may be overridden via the
|
| ︙ | | | ︙ | |
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
}
}
/*
** COMMAND: mv
** COMMAND: rename*
**
** Usage: %fossil mv|rename ?OPTIONS? [--] OLDNAME NEWNAME
** or: %fossil mv|rename ?OPTIONS? [--] OLDNAME... DIR
**
** Move or rename one or more files or directories within the repository tree.
** You can either rename a file or directory or move it to another subdirectory.
**
** The 'mv' command does NOT normally rename or move the files on disk.
** This command merely records the fact that file names have changed so
** that appropriate notations can be made at the next commit/check-in.
|
|
|
|
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
|
}
}
/*
** COMMAND: mv
** COMMAND: rename*
**
** Usage: %fossil mv|rename ?OPTIONS? ?--? OLDNAME NEWNAME
** or: %fossil mv|rename ?OPTIONS? ?--? OLDNAME... DIR
**
** Move or rename one or more files or directories within the repository tree.
** You can either rename a file or directory or move it to another subdirectory.
**
** The 'mv' command does NOT normally rename or move the files on disk.
** This command merely records the fact that file names have changed so
** that appropriate notations can be made at the next commit/check-in.
|
| ︙ | | | ︙ | |
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
verify_all_options2();
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_fatal("no checkout in which to rename files");
}
if( g.argc<4 ){
usage("?OPTIONS? [--] OLDNAME NEWNAME");
}
zDest = g.argv[g.argc-1];
db_begin_transaction();
if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
moveFiles = 0;
}else if( softFlag ){
moveFiles = 0;
|
|
|
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
verify_all_options2();
vid = db_lget_int("checkout", 0);
if( vid==0 ){
fossil_fatal("no checkout in which to rename files");
}
if( g.argc<4 ){
usage("?OPTIONS? ?--? OLDNAME NEWNAME");
}
zDest = g.argv[g.argc-1];
db_begin_transaction();
if( g.argv[1][0]=='r' ){ /* i.e. "rename" */
moveFiles = 0;
}else if( softFlag ){
moveFiles = 0;
|
| ︙ | | | ︙ | |
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
|
if( g.argc!=4 ){
origType = -1;
}else{
origType = (file_isdir(g.argv[2], RepoFILE) == 1);
}
destType = file_isdir(zDest, RepoFILE);
if( origType==-1 && destType!=1 ){
usage("?OPTIONS? [--] OLDNAME NEWNAME");
}else if( origType==1 && destType==2 ){
fossil_fatal("cannot rename '%s' to '%s' since another file named"
" '%s' exists", g.argv[2], zDest, zDest);
}else if( origType==0 && destType!=1 ){
Blob orig;
file_tree_name(g.argv[2], &orig, 0, 1);
db_multi_exec(
|
|
|
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
|
if( g.argc!=4 ){
origType = -1;
}else{
origType = (file_isdir(g.argv[2], RepoFILE) == 1);
}
destType = file_isdir(zDest, RepoFILE);
if( origType==-1 && destType!=1 ){
usage("?OPTIONS? ?--? OLDNAME NEWNAME");
}else if( origType==1 && destType==2 ){
fossil_fatal("cannot rename '%s' to '%s' since another file named"
" '%s' exists", g.argv[2], zDest, zDest);
}else if( origType==0 && destType!=1 ){
Blob orig;
file_tree_name(g.argv[2], &orig, 0, 1);
db_multi_exec(
|
| ︙ | | | ︙ | |