Fossil SCM

Update help for the revert command to mention the use with directories.

ashepilko 2020-05-01 20:32 revert-dir
Commit 059cd4c6b00c15a9016903cdcadfdbddf184e362ec0c098aa8a0a0359bfee559
1 file changed +12 -8
+12 -8
--- src/update.c
+++ src/update.c
@@ -765,28 +765,31 @@
765765
}
766766
767767
/*
768768
** COMMAND: revert
769769
**
770
-** Usage: %fossil revert ?-r REVISION? ?FILE ...?
770
+** Usage: %fossil revert ?OPTIONS? ?FILE ...?
771771
**
772772
** 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.
775774
**
776775
** If FILE was part of a rename operation, both the original file
777776
** 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.
778780
**
779781
** Revert all files if no file name is provided.
780782
**
781783
** If a file is reverted accidentally, it can be restored using
782784
** the "fossil undo" command.
783785
**
784786
** 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
786789
**
787
-** See also: redo, undo, update
790
+** See also: redo, undo, checkout, update
788791
*/
789792
void revert_cmd(void){
790793
Manifest *pCoManifest; /* Manifest of current checkout */
791794
Manifest *pRvManifest; /* Manifest of selected revert version */
792795
ManifestFile *pCoFile; /* File within current checkout manifest */
@@ -805,11 +808,12 @@
805808
806809
if( g.argc<2 ){
807810
usage("?OPTIONS? [FILE] ...");
808811
}
809812
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");
811815
}
812816
db_must_be_within_tree();
813817
814818
/* Get manifests of revert version and (if different) current checkout. */
815819
pRvManifest = historical_manifest(zRevision);
@@ -872,12 +876,12 @@
872876
}else{
873877
revertAll = 1;
874878
}
875879
876880
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");
879883
}
880884
881885
if ( revertAll ){
882886
int vid;
883887
vid = db_lget_int("checkout", 0);
884888
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button