Fossil SCM

Change the name of the --changes option on "fossil diff" to --checkin.

drh 2016-09-30 15:18 UTC diff-show-changes
Commit 65724af1ce9ebe52ad68a621acc7fa6ebc949afe
1 file changed +20 -18
+20 -18
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -774,12 +774,12 @@
774774
** If the "--to VERSION" option appears, it specifies the check-in from
775775
** which the second version of the file or files is taken. If there is
776776
** no "--to" option then the (possibly edited) files in the current check-out
777777
** are used.
778778
**
779
-** If the "--changes VERSION" option appears, it shows the changes made by
780
-** check-in VERSION.
779
+** If the "--checkin VERSION" option shows the changes made by
780
+** check-in VERSION relative to its primary parent
781781
**
782782
** The "-i" command-line option forces the use of the internal diff logic
783783
** rather than any external diff program that might be configured using
784784
** the "setting" command. If no external diff program is configured, then
785785
** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -796,10 +796,11 @@
796796
**
797797
** Options:
798798
** --binary PATTERN Treat files that match the glob PATTERN as binary
799799
** --branch BRANCH Show diff of all changes on BRANCH
800800
** --brief Show filenames only
801
+** --checkin VERSION Show diff of all changes in VERSION
801802
** --context|-c N Use N lines of context
802803
** --diff-binary BOOL Include binary files when using external commands
803804
** --exec-abs-paths Force absolute path names with external commands.
804805
** --exec-rel-paths Force relative path names with external commands.
805806
** --from|-r VERSION Select VERSION as source for the diff
@@ -806,11 +807,10 @@
806807
** --internal|-i Use internal diff logic
807808
** --side-by-side|-y Side-by-side diff
808809
** --strip-trailing-cr Strip trailing CR
809810
** --tk Launch a Tcl/Tk GUI for display
810811
** --to VERSION Select VERSION as target for the diff
811
-** --changes VERSION Show diff of all changes in VERSION
812812
** --undo Diff against the "undo" buffer
813813
** --unified Unified diff
814814
** -v|--verbose Output complete text of added or deleted files
815815
** -w|--ignore-all-space Ignore white space when comparing lines
816816
** -W|--width <num> Width of lines in side-by-side diff
@@ -820,11 +820,11 @@
820820
int isGDiff; /* True for gdiff. False for normal diff */
821821
int isInternDiff; /* True for internal diff */
822822
int verboseFlag; /* True if -v or --verbose flag is used */
823823
const char *zFrom; /* Source version number */
824824
const char *zTo; /* Target version number */
825
- const char *zChanges; /* Check-in version number */
825
+ const char *zCheckin; /* Check-in version number */
826826
const char *zBranch; /* Branch to diff */
827827
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
828828
const char *zBinGlob = 0; /* Treat file names matching this as binary */
829829
int fIncludeBinary = 0; /* Include binary files for external diff */
830830
int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -837,32 +837,32 @@
837837
}
838838
isGDiff = g.argv[1][0]=='g';
839839
isInternDiff = find_option("internal","i",0)!=0;
840840
zFrom = find_option("from", "r", 1);
841841
zTo = find_option("to", 0, 1);
842
- zChanges = find_option("changes", 0, 1);
842
+ zCheckin = find_option("checkin", 0, 1);
843843
zBranch = find_option("branch", 0, 1);
844844
againstUndo = find_option("undo",0,0)!=0;
845845
diffFlags = diff_options();
846846
verboseFlag = find_option("verbose","v",0)!=0;
847847
if( !verboseFlag ){
848848
verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
849849
}
850850
if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
851
- if( againstUndo && ( zFrom!=0 || zTo!=0 || zChanges!=0 || zBranch!=0) ){
852
- fossil_fatal("cannot use --undo together with --from, --to, --changes,"
851
+ if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
852
+ fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
853853
" or --branch");
854854
}
855855
if( zBranch ){
856
- if( zTo || zFrom || zChanges ){
857
- fossil_fatal("cannot use --from, --to, or --changes with --branch");
856
+ if( zTo || zFrom || zCheckin ){
857
+ fossil_fatal("cannot use --from, --to, or --checkin with --branch");
858858
}
859859
zTo = zBranch;
860860
zFrom = mprintf("root:%s", zBranch);
861861
}
862
- if( zChanges!=0 && ( zFrom!=0 || zTo!=0 ) ){
863
- fossil_fatal("cannot use --changes together with --from or --to");
862
+ if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
863
+ fossil_fatal("cannot use --checkin together with --from or --to");
864864
}
865865
if( zTo==0 || againstUndo ){
866866
db_must_be_within_tree();
867867
}else if( zFrom==0 ){
868868
fossil_fatal("must use --from if --to is present");
@@ -892,17 +892,19 @@
892892
pFileDir[i-2].nName = blob_size(&fname);
893893
pFileDir[i-2].nUsed = 0;
894894
blob_reset(&fname);
895895
}
896896
}
897
- if ( zChanges!=0 ){
898
- zTo = zChanges;
899
- compute_direct_ancestors(name_to_rid(zChanges));
900
- zFrom = db_text(0, "SELECT uuid FROM blob AS b JOIN ancestor AS a"
901
- " ON b.rid=a.rid WHERE generation = 2");
902
- if( zFrom==0 ) {
903
- fossil_fatal("No immediate ancestor found for %s", zChanges);
897
+ if ( zCheckin!=0 ){
898
+ int ridTo = name_to_typed_rid(zCheckin, "ci");
899
+ zTo = zCheckin;
900
+ zFrom = db_text(0,
901
+ "SELECT uuid FROM blob, plink"
902
+ " WHERE plink.cid=%d AND plink.isprim AND plink.pid=blob.rid",
903
+ ridTo);
904
+ if( zFrom==0 ){
905
+ fossil_fatal("check-in %z has no parent", zTo);
904906
}
905907
}
906908
if( againstUndo ){
907909
if( db_lget_int("undo_available",0)==0 ){
908910
fossil_print("No undo or redo is available\n");
909911
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -774,12 +774,12 @@
774 ** If the "--to VERSION" option appears, it specifies the check-in from
775 ** which the second version of the file or files is taken. If there is
776 ** no "--to" option then the (possibly edited) files in the current check-out
777 ** are used.
778 **
779 ** If the "--changes VERSION" option appears, it shows the changes made by
780 ** check-in VERSION.
781 **
782 ** The "-i" command-line option forces the use of the internal diff logic
783 ** rather than any external diff program that might be configured using
784 ** the "setting" command. If no external diff program is configured, then
785 ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -796,10 +796,11 @@
796 **
797 ** Options:
798 ** --binary PATTERN Treat files that match the glob PATTERN as binary
799 ** --branch BRANCH Show diff of all changes on BRANCH
800 ** --brief Show filenames only
 
801 ** --context|-c N Use N lines of context
802 ** --diff-binary BOOL Include binary files when using external commands
803 ** --exec-abs-paths Force absolute path names with external commands.
804 ** --exec-rel-paths Force relative path names with external commands.
805 ** --from|-r VERSION Select VERSION as source for the diff
@@ -806,11 +807,10 @@
806 ** --internal|-i Use internal diff logic
807 ** --side-by-side|-y Side-by-side diff
808 ** --strip-trailing-cr Strip trailing CR
809 ** --tk Launch a Tcl/Tk GUI for display
810 ** --to VERSION Select VERSION as target for the diff
811 ** --changes VERSION Show diff of all changes in VERSION
812 ** --undo Diff against the "undo" buffer
813 ** --unified Unified diff
814 ** -v|--verbose Output complete text of added or deleted files
815 ** -w|--ignore-all-space Ignore white space when comparing lines
816 ** -W|--width <num> Width of lines in side-by-side diff
@@ -820,11 +820,11 @@
820 int isGDiff; /* True for gdiff. False for normal diff */
821 int isInternDiff; /* True for internal diff */
822 int verboseFlag; /* True if -v or --verbose flag is used */
823 const char *zFrom; /* Source version number */
824 const char *zTo; /* Target version number */
825 const char *zChanges; /* Check-in version number */
826 const char *zBranch; /* Branch to diff */
827 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
828 const char *zBinGlob = 0; /* Treat file names matching this as binary */
829 int fIncludeBinary = 0; /* Include binary files for external diff */
830 int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -837,32 +837,32 @@
837 }
838 isGDiff = g.argv[1][0]=='g';
839 isInternDiff = find_option("internal","i",0)!=0;
840 zFrom = find_option("from", "r", 1);
841 zTo = find_option("to", 0, 1);
842 zChanges = find_option("changes", 0, 1);
843 zBranch = find_option("branch", 0, 1);
844 againstUndo = find_option("undo",0,0)!=0;
845 diffFlags = diff_options();
846 verboseFlag = find_option("verbose","v",0)!=0;
847 if( !verboseFlag ){
848 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
849 }
850 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
851 if( againstUndo && ( zFrom!=0 || zTo!=0 || zChanges!=0 || zBranch!=0) ){
852 fossil_fatal("cannot use --undo together with --from, --to, --changes,"
853 " or --branch");
854 }
855 if( zBranch ){
856 if( zTo || zFrom || zChanges ){
857 fossil_fatal("cannot use --from, --to, or --changes with --branch");
858 }
859 zTo = zBranch;
860 zFrom = mprintf("root:%s", zBranch);
861 }
862 if( zChanges!=0 && ( zFrom!=0 || zTo!=0 ) ){
863 fossil_fatal("cannot use --changes together with --from or --to");
864 }
865 if( zTo==0 || againstUndo ){
866 db_must_be_within_tree();
867 }else if( zFrom==0 ){
868 fossil_fatal("must use --from if --to is present");
@@ -892,17 +892,19 @@
892 pFileDir[i-2].nName = blob_size(&fname);
893 pFileDir[i-2].nUsed = 0;
894 blob_reset(&fname);
895 }
896 }
897 if ( zChanges!=0 ){
898 zTo = zChanges;
899 compute_direct_ancestors(name_to_rid(zChanges));
900 zFrom = db_text(0, "SELECT uuid FROM blob AS b JOIN ancestor AS a"
901 " ON b.rid=a.rid WHERE generation = 2");
902 if( zFrom==0 ) {
903 fossil_fatal("No immediate ancestor found for %s", zChanges);
 
 
904 }
905 }
906 if( againstUndo ){
907 if( db_lget_int("undo_available",0)==0 ){
908 fossil_print("No undo or redo is available\n");
909
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -774,12 +774,12 @@
774 ** If the "--to VERSION" option appears, it specifies the check-in from
775 ** which the second version of the file or files is taken. If there is
776 ** no "--to" option then the (possibly edited) files in the current check-out
777 ** are used.
778 **
779 ** If the "--checkin VERSION" option shows the changes made by
780 ** check-in VERSION relative to its primary parent
781 **
782 ** The "-i" command-line option forces the use of the internal diff logic
783 ** rather than any external diff program that might be configured using
784 ** the "setting" command. If no external diff program is configured, then
785 ** the "-i" option is a no-op. The "-i" option converts "gdiff" into "diff".
@@ -796,10 +796,11 @@
796 **
797 ** Options:
798 ** --binary PATTERN Treat files that match the glob PATTERN as binary
799 ** --branch BRANCH Show diff of all changes on BRANCH
800 ** --brief Show filenames only
801 ** --checkin VERSION Show diff of all changes in VERSION
802 ** --context|-c N Use N lines of context
803 ** --diff-binary BOOL Include binary files when using external commands
804 ** --exec-abs-paths Force absolute path names with external commands.
805 ** --exec-rel-paths Force relative path names with external commands.
806 ** --from|-r VERSION Select VERSION as source for the diff
@@ -806,11 +807,10 @@
807 ** --internal|-i Use internal diff logic
808 ** --side-by-side|-y Side-by-side diff
809 ** --strip-trailing-cr Strip trailing CR
810 ** --tk Launch a Tcl/Tk GUI for display
811 ** --to VERSION Select VERSION as target for the diff
 
812 ** --undo Diff against the "undo" buffer
813 ** --unified Unified diff
814 ** -v|--verbose Output complete text of added or deleted files
815 ** -w|--ignore-all-space Ignore white space when comparing lines
816 ** -W|--width <num> Width of lines in side-by-side diff
@@ -820,11 +820,11 @@
820 int isGDiff; /* True for gdiff. False for normal diff */
821 int isInternDiff; /* True for internal diff */
822 int verboseFlag; /* True if -v or --verbose flag is used */
823 const char *zFrom; /* Source version number */
824 const char *zTo; /* Target version number */
825 const char *zCheckin; /* Check-in version number */
826 const char *zBranch; /* Branch to diff */
827 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
828 const char *zBinGlob = 0; /* Treat file names matching this as binary */
829 int fIncludeBinary = 0; /* Include binary files for external diff */
830 int againstUndo = 0; /* Diff against files in the undo buffer */
@@ -837,32 +837,32 @@
837 }
838 isGDiff = g.argv[1][0]=='g';
839 isInternDiff = find_option("internal","i",0)!=0;
840 zFrom = find_option("from", "r", 1);
841 zTo = find_option("to", 0, 1);
842 zCheckin = find_option("checkin", 0, 1);
843 zBranch = find_option("branch", 0, 1);
844 againstUndo = find_option("undo",0,0)!=0;
845 diffFlags = diff_options();
846 verboseFlag = find_option("verbose","v",0)!=0;
847 if( !verboseFlag ){
848 verboseFlag = find_option("new-file","N",0)!=0; /* deprecated */
849 }
850 if( verboseFlag ) diffFlags |= DIFF_VERBOSE;
851 if( againstUndo && ( zFrom!=0 || zTo!=0 || zCheckin!=0 || zBranch!=0) ){
852 fossil_fatal("cannot use --undo together with --from, --to, --checkin,"
853 " or --branch");
854 }
855 if( zBranch ){
856 if( zTo || zFrom || zCheckin ){
857 fossil_fatal("cannot use --from, --to, or --checkin with --branch");
858 }
859 zTo = zBranch;
860 zFrom = mprintf("root:%s", zBranch);
861 }
862 if( zCheckin!=0 && ( zFrom!=0 || zTo!=0 ) ){
863 fossil_fatal("cannot use --checkin together with --from or --to");
864 }
865 if( zTo==0 || againstUndo ){
866 db_must_be_within_tree();
867 }else if( zFrom==0 ){
868 fossil_fatal("must use --from if --to is present");
@@ -892,17 +892,19 @@
892 pFileDir[i-2].nName = blob_size(&fname);
893 pFileDir[i-2].nUsed = 0;
894 blob_reset(&fname);
895 }
896 }
897 if ( zCheckin!=0 ){
898 int ridTo = name_to_typed_rid(zCheckin, "ci");
899 zTo = zCheckin;
900 zFrom = db_text(0,
901 "SELECT uuid FROM blob, plink"
902 " WHERE plink.cid=%d AND plink.isprim AND plink.pid=blob.rid",
903 ridTo);
904 if( zFrom==0 ){
905 fossil_fatal("check-in %z has no parent", zTo);
906 }
907 }
908 if( againstUndo ){
909 if( db_lget_int("undo_available",0)==0 ){
910 fossil_print("No undo or redo is available\n");
911

Keyboard Shortcuts

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