Fossil SCM
Provide additional usage feedback when wrong arguments are supplied per suggestion on ML. Also provide minimal output showing amended checkin.
Commit
0cbdf0586ddab83e7158750fc59ce9508c7f68fc
Parent
870c20885ba98d6…
1 file changed
+5
-2
+5
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2704,14 +2704,15 @@ | ||
| 2704 | 2704 | @ </table> |
| 2705 | 2705 | @ </div></form> |
| 2706 | 2706 | style_footer(); |
| 2707 | 2707 | } |
| 2708 | 2708 | |
| 2709 | +#define AMEND_USAGE_STMT "UUID OPTION ?OPTION ...?" | |
| 2709 | 2710 | /* |
| 2710 | 2711 | ** COMMAND: amend |
| 2711 | 2712 | ** |
| 2712 | -** Usage: %fossil amend UUID ?OPTIONS? | |
| 2713 | +** Usage: %fossil amend UUID OPTION ?OPTION ...? | |
| 2713 | 2714 | ** |
| 2714 | 2715 | ** Amend the tags on check-in UUID to change how it displays in the timeline. |
| 2715 | 2716 | ** |
| 2716 | 2717 | ** Options: |
| 2717 | 2718 | ** |
| @@ -2747,11 +2748,11 @@ | ||
| 2747 | 2748 | const char *zChngTime; /* The change time on the control artifact */ |
| 2748 | 2749 | const char *zUuid; |
| 2749 | 2750 | Blob ctrl; |
| 2750 | 2751 | char *zNow; |
| 2751 | 2752 | |
| 2752 | - if( g.argc<3 ) usage("UUID ?OPTIONS?"); | |
| 2753 | + if( g.argc==3 ) usage(AMEND_USAGE_STMT); | |
| 2753 | 2754 | zNewComment = find_option("comment",0,1); |
| 2754 | 2755 | zNewBranch = find_option("branch",0,1); |
| 2755 | 2756 | zNewColor = find_option("bgcolor",0,1); |
| 2756 | 2757 | zNewBrColor = find_option("branchcolor",0,1); |
| 2757 | 2758 | if( zNewBrColor ){ |
| @@ -2766,10 +2767,11 @@ | ||
| 2766 | 2767 | fHide = find_option("hide",0,0)!=0; |
| 2767 | 2768 | zChngTime = find_option("chngtime",0,1); |
| 2768 | 2769 | db_find_and_open_repository(0,0); |
| 2769 | 2770 | user_select(); |
| 2770 | 2771 | verify_all_options(); |
| 2772 | + if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT); | |
| 2771 | 2773 | rid = name_to_typed_rid(g.argv[2], "ci"); |
| 2772 | 2774 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 2773 | 2775 | zComment = db_text(0, "SELECT coalesce(ecomment,comment)" |
| 2774 | 2776 | " FROM event WHERE objid=%d", rid); |
| 2775 | 2777 | if( zComment==0 || zComment[0]==0 ) fossil_fatal("No comment on rid %d", rid); |
| @@ -2809,6 +2811,7 @@ | ||
| 2809 | 2811 | if( zCancelTag && zCancelTag[0] ) cancel_tag(rid,zCancelTag); |
| 2810 | 2812 | if( fHide ) hide_branch(); |
| 2811 | 2813 | if( fClose ) close_leaf(rid); |
| 2812 | 2814 | if( zNewBranch && zNewBranch[0] ) change_branch(rid,zNewBranch); |
| 2813 | 2815 | apply_newtags(&ctrl, rid, zUuid); |
| 2816 | + show_common_info(rid, "uuid:", 1, 0); | |
| 2814 | 2817 | } |
| 2815 | 2818 |
| --- 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 |