Fossil SCM

Provide additional usage feedback when wrong arguments are supplied per suggestion on ML. Also provide minimal output showing amended checkin.

andybradford 2015-07-17 02:44 check-in-edit
Commit 0cbdf0586ddab83e7158750fc59ce9508c7f68fc
1 file changed +5 -2
+5 -2
--- src/info.c
+++ src/info.c
@@ -2704,14 +2704,15 @@
27042704
@ </table>
27052705
@ </div></form>
27062706
style_footer();
27072707
}
27082708
2709
+#define AMEND_USAGE_STMT "UUID OPTION ?OPTION ...?"
27092710
/*
27102711
** COMMAND: amend
27112712
**
2712
-** Usage: %fossil amend UUID ?OPTIONS?
2713
+** Usage: %fossil amend UUID OPTION ?OPTION ...?
27132714
**
27142715
** Amend the tags on check-in UUID to change how it displays in the timeline.
27152716
**
27162717
** Options:
27172718
**
@@ -2747,11 +2748,11 @@
27472748
const char *zChngTime; /* The change time on the control artifact */
27482749
const char *zUuid;
27492750
Blob ctrl;
27502751
char *zNow;
27512752
2752
- if( g.argc<3 ) usage("UUID ?OPTIONS?");
2753
+ if( g.argc==3 ) usage(AMEND_USAGE_STMT);
27532754
zNewComment = find_option("comment",0,1);
27542755
zNewBranch = find_option("branch",0,1);
27552756
zNewColor = find_option("bgcolor",0,1);
27562757
zNewBrColor = find_option("branchcolor",0,1);
27572758
if( zNewBrColor ){
@@ -2766,10 +2767,11 @@
27662767
fHide = find_option("hide",0,0)!=0;
27672768
zChngTime = find_option("chngtime",0,1);
27682769
db_find_and_open_repository(0,0);
27692770
user_select();
27702771
verify_all_options();
2772
+ if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT);
27712773
rid = name_to_typed_rid(g.argv[2], "ci");
27722774
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
27732775
zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
27742776
" FROM event WHERE objid=%d", rid);
27752777
if( zComment==0 || zComment[0]==0 ) fossil_fatal("No comment on rid %d", rid);
@@ -2809,6 +2811,7 @@
28092811
if( zCancelTag && zCancelTag[0] ) cancel_tag(rid,zCancelTag);
28102812
if( fHide ) hide_branch();
28112813
if( fClose ) close_leaf(rid);
28122814
if( zNewBranch && zNewBranch[0] ) change_branch(rid,zNewBranch);
28132815
apply_newtags(&ctrl, rid, zUuid);
2816
+ show_common_info(rid, "uuid:", 1, 0);
28142817
}
28152818
--- src/info.c
+++ src/info.c
@@ -2704,14 +2704,15 @@
2704 @ </table>
2705 @ </div></form>
2706 style_footer();
2707 }
2708
 
2709 /*
2710 ** COMMAND: amend
2711 **
2712 ** Usage: %fossil amend UUID ?OPTIONS?
2713 **
2714 ** Amend the tags on check-in UUID to change how it displays in the timeline.
2715 **
2716 ** Options:
2717 **
@@ -2747,11 +2748,11 @@
2747 const char *zChngTime; /* The change time on the control artifact */
2748 const char *zUuid;
2749 Blob ctrl;
2750 char *zNow;
2751
2752 if( g.argc<3 ) usage("UUID ?OPTIONS?");
2753 zNewComment = find_option("comment",0,1);
2754 zNewBranch = find_option("branch",0,1);
2755 zNewColor = find_option("bgcolor",0,1);
2756 zNewBrColor = find_option("branchcolor",0,1);
2757 if( zNewBrColor ){
@@ -2766,10 +2767,11 @@
2766 fHide = find_option("hide",0,0)!=0;
2767 zChngTime = find_option("chngtime",0,1);
2768 db_find_and_open_repository(0,0);
2769 user_select();
2770 verify_all_options();
 
2771 rid = name_to_typed_rid(g.argv[2], "ci");
2772 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
2773 zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
2774 " FROM event WHERE objid=%d", rid);
2775 if( zComment==0 || zComment[0]==0 ) fossil_fatal("No comment on rid %d", rid);
@@ -2809,6 +2811,7 @@
2809 if( zCancelTag && zCancelTag[0] ) cancel_tag(rid,zCancelTag);
2810 if( fHide ) hide_branch();
2811 if( fClose ) close_leaf(rid);
2812 if( zNewBranch && zNewBranch[0] ) change_branch(rid,zNewBranch);
2813 apply_newtags(&ctrl, rid, zUuid);
 
2814 }
2815
--- src/info.c
+++ src/info.c
@@ -2704,14 +2704,15 @@
2704 @ </table>
2705 @ </div></form>
2706 style_footer();
2707 }
2708
2709 #define AMEND_USAGE_STMT "UUID OPTION ?OPTION ...?"
2710 /*
2711 ** COMMAND: amend
2712 **
2713 ** Usage: %fossil amend UUID OPTION ?OPTION ...?
2714 **
2715 ** Amend the tags on check-in UUID to change how it displays in the timeline.
2716 **
2717 ** Options:
2718 **
@@ -2747,11 +2748,11 @@
2748 const char *zChngTime; /* The change time on the control artifact */
2749 const char *zUuid;
2750 Blob ctrl;
2751 char *zNow;
2752
2753 if( g.argc==3 ) usage(AMEND_USAGE_STMT);
2754 zNewComment = find_option("comment",0,1);
2755 zNewBranch = find_option("branch",0,1);
2756 zNewColor = find_option("bgcolor",0,1);
2757 zNewBrColor = find_option("branchcolor",0,1);
2758 if( zNewBrColor ){
@@ -2766,10 +2767,11 @@
2767 fHide = find_option("hide",0,0)!=0;
2768 zChngTime = find_option("chngtime",0,1);
2769 db_find_and_open_repository(0,0);
2770 user_select();
2771 verify_all_options();
2772 if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT);
2773 rid = name_to_typed_rid(g.argv[2], "ci");
2774 zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
2775 zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
2776 " FROM event WHERE objid=%d", rid);
2777 if( zComment==0 || zComment[0]==0 ) fossil_fatal("No comment on rid %d", rid);
@@ -2809,6 +2811,7 @@
2811 if( zCancelTag && zCancelTag[0] ) cancel_tag(rid,zCancelTag);
2812 if( fHide ) hide_branch();
2813 if( fClose ) close_leaf(rid);
2814 if( zNewBranch && zNewBranch[0] ) change_branch(rid,zNewBranch);
2815 apply_newtags(&ctrl, rid, zUuid);
2816 show_common_info(rid, "uuid:", 1, 0);
2817 }
2818

Keyboard Shortcuts

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