Fossil SCM
Update help for the revert command to mention the use with directories.
Commit
059cd4c6b00c15a9016903cdcadfdbddf184e362ec0c098aa8a0a0359bfee559
Parent
7252e631fbf2339…
1 file changed
+12
-8
+12
-8
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -765,28 +765,31 @@ | ||
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | /* |
| 768 | 768 | ** COMMAND: revert |
| 769 | 769 | ** |
| 770 | -** Usage: %fossil revert ?-r REVISION? ?FILE ...? | |
| 770 | +** Usage: %fossil revert ?OPTIONS? ?FILE ...? | |
| 771 | 771 | ** |
| 772 | 772 | ** Revert to the current repository version of FILE, or to |
| 773 | -** the version associated with baseline REVISION if the -r flag | |
| 774 | -** appears. | |
| 773 | +** the baseline VERSION specified with -r flag. | |
| 775 | 774 | ** |
| 776 | 775 | ** If FILE was part of a rename operation, both the original file |
| 777 | 776 | ** and the renamed file are reverted. |
| 777 | +** | |
| 778 | +** Using a directory name for any of the FILE arguments is the same | |
| 779 | +** as using every subdirectory and file beneath that directory. | |
| 778 | 780 | ** |
| 779 | 781 | ** Revert all files if no file name is provided. |
| 780 | 782 | ** |
| 781 | 783 | ** If a file is reverted accidentally, it can be restored using |
| 782 | 784 | ** the "fossil undo" command. |
| 783 | 785 | ** |
| 784 | 786 | ** Options: |
| 785 | -** -r REVISION revert given FILE(s) back to given REVISION | |
| 787 | +** -r|--revision VERSION Revert given FILE(s) back to given | |
| 788 | +** VERSION | |
| 786 | 789 | ** |
| 787 | -** See also: redo, undo, update | |
| 790 | +** See also: redo, undo, checkout, update | |
| 788 | 791 | */ |
| 789 | 792 | void revert_cmd(void){ |
| 790 | 793 | Manifest *pCoManifest; /* Manifest of current checkout */ |
| 791 | 794 | Manifest *pRvManifest; /* Manifest of selected revert version */ |
| 792 | 795 | ManifestFile *pCoFile; /* File within current checkout manifest */ |
| @@ -805,11 +808,12 @@ | ||
| 805 | 808 | |
| 806 | 809 | if( g.argc<2 ){ |
| 807 | 810 | usage("?OPTIONS? [FILE] ..."); |
| 808 | 811 | } |
| 809 | 812 | if( zRevision && g.argc<3 ){ |
| 810 | - fossil_fatal("the --revision option does not work for the entire tree"); | |
| 813 | + fossil_fatal("directories or the entire tree can only be reverted" | |
| 814 | + " back to current version"); | |
| 811 | 815 | } |
| 812 | 816 | db_must_be_within_tree(); |
| 813 | 817 | |
| 814 | 818 | /* Get manifests of revert version and (if different) current checkout. */ |
| 815 | 819 | pRvManifest = historical_manifest(zRevision); |
| @@ -872,12 +876,12 @@ | ||
| 872 | 876 | }else{ |
| 873 | 877 | revertAll = 1; |
| 874 | 878 | } |
| 875 | 879 | |
| 876 | 880 | if( revisionOptNotSupported ){ |
| 877 | - fossil_fatal("the --revision option does not work for the directories" | |
| 878 | - " or the entire tree"); | |
| 881 | + fossil_fatal("directories or the entire tree can only be reverted" | |
| 882 | + " back to current version"); | |
| 879 | 883 | } |
| 880 | 884 | |
| 881 | 885 | if ( revertAll ){ |
| 882 | 886 | int vid; |
| 883 | 887 | vid = db_lget_int("checkout", 0); |
| 884 | 888 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -765,28 +765,31 @@ | |
| 765 | } |
| 766 | |
| 767 | /* |
| 768 | ** COMMAND: revert |
| 769 | ** |
| 770 | ** Usage: %fossil revert ?-r REVISION? ?FILE ...? |
| 771 | ** |
| 772 | ** Revert to the current repository version of FILE, or to |
| 773 | ** the version associated with baseline REVISION if the -r flag |
| 774 | ** appears. |
| 775 | ** |
| 776 | ** If FILE was part of a rename operation, both the original file |
| 777 | ** and the renamed file are reverted. |
| 778 | ** |
| 779 | ** Revert all files if no file name is provided. |
| 780 | ** |
| 781 | ** If a file is reverted accidentally, it can be restored using |
| 782 | ** the "fossil undo" command. |
| 783 | ** |
| 784 | ** Options: |
| 785 | ** -r REVISION revert given FILE(s) back to given REVISION |
| 786 | ** |
| 787 | ** See also: redo, undo, update |
| 788 | */ |
| 789 | void revert_cmd(void){ |
| 790 | Manifest *pCoManifest; /* Manifest of current checkout */ |
| 791 | Manifest *pRvManifest; /* Manifest of selected revert version */ |
| 792 | ManifestFile *pCoFile; /* File within current checkout manifest */ |
| @@ -805,11 +808,12 @@ | |
| 805 | |
| 806 | if( g.argc<2 ){ |
| 807 | usage("?OPTIONS? [FILE] ..."); |
| 808 | } |
| 809 | if( zRevision && g.argc<3 ){ |
| 810 | fossil_fatal("the --revision option does not work for the entire tree"); |
| 811 | } |
| 812 | db_must_be_within_tree(); |
| 813 | |
| 814 | /* Get manifests of revert version and (if different) current checkout. */ |
| 815 | pRvManifest = historical_manifest(zRevision); |
| @@ -872,12 +876,12 @@ | |
| 872 | }else{ |
| 873 | revertAll = 1; |
| 874 | } |
| 875 | |
| 876 | if( revisionOptNotSupported ){ |
| 877 | fossil_fatal("the --revision option does not work for the directories" |
| 878 | " or the entire tree"); |
| 879 | } |
| 880 | |
| 881 | if ( revertAll ){ |
| 882 | int vid; |
| 883 | vid = db_lget_int("checkout", 0); |
| 884 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -765,28 +765,31 @@ | |
| 765 | } |
| 766 | |
| 767 | /* |
| 768 | ** COMMAND: revert |
| 769 | ** |
| 770 | ** Usage: %fossil revert ?OPTIONS? ?FILE ...? |
| 771 | ** |
| 772 | ** Revert to the current repository version of FILE, or to |
| 773 | ** the baseline VERSION specified with -r flag. |
| 774 | ** |
| 775 | ** If FILE was part of a rename operation, both the original file |
| 776 | ** and the renamed file are reverted. |
| 777 | ** |
| 778 | ** Using a directory name for any of the FILE arguments is the same |
| 779 | ** as using every subdirectory and file beneath that directory. |
| 780 | ** |
| 781 | ** Revert all files if no file name is provided. |
| 782 | ** |
| 783 | ** If a file is reverted accidentally, it can be restored using |
| 784 | ** the "fossil undo" command. |
| 785 | ** |
| 786 | ** Options: |
| 787 | ** -r|--revision VERSION Revert given FILE(s) back to given |
| 788 | ** VERSION |
| 789 | ** |
| 790 | ** See also: redo, undo, checkout, update |
| 791 | */ |
| 792 | void revert_cmd(void){ |
| 793 | Manifest *pCoManifest; /* Manifest of current checkout */ |
| 794 | Manifest *pRvManifest; /* Manifest of selected revert version */ |
| 795 | ManifestFile *pCoFile; /* File within current checkout manifest */ |
| @@ -805,11 +808,12 @@ | |
| 808 | |
| 809 | if( g.argc<2 ){ |
| 810 | usage("?OPTIONS? [FILE] ..."); |
| 811 | } |
| 812 | if( zRevision && g.argc<3 ){ |
| 813 | fossil_fatal("directories or the entire tree can only be reverted" |
| 814 | " back to current version"); |
| 815 | } |
| 816 | db_must_be_within_tree(); |
| 817 | |
| 818 | /* Get manifests of revert version and (if different) current checkout. */ |
| 819 | pRvManifest = historical_manifest(zRevision); |
| @@ -872,12 +876,12 @@ | |
| 876 | }else{ |
| 877 | revertAll = 1; |
| 878 | } |
| 879 | |
| 880 | if( revisionOptNotSupported ){ |
| 881 | fossil_fatal("directories or the entire tree can only be reverted" |
| 882 | " back to current version"); |
| 883 | } |
| 884 | |
| 885 | if ( revertAll ){ |
| 886 | int vid; |
| 887 | vid = db_lget_int("checkout", 0); |
| 888 |