Fossil SCM
One more: --new-file makes the diff command much more verbose. Fix /event?v=
Commit
0a5abbee920b75202c3866f38ef5f894eac3bd98
Parent
34ed0afc8ac538d…
2 files changed
+7
-4
+1
-1
+7
-4
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -743,21 +743,21 @@ | ||
| 743 | 743 | ** --brief Show filenames only |
| 744 | 744 | ** --context|-c N Use N lines of context |
| 745 | 745 | ** --diff-binary BOOL Include binary files when using external commands |
| 746 | 746 | ** --from|-r VERSION select VERSION as source for the diff |
| 747 | 747 | ** --internal|-i use internal diff logic |
| 748 | -** --new-file|-N output complete text of added or deleted files | |
| 748 | +** --verbose|-v output complete text of added or deleted files | |
| 749 | 749 | ** --side-by-side|-y side-by-side diff |
| 750 | 750 | ** --tk Launch a Tcl/Tk GUI for display |
| 751 | 751 | ** --to VERSION select VERSION as target for the diff |
| 752 | 752 | ** --unified unified diff |
| 753 | 753 | ** --width|-W N Width of lines in side-by-side diff |
| 754 | 754 | */ |
| 755 | 755 | void diff_cmd(void){ |
| 756 | 756 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 757 | 757 | int isInternDiff; /* True for internal diff */ |
| 758 | - int hasNFlag; /* True if -N or --new-file flag is used */ | |
| 758 | + int verboseFlag; /* True if -v or --verbose flag is used */ | |
| 759 | 759 | const char *zFrom; /* Source version number */ |
| 760 | 760 | const char *zTo; /* Target version number */ |
| 761 | 761 | const char *zBranch; /* Branch to diff */ |
| 762 | 762 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 763 | 763 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| @@ -773,12 +773,15 @@ | ||
| 773 | 773 | isInternDiff = find_option("internal","i",0)!=0; |
| 774 | 774 | zFrom = find_option("from", "r", 1); |
| 775 | 775 | zTo = find_option("to", 0, 1); |
| 776 | 776 | zBranch = find_option("branch", 0, 1); |
| 777 | 777 | diffFlags = diff_options(); |
| 778 | - hasNFlag = find_option("new-file","N",0)!=0; | |
| 779 | - if( hasNFlag ) diffFlags |= DIFF_NEWFILE; | |
| 778 | + verboseFlag = find_option("verbose","v",0)!=0; | |
| 779 | + if( !verboseFlag ){ | |
| 780 | + verboseFlag = find_option("new-file","N",0)!=0; | |
| 781 | + } | |
| 782 | + if( verboseFlag ) diffFlags |= DIFF_NEWFILE; | |
| 780 | 783 | |
| 781 | 784 | if( zBranch ){ |
| 782 | 785 | if( zTo || zFrom ){ |
| 783 | 786 | fossil_fatal("cannot use --from or --to with --branch"); |
| 784 | 787 | } |
| 785 | 788 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -743,21 +743,21 @@ | |
| 743 | ** --brief Show filenames only |
| 744 | ** --context|-c N Use N lines of context |
| 745 | ** --diff-binary BOOL Include binary files when using external commands |
| 746 | ** --from|-r VERSION select VERSION as source for the diff |
| 747 | ** --internal|-i use internal diff logic |
| 748 | ** --new-file|-N output complete text of added or deleted files |
| 749 | ** --side-by-side|-y side-by-side diff |
| 750 | ** --tk Launch a Tcl/Tk GUI for display |
| 751 | ** --to VERSION select VERSION as target for the diff |
| 752 | ** --unified unified diff |
| 753 | ** --width|-W N Width of lines in side-by-side diff |
| 754 | */ |
| 755 | void diff_cmd(void){ |
| 756 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 757 | int isInternDiff; /* True for internal diff */ |
| 758 | int hasNFlag; /* True if -N or --new-file flag is used */ |
| 759 | const char *zFrom; /* Source version number */ |
| 760 | const char *zTo; /* Target version number */ |
| 761 | const char *zBranch; /* Branch to diff */ |
| 762 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 763 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| @@ -773,12 +773,15 @@ | |
| 773 | isInternDiff = find_option("internal","i",0)!=0; |
| 774 | zFrom = find_option("from", "r", 1); |
| 775 | zTo = find_option("to", 0, 1); |
| 776 | zBranch = find_option("branch", 0, 1); |
| 777 | diffFlags = diff_options(); |
| 778 | hasNFlag = find_option("new-file","N",0)!=0; |
| 779 | if( hasNFlag ) diffFlags |= DIFF_NEWFILE; |
| 780 | |
| 781 | if( zBranch ){ |
| 782 | if( zTo || zFrom ){ |
| 783 | fossil_fatal("cannot use --from or --to with --branch"); |
| 784 | } |
| 785 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -743,21 +743,21 @@ | |
| 743 | ** --brief Show filenames only |
| 744 | ** --context|-c N Use N lines of context |
| 745 | ** --diff-binary BOOL Include binary files when using external commands |
| 746 | ** --from|-r VERSION select VERSION as source for the diff |
| 747 | ** --internal|-i use internal diff logic |
| 748 | ** --verbose|-v output complete text of added or deleted files |
| 749 | ** --side-by-side|-y side-by-side diff |
| 750 | ** --tk Launch a Tcl/Tk GUI for display |
| 751 | ** --to VERSION select VERSION as target for the diff |
| 752 | ** --unified unified diff |
| 753 | ** --width|-W N Width of lines in side-by-side diff |
| 754 | */ |
| 755 | void diff_cmd(void){ |
| 756 | int isGDiff; /* True for gdiff. False for normal diff */ |
| 757 | int isInternDiff; /* True for internal diff */ |
| 758 | int verboseFlag; /* True if -v or --verbose flag is used */ |
| 759 | const char *zFrom; /* Source version number */ |
| 760 | const char *zTo; /* Target version number */ |
| 761 | const char *zBranch; /* Branch to diff */ |
| 762 | const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */ |
| 763 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| @@ -773,12 +773,15 @@ | |
| 773 | isInternDiff = find_option("internal","i",0)!=0; |
| 774 | zFrom = find_option("from", "r", 1); |
| 775 | zTo = find_option("to", 0, 1); |
| 776 | zBranch = find_option("branch", 0, 1); |
| 777 | diffFlags = diff_options(); |
| 778 | verboseFlag = find_option("verbose","v",0)!=0; |
| 779 | if( !verboseFlag ){ |
| 780 | verboseFlag = find_option("new-file","N",0)!=0; |
| 781 | } |
| 782 | if( verboseFlag ) diffFlags |= DIFF_NEWFILE; |
| 783 | |
| 784 | if( zBranch ){ |
| 785 | if( zTo || zFrom ){ |
| 786 | fossil_fatal("cannot use --from or --to with --branch"); |
| 787 | } |
| 788 |
+1
-1
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | @ Cannot locate specified event |
| 102 | 102 | style_footer(); |
| 103 | 103 | return; |
| 104 | 104 | } |
| 105 | 105 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 106 | - verboseFlag = atoi(PD("verbose","0")); | |
| 106 | + verboseFlag = atoi(PD("v","0")); | |
| 107 | 107 | |
| 108 | 108 | /* Extract the event content. |
| 109 | 109 | */ |
| 110 | 110 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 111 | 111 | if( pEvent==0 ){ |
| 112 | 112 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | @ Cannot locate specified event |
| 102 | style_footer(); |
| 103 | return; |
| 104 | } |
| 105 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 106 | verboseFlag = atoi(PD("verbose","0")); |
| 107 | |
| 108 | /* Extract the event content. |
| 109 | */ |
| 110 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 111 | if( pEvent==0 ){ |
| 112 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | @ Cannot locate specified event |
| 102 | style_footer(); |
| 103 | return; |
| 104 | } |
| 105 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 106 | verboseFlag = atoi(PD("v","0")); |
| 107 | |
| 108 | /* Extract the event content. |
| 109 | */ |
| 110 | pEvent = manifest_get(rid, CFTYPE_EVENT); |
| 111 | if( pEvent==0 ){ |
| 112 |