Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Help syntax change to match project conventions: [--] to ?--? |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | double-dash-flag |
| Files: | files | file ages | folders |
| SHA3-256: |
95ed189424cc8568fc8b0503959d2496 |
| User & Date: | stephan 2019-09-27 16:37:14.669 |
Context
|
2019-09-27
| ||
| 22:28 | Added -- support to (annotate, artifact, cat, clone). ... (check-in: ef763bcf08 user: stephan tags: double-dash-flag) | |
| 16:37 | Help syntax change to match project conventions: [--] to ?--? ... (check-in: 95ed189424 user: stephan tags: double-dash-flag) | |
| 16:26 | Added -- support to (changes, clean, extras, ls, commit). ... (check-in: 1b649b9d4e user: stephan tags: double-dash-flag) | |
Changes
Changes to src/add.c.
| ︙ | ︙ | |||
242 243 244 245 246 247 248 | blob_reset(&repoName); return nAdd; } /* ** COMMAND: add ** | | | 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 | } /* ** COMMAND: rm ** COMMAND: delete ** COMMAND: forget* ** | | | 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 | } } /* ** COMMAND: mv ** COMMAND: rename* ** | | | | 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 |
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 ){
| | | 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 |
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 ){
| | | 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(
|
| ︙ | ︙ |
Changes to src/checkin.c.
| ︙ | ︙ | |||
350 351 352 353 354 355 356 | return relativePaths; } /* ** COMMAND: changes ** COMMAND: status ** | | | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | return relativePaths; } /* ** COMMAND: changes ** COMMAND: status ** ** Usage: %fossil changes|status ?OPTIONS? ?--? ?PATHS ...? ** ** Report the change status of files in the current checkout. If one or ** more PATHS are specified, only changes among the named files and ** directories are reported. Directories are searched recursively. ** ** The status command is similar to the changes command, except it lacks ** several of the options supported by changes and it has its own header |
| ︙ | ︙ | |||
647 648 649 650 651 652 653 | } db_finalize(&q); } /* ** COMMAND: ls ** | | | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | } db_finalize(&q); } /* ** COMMAND: ls ** ** Usage: %fossil ls ?OPTIONS? ?--? ?PATHS ...? ** ** List all files in the current checkout. If PATHS is included, only the ** named files (or their children if directories) are shown. ** ** The ls command is essentially two related commands in one, depending on ** whether or not the -r option is given. -r selects a specific check-in ** version to list, in which case -R can be used to select the repository. |
| ︙ | ︙ | |||
807 808 809 810 811 812 813 | } db_finalize(&q); } /* ** COMMAND: extras ** | | | 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | } db_finalize(&q); } /* ** COMMAND: extras ** ** Usage: %fossil extras ?OPTIONS? ?--? ?PATH1 ...? ** ** Print a list of all files in the source tree that are not part of the ** current checkout. See also the "clean" command. If paths are specified, ** only files in the given directories will be listed. ** ** Files and subdirectories whose names begin with "." are normally ** ignored but can be included by adding the --dotfiles option. |
| ︙ | ︙ | |||
880 881 882 883 884 885 886 | } blob_reset(&report); } /* ** COMMAND: clean ** | | | 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | } blob_reset(&report); } /* ** COMMAND: clean ** ** Usage: %fossil clean ?OPTIONS? ?--? ?PATH ...? ** ** Delete all "extra" files in the source tree. "Extra" files are files ** that are not officially part of the checkout. If one or more PATH ** arguments appear, then only the files named, or files contained with ** directories named, will be removed. ** ** If the --prompt option is used, prompts are issued to confirm the |
| ︙ | ︙ | |||
1944 1945 1946 1947 1948 1949 1950 | return fossil_strcmp(pA[0], pB[0]); } /* ** COMMAND: ci* ** COMMAND: commit ** | | | | 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 | return fossil_strcmp(pA[0], pB[0]); } /* ** COMMAND: ci* ** COMMAND: commit ** ** Usage: %fossil commit ?OPTIONS? ?--? ?FILE...? ** or: %fossil ci ?OPTIONS? ?--? ?FILE...? ** ** Create a new version containing all of the changes in the current ** checkout. You will be prompted to enter a check-in comment unless ** the comment has been specified on the command-line using "-m" or a ** file containing the comment using -M. The editor defined in the ** "editor" fossil option (see %fossil help set) will be used, or from ** the "VISUAL" or "EDITOR" environment variables (in that order) if |
| ︙ | ︙ |
Changes to src/unversioned.c.
| ︙ | ︙ | |||
216 217 218 219 220 221 222 | ** 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: ** | | | | | | | | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | ** 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: ** ** add ?--? FILE ... Add or update one or more unversioned files in ** the local repository so that they match FILEs ** on disk. Changes are not pushed to other ** repositories until the next sync. ** ** add FILE --as UVFILE ** add --as UVFILE -- FILE ** Add or update a single file named FILE on disk ** and UVFILE in the repository unversioned file ** namespace. This variant of the 'add' command allows ** the name to be different in the repository versus ** what appears on disk, but it only allows adding ** a single file at a time. ** ** cat ?--? FILE ... Concatenate the content of FILEs to stdout. ** ** edit ?--? FILE Bring up FILE in a text editor for modification. ** ** export ?--? FILE OUTPUT ** Write the content of FILE into OUTPUT on disk ** ** list | ls Show all unversioned files held in the local ** repository. ** ** revert ?URL? Restore the state of all unversioned files in the ** local repository to match the remote repository ** URL. ** ** Options: ** -v|--verbose Extra diagnostic output ** -n|--dryrun Show what would have happened ** ** remove|rm|delete ?--? FILE ... ** Remove unversioned files from the local repository. ** Changes are not pushed to other repositories until ** the next sync. ** ** sync ?URL? Synchronize the state of all unversioned files with ** the remote repository URL. The most recent version ** of each file is propagated to all repositories and ** all prior versions are permanently forgotten. ** ** Options: ** -v|--verbose Extra diagnostic output ** -n|--dryrun Show what would have happened ** ** touch ?--? FILE ... Update the TIMESTAMP on all of the listed files ** ** Options: ** ** --mtime TIMESTAMP Use TIMESTAMP instead of "now" for the "add", ** "edit", "remove", and "touch" subcommands. ** -- For commands which support this, it means to treat ** all subsequent arguments as file names even if they |
| ︙ | ︙ | |||
296 297 298 299 300 301 302 |
const char *zIn;
const char *zAs;
const char *zFileArg;
Blob file;
int i;
zAs = find_option("as",0,1);
verify_all_options2();
| | | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
const char *zIn;
const char *zAs;
const char *zFileArg;
Blob file;
int i;
zAs = find_option("as",0,1);
verify_all_options2();
if( zAs && g.argc!=4 ) usage("add --as UVFILE ?--? DISKFILE");
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 ){
zError = "be empty string";
}else if( zIn[0]=='/' ){
|
| ︙ | ︙ | |||
340 341 342 343 344 345 346 |
const char *zEditor; /* Name of the text-editor command */
const char *zTFile; /* Temporary file */
const char *zUVFile; /* Name of the unversioned file */
char *zCmd; /* Command to run the text editor */
Blob content; /* Content of the unversioned file */
verify_all_options2();
| | | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
const char *zEditor; /* Name of the text-editor command */
const char *zTFile; /* Temporary file */
const char *zUVFile; /* Name of the unversioned file */
char *zCmd; /* Command to run the text editor */
Blob content; /* Content of the unversioned file */
verify_all_options2();
if( g.argc!=4) usage("edit ?--? UVFILE");
zUVFile = g.argv[3];
zEditor = fossil_text_editor();
if( zEditor==0 ) fossil_fatal("no text editor - set the VISUAL env variable");
zTFile = fossil_temp_filename();
if( zTFile==0 ) fossil_fatal("cannot find a temporary filename");
db_begin_transaction();
content_rcvid_init("#!fossil unversioned edit");
|
| ︙ | ︙ | |||
377 378 379 380 381 382 383 |
unversioned_write(zUVFile, &content, mtime);
db_end_transaction(0);
blob_reset(&content);
}else if( memcmp(zCmd, "export", nCmd)==0 ){
Blob content;
const char * zOutfile;
verify_all_options2();
| | | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
unversioned_write(zUVFile, &content, mtime);
db_end_transaction(0);
blob_reset(&content);
}else if( memcmp(zCmd, "export", nCmd)==0 ){
Blob content;
const char * zOutfile;
verify_all_options2();
if( g.argc!=5 ) usage("export ?--? UVFILE OUTPUT");
if( unversioned_content(g.argv[3], &content) ){
fossil_fatal("no such uv-file: %Q", g.argv[3]);
}
/*
** Pathological(?) corner case:
**
** export -- --UVFILE -
|
| ︙ | ︙ |
Changes to src/wiki.c.
| ︙ | ︙ | |||
1362 1363 1364 1365 1366 1367 1368 | /* ** COMMAND: wiki* ** ** Usage: %fossil wiki (export|create|commit|list) WikiName ** ** Run various subcommands to work with wiki entries or tech notes. ** | | | | 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 | /* ** COMMAND: wiki* ** ** Usage: %fossil wiki (export|create|commit|list) WikiName ** ** Run various subcommands to work with wiki entries or tech notes. ** ** %fossil wiki export PAGENAME ?--? ?FILE? ** %fossil wiki export -t|--technote DATETIME|TECHNOTE-ID ?--? ?FILE? ** ** Sends the latest version of either a wiki page or of a tech note ** to the given file or standard output. ** If PAGENAME is provided, the wiki page will be output. For ** a tech note either DATETIME or TECHNOTE-ID must be specified. If ** DATETIME is used, the most recently modified tech note with that ** DATETIME will be sent. |
| ︙ | ︙ | |||
1452 1453 1454 1455 1456 1457 1458 |
char *zBody = 0; /* Wiki page content */
Blob body; /* Wiki page content */
Manifest *pWiki = 0; /* Parsed wiki page content */
zETime = find_option("technote","t",1);
verify_all_options2();
if( !zETime ){
if( (g.argc!=4) && (g.argc!=5) ){
| | | | 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 |
char *zBody = 0; /* Wiki page content */
Blob body; /* Wiki page content */
Manifest *pWiki = 0; /* Parsed wiki page content */
zETime = find_option("technote","t",1);
verify_all_options2();
if( !zETime ){
if( (g.argc!=4) && (g.argc!=5) ){
usage("export PAGENAME ?--? ?FILE?");
}
zPageName = g.argv[3];
rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
" ORDER BY x.mtime DESC LIMIT 1",
zPageName
);
if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){
zBody = pWiki->zWiki;
}
if( zBody==0 ){
fossil_fatal("wiki page [%s] not found",zPageName);
}
zFile = g.argc==4 ? "-" : get_dash_filename_arg(4);
}else{
if( (g.argc!=3) && (g.argc!=4) ){
usage("export --technote DATETIME|TECHNOTE-ID ?--? ?FILE?");
}
rid = wiki_technote_to_rid(zETime);
if ( rid==-1 ){
fossil_fatal("ambiguous tech note id: %s", zETime);
}
if( (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0 ){
zBody = pWiki->zWiki;
|
| ︙ | ︙ | |||
1505 1506 1507 1508 1509 1510 1511 |
const char *zETime = find_option("technote", "t", 1);
const char *zTags = find_option("technote-tags", NULL, 1);
const char *zClr = find_option("technote-bgcolor", NULL, 1);
verify_all_options2();
if( g.argc!=4 && g.argc!=5 ){
usage("commit|create PAGENAME [--mimetype TEXT-FORMAT]"
" [--technote DATETIME] [--technote-tags TAGS]"
| | | 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 |
const char *zETime = find_option("technote", "t", 1);
const char *zTags = find_option("technote-tags", NULL, 1);
const char *zClr = find_option("technote-bgcolor", NULL, 1);
verify_all_options2();
if( g.argc!=4 && g.argc!=5 ){
usage("commit|create PAGENAME [--mimetype TEXT-FORMAT]"
" [--technote DATETIME] [--technote-tags TAGS]"
" [--technote-bgcolor COLOR] ?--? ?FILE?");
}
zPageName = g.argv[3];
if( g.argc==4 ){
blob_read_from_channel(&content, stdin, -1);
}else{
const char * zFilename = get_dash_filename_arg(4);
blob_read_from_file(&content, zFilename, ExtFILE);
|
| ︙ | ︙ |