Fossil SCM

Add support for comment file via -M so the prompt message is not confusing when it mentions the use of -M.

andybradford 2015-07-25 17:01 check-in-edit
Commit 37aeb1c43e8d35e6872c2806c3260ba24204a0d0
1 file changed +8
+8
--- src/info.c
+++ src/info.c
@@ -2750,10 +2750,11 @@
27502750
**
27512751
** Options:
27522752
**
27532753
** --author USER Make USER the author for check-in
27542754
** -m|--comment COMMENT Make COMMENT the check-in comment
2755
+** -m|--message-file FILE Read the amended comment from FILE
27552756
** --edit-comment Launch editor to revise comment
27562757
** --date DATE Make DATE the check-in time
27572758
** --bgcolor COLOR Apply COLOR to this check-in
27582759
** --branchcolor COLOR Apply and propagate COLOR to the branch
27592760
** --tag TAG Add new TAG to this check-in
@@ -2764,10 +2765,11 @@
27642765
*/
27652766
void ci_amend_cmd(void){
27662767
int rid;
27672768
const char *zComment; /* Current comment on the check-in */
27682769
const char *zNewComment; /* Revised check-in comment */
2770
+ const char *zComFile; /* Filename from which to read comment */
27692771
const char *zUser; /* Current user for the check-in */
27702772
const char *zNewUser; /* Revised user */
27712773
const char *zDate; /* Current date of the check-in */
27722774
const char *zNewDate; /* Revised check-in date */
27732775
const char *zColor;
@@ -2790,10 +2792,11 @@
27902792
int i;
27912793
27922794
if( g.argc==3 ) usage(AMEND_USAGE_STMT);
27932795
fEditComment = find_option("edit-comment",0,0)!=0;
27942796
zNewComment = find_option("comment","m",1);
2797
+ zComFile = find_option("message-file","M",1);
27952798
zNewBranch = find_option("branch",0,1);
27962799
zNewColor = find_option("bgcolor",0,1);
27972800
zNewBrColor = find_option("branchcolor",0,1);
27982801
if( zNewBrColor ){
27992802
zNewColor = zNewBrColor;
@@ -2848,10 +2851,15 @@
28482851
cancel_color();
28492852
}
28502853
if( fEditComment ){
28512854
prepare_amend_comment(&comment, zComment, zUuid);
28522855
zNewComment = blob_str(&comment);
2856
+ }else if( zComFile ){
2857
+ blob_zero(&comment);
2858
+ blob_read_from_file(&comment, zComFile);
2859
+ blob_to_utf8_no_bom(&comment, 1);
2860
+ zNewComment = blob_str(&comment);
28532861
}
28542862
if( zNewComment && zNewComment[0]
28552863
&& comment_compare(zComment,zNewComment)==0 ) add_comment(zNewComment);
28562864
if( zNewDate && zNewDate[0] && fossil_strcmp(zDate,zNewDate)!=0 ){
28572865
add_date(zNewDate);
28582866
--- src/info.c
+++ src/info.c
@@ -2750,10 +2750,11 @@
2750 **
2751 ** Options:
2752 **
2753 ** --author USER Make USER the author for check-in
2754 ** -m|--comment COMMENT Make COMMENT the check-in comment
 
2755 ** --edit-comment Launch editor to revise comment
2756 ** --date DATE Make DATE the check-in time
2757 ** --bgcolor COLOR Apply COLOR to this check-in
2758 ** --branchcolor COLOR Apply and propagate COLOR to the branch
2759 ** --tag TAG Add new TAG to this check-in
@@ -2764,10 +2765,11 @@
2764 */
2765 void ci_amend_cmd(void){
2766 int rid;
2767 const char *zComment; /* Current comment on the check-in */
2768 const char *zNewComment; /* Revised check-in comment */
 
2769 const char *zUser; /* Current user for the check-in */
2770 const char *zNewUser; /* Revised user */
2771 const char *zDate; /* Current date of the check-in */
2772 const char *zNewDate; /* Revised check-in date */
2773 const char *zColor;
@@ -2790,10 +2792,11 @@
2790 int i;
2791
2792 if( g.argc==3 ) usage(AMEND_USAGE_STMT);
2793 fEditComment = find_option("edit-comment",0,0)!=0;
2794 zNewComment = find_option("comment","m",1);
 
2795 zNewBranch = find_option("branch",0,1);
2796 zNewColor = find_option("bgcolor",0,1);
2797 zNewBrColor = find_option("branchcolor",0,1);
2798 if( zNewBrColor ){
2799 zNewColor = zNewBrColor;
@@ -2848,10 +2851,15 @@
2848 cancel_color();
2849 }
2850 if( fEditComment ){
2851 prepare_amend_comment(&comment, zComment, zUuid);
2852 zNewComment = blob_str(&comment);
 
 
 
 
 
2853 }
2854 if( zNewComment && zNewComment[0]
2855 && comment_compare(zComment,zNewComment)==0 ) add_comment(zNewComment);
2856 if( zNewDate && zNewDate[0] && fossil_strcmp(zDate,zNewDate)!=0 ){
2857 add_date(zNewDate);
2858
--- src/info.c
+++ src/info.c
@@ -2750,10 +2750,11 @@
2750 **
2751 ** Options:
2752 **
2753 ** --author USER Make USER the author for check-in
2754 ** -m|--comment COMMENT Make COMMENT the check-in comment
2755 ** -m|--message-file FILE Read the amended comment from FILE
2756 ** --edit-comment Launch editor to revise comment
2757 ** --date DATE Make DATE the check-in time
2758 ** --bgcolor COLOR Apply COLOR to this check-in
2759 ** --branchcolor COLOR Apply and propagate COLOR to the branch
2760 ** --tag TAG Add new TAG to this check-in
@@ -2764,10 +2765,11 @@
2765 */
2766 void ci_amend_cmd(void){
2767 int rid;
2768 const char *zComment; /* Current comment on the check-in */
2769 const char *zNewComment; /* Revised check-in comment */
2770 const char *zComFile; /* Filename from which to read comment */
2771 const char *zUser; /* Current user for the check-in */
2772 const char *zNewUser; /* Revised user */
2773 const char *zDate; /* Current date of the check-in */
2774 const char *zNewDate; /* Revised check-in date */
2775 const char *zColor;
@@ -2790,10 +2792,11 @@
2792 int i;
2793
2794 if( g.argc==3 ) usage(AMEND_USAGE_STMT);
2795 fEditComment = find_option("edit-comment",0,0)!=0;
2796 zNewComment = find_option("comment","m",1);
2797 zComFile = find_option("message-file","M",1);
2798 zNewBranch = find_option("branch",0,1);
2799 zNewColor = find_option("bgcolor",0,1);
2800 zNewBrColor = find_option("branchcolor",0,1);
2801 if( zNewBrColor ){
2802 zNewColor = zNewBrColor;
@@ -2848,10 +2851,15 @@
2851 cancel_color();
2852 }
2853 if( fEditComment ){
2854 prepare_amend_comment(&comment, zComment, zUuid);
2855 zNewComment = blob_str(&comment);
2856 }else if( zComFile ){
2857 blob_zero(&comment);
2858 blob_read_from_file(&comment, zComFile);
2859 blob_to_utf8_no_bom(&comment, 1);
2860 zNewComment = blob_str(&comment);
2861 }
2862 if( zNewComment && zNewComment[0]
2863 && comment_compare(zComment,zNewComment)==0 ) add_comment(zNewComment);
2864 if( zNewDate && zNewDate[0] && fossil_strcmp(zDate,zNewDate)!=0 ){
2865 add_date(zNewDate);
2866

Keyboard Shortcuts

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