Fossil SCM
Merge the venks-emacs changes into trunk.
Commit
fbf417b681c35b9c4ec415bb3bd906a796ab263d
Parent
fd6f1c5e619fc29…
1 file changed
+35
-18
+35
-18
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -889,10 +889,11 @@ | ||
| 889 | 889 | ** status, type, severity, priority, resolution, |
| 890 | 890 | ** foundin, private_contact, resolution, title or comment |
| 891 | 891 | ** Field names given above are the ones, defined in a standard |
| 892 | 892 | ** fossil environment. If you have added, deleted columns, you |
| 893 | 893 | ** change the all your configured columns. |
| 894 | +** If you use +FIELD, the VALUE Is appended to the field FIELD. | |
| 894 | 895 | ** You can use more than one field/value pair on the commandline. |
| 895 | 896 | ** Using -q|--quote enables the special character decoding as |
| 896 | 897 | ** in "ticket show". So it's possible, to set multiline text or |
| 897 | 898 | ** text with special characters. |
| 898 | 899 | ** |
| @@ -1008,25 +1009,34 @@ | ||
| 1008 | 1009 | /* read commandline and assign fields in the azValue array */ |
| 1009 | 1010 | while( i<g.argc ){ |
| 1010 | 1011 | char *zFName; |
| 1011 | 1012 | char *zFValue; |
| 1012 | 1013 | int j; |
| 1014 | + int append = 0; | |
| 1013 | 1015 | |
| 1014 | 1016 | zFName = g.argv[i++]; |
| 1015 | 1017 | if( i==g.argc ){ |
| 1016 | 1018 | fossil_fatal("missing value for '%s'!",zFName); |
| 1017 | 1019 | } |
| 1018 | 1020 | zFValue = g.argv[i++]; |
| 1019 | - j = fieldId(zFName); | |
| 1020 | 1021 | if( tktEncoding == tktFossilize ){ |
| 1021 | 1022 | zFValue=mprintf("%s",zFValue); |
| 1022 | 1023 | defossilize(zFValue); |
| 1023 | 1024 | } |
| 1025 | + append = (zFName[0] == '+'); | |
| 1026 | + if (append){ | |
| 1027 | + zFName++; | |
| 1028 | + } | |
| 1029 | + j = fieldId(zFName); | |
| 1024 | 1030 | if( j == -1 ){ |
| 1025 | 1031 | fossil_fatal("unknown field name '%s'!",zFName); |
| 1026 | 1032 | }else{ |
| 1027 | - azValue[j] = zFValue; | |
| 1033 | + if (append) { | |
| 1034 | + azAppend[j] = zFValue; | |
| 1035 | + } else { | |
| 1036 | + azValue[j] = zFValue; | |
| 1037 | + } | |
| 1028 | 1038 | } |
| 1029 | 1039 | } |
| 1030 | 1040 | |
| 1031 | 1041 | /* now add the needed artifacts to the repository */ |
| 1032 | 1042 | blob_zero(&tktchng); |
| @@ -1037,24 +1047,31 @@ | ||
| 1037 | 1047 | blob_appendf(&tktchng, "D %s\n", zDate); |
| 1038 | 1048 | free(zDate); |
| 1039 | 1049 | } |
| 1040 | 1050 | /* append defined elements */ |
| 1041 | 1051 | for(i=0; i<nField; i++){ |
| 1042 | - char *zValue; | |
| 1043 | - | |
| 1044 | - zValue = azValue[i]; | |
| 1045 | - if( azValue[i] && azValue[i][0] ){ | |
| 1046 | - if( strncmp(azField[i], "private_", 8)==0 ){ | |
| 1047 | - zValue = db_conceal(zValue, strlen(zValue)); | |
| 1048 | - blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); | |
| 1049 | - }else{ | |
| 1050 | - blob_appendf(&tktchng, "J %s %#F\n", | |
| 1051 | - azField[i], strlen(zValue), zValue); | |
| 1052 | - } | |
| 1053 | - if( tktEncoding == tktFossilize ){ | |
| 1054 | - free(azValue[i]); | |
| 1055 | - } | |
| 1052 | + char *zValue = 0; | |
| 1053 | + char *zPfx; | |
| 1054 | + | |
| 1055 | + if (azAppend[i] && azAppend[i][0] ){ | |
| 1056 | + zPfx = " +"; | |
| 1057 | + zValue = azAppend[i]; | |
| 1058 | + } else if( azValue[i] && azValue[i][0] ){ | |
| 1059 | + zPfx = " "; | |
| 1060 | + zValue = azValue[i]; | |
| 1061 | + } else { | |
| 1062 | + continue; | |
| 1063 | + } | |
| 1064 | + if( strncmp(azField[i], "private_", 8)==0 ){ | |
| 1065 | + zValue = db_conceal(zValue, strlen(zValue)); | |
| 1066 | + blob_appendf(&tktchng, "J%s%s %s\n", zPfx, azField[i], zValue); | |
| 1067 | + }else{ | |
| 1068 | + blob_appendf(&tktchng, "J%s%s %#F\n", zPfx, | |
| 1069 | + azField[i], strlen(zValue), zValue); | |
| 1070 | + } | |
| 1071 | + if( tktEncoding == tktFossilize ){ | |
| 1072 | + free(azValue[i]); | |
| 1056 | 1073 | } |
| 1057 | 1074 | } |
| 1058 | 1075 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1059 | 1076 | blob_appendf(&tktchng, "U %F\n", g.zLogin); |
| 1060 | 1077 | md5sum_blob(&tktchng, &cksum); |
| @@ -1065,11 +1082,11 @@ | ||
| 1065 | 1082 | } |
| 1066 | 1083 | manifest_crosslink_begin(); |
| 1067 | 1084 | manifest_crosslink(rid, &tktchng); |
| 1068 | 1085 | manifest_crosslink_end(); |
| 1069 | 1086 | assert( blob_is_reset(&tktchng) ); |
| 1070 | - printf("ticket %s succeeded for UID %s\n", | |
| 1071 | - (eCmd==set?"set":"add"),zTktUuid); | |
| 1087 | + printf("ticket %s succeeded for UID %s\n", | |
| 1088 | + (eCmd==set?"set":"add"),zTktUuid); | |
| 1072 | 1089 | } |
| 1073 | 1090 | } |
| 1074 | 1091 | } |
| 1075 | 1092 | } |
| 1076 | 1093 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -889,10 +889,11 @@ | |
| 889 | ** status, type, severity, priority, resolution, |
| 890 | ** foundin, private_contact, resolution, title or comment |
| 891 | ** Field names given above are the ones, defined in a standard |
| 892 | ** fossil environment. If you have added, deleted columns, you |
| 893 | ** change the all your configured columns. |
| 894 | ** You can use more than one field/value pair on the commandline. |
| 895 | ** Using -q|--quote enables the special character decoding as |
| 896 | ** in "ticket show". So it's possible, to set multiline text or |
| 897 | ** text with special characters. |
| 898 | ** |
| @@ -1008,25 +1009,34 @@ | |
| 1008 | /* read commandline and assign fields in the azValue array */ |
| 1009 | while( i<g.argc ){ |
| 1010 | char *zFName; |
| 1011 | char *zFValue; |
| 1012 | int j; |
| 1013 | |
| 1014 | zFName = g.argv[i++]; |
| 1015 | if( i==g.argc ){ |
| 1016 | fossil_fatal("missing value for '%s'!",zFName); |
| 1017 | } |
| 1018 | zFValue = g.argv[i++]; |
| 1019 | j = fieldId(zFName); |
| 1020 | if( tktEncoding == tktFossilize ){ |
| 1021 | zFValue=mprintf("%s",zFValue); |
| 1022 | defossilize(zFValue); |
| 1023 | } |
| 1024 | if( j == -1 ){ |
| 1025 | fossil_fatal("unknown field name '%s'!",zFName); |
| 1026 | }else{ |
| 1027 | azValue[j] = zFValue; |
| 1028 | } |
| 1029 | } |
| 1030 | |
| 1031 | /* now add the needed artifacts to the repository */ |
| 1032 | blob_zero(&tktchng); |
| @@ -1037,24 +1047,31 @@ | |
| 1037 | blob_appendf(&tktchng, "D %s\n", zDate); |
| 1038 | free(zDate); |
| 1039 | } |
| 1040 | /* append defined elements */ |
| 1041 | for(i=0; i<nField; i++){ |
| 1042 | char *zValue; |
| 1043 | |
| 1044 | zValue = azValue[i]; |
| 1045 | if( azValue[i] && azValue[i][0] ){ |
| 1046 | if( strncmp(azField[i], "private_", 8)==0 ){ |
| 1047 | zValue = db_conceal(zValue, strlen(zValue)); |
| 1048 | blob_appendf(&tktchng, "J %s %s\n", azField[i], zValue); |
| 1049 | }else{ |
| 1050 | blob_appendf(&tktchng, "J %s %#F\n", |
| 1051 | azField[i], strlen(zValue), zValue); |
| 1052 | } |
| 1053 | if( tktEncoding == tktFossilize ){ |
| 1054 | free(azValue[i]); |
| 1055 | } |
| 1056 | } |
| 1057 | } |
| 1058 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1059 | blob_appendf(&tktchng, "U %F\n", g.zLogin); |
| 1060 | md5sum_blob(&tktchng, &cksum); |
| @@ -1065,11 +1082,11 @@ | |
| 1065 | } |
| 1066 | manifest_crosslink_begin(); |
| 1067 | manifest_crosslink(rid, &tktchng); |
| 1068 | manifest_crosslink_end(); |
| 1069 | assert( blob_is_reset(&tktchng) ); |
| 1070 | printf("ticket %s succeeded for UID %s\n", |
| 1071 | (eCmd==set?"set":"add"),zTktUuid); |
| 1072 | } |
| 1073 | } |
| 1074 | } |
| 1075 | } |
| 1076 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -889,10 +889,11 @@ | |
| 889 | ** status, type, severity, priority, resolution, |
| 890 | ** foundin, private_contact, resolution, title or comment |
| 891 | ** Field names given above are the ones, defined in a standard |
| 892 | ** fossil environment. If you have added, deleted columns, you |
| 893 | ** change the all your configured columns. |
| 894 | ** If you use +FIELD, the VALUE Is appended to the field FIELD. |
| 895 | ** You can use more than one field/value pair on the commandline. |
| 896 | ** Using -q|--quote enables the special character decoding as |
| 897 | ** in "ticket show". So it's possible, to set multiline text or |
| 898 | ** text with special characters. |
| 899 | ** |
| @@ -1008,25 +1009,34 @@ | |
| 1009 | /* read commandline and assign fields in the azValue array */ |
| 1010 | while( i<g.argc ){ |
| 1011 | char *zFName; |
| 1012 | char *zFValue; |
| 1013 | int j; |
| 1014 | int append = 0; |
| 1015 | |
| 1016 | zFName = g.argv[i++]; |
| 1017 | if( i==g.argc ){ |
| 1018 | fossil_fatal("missing value for '%s'!",zFName); |
| 1019 | } |
| 1020 | zFValue = g.argv[i++]; |
| 1021 | if( tktEncoding == tktFossilize ){ |
| 1022 | zFValue=mprintf("%s",zFValue); |
| 1023 | defossilize(zFValue); |
| 1024 | } |
| 1025 | append = (zFName[0] == '+'); |
| 1026 | if (append){ |
| 1027 | zFName++; |
| 1028 | } |
| 1029 | j = fieldId(zFName); |
| 1030 | if( j == -1 ){ |
| 1031 | fossil_fatal("unknown field name '%s'!",zFName); |
| 1032 | }else{ |
| 1033 | if (append) { |
| 1034 | azAppend[j] = zFValue; |
| 1035 | } else { |
| 1036 | azValue[j] = zFValue; |
| 1037 | } |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | /* now add the needed artifacts to the repository */ |
| 1042 | blob_zero(&tktchng); |
| @@ -1037,24 +1047,31 @@ | |
| 1047 | blob_appendf(&tktchng, "D %s\n", zDate); |
| 1048 | free(zDate); |
| 1049 | } |
| 1050 | /* append defined elements */ |
| 1051 | for(i=0; i<nField; i++){ |
| 1052 | char *zValue = 0; |
| 1053 | char *zPfx; |
| 1054 | |
| 1055 | if (azAppend[i] && azAppend[i][0] ){ |
| 1056 | zPfx = " +"; |
| 1057 | zValue = azAppend[i]; |
| 1058 | } else if( azValue[i] && azValue[i][0] ){ |
| 1059 | zPfx = " "; |
| 1060 | zValue = azValue[i]; |
| 1061 | } else { |
| 1062 | continue; |
| 1063 | } |
| 1064 | if( strncmp(azField[i], "private_", 8)==0 ){ |
| 1065 | zValue = db_conceal(zValue, strlen(zValue)); |
| 1066 | blob_appendf(&tktchng, "J%s%s %s\n", zPfx, azField[i], zValue); |
| 1067 | }else{ |
| 1068 | blob_appendf(&tktchng, "J%s%s %#F\n", zPfx, |
| 1069 | azField[i], strlen(zValue), zValue); |
| 1070 | } |
| 1071 | if( tktEncoding == tktFossilize ){ |
| 1072 | free(azValue[i]); |
| 1073 | } |
| 1074 | } |
| 1075 | blob_appendf(&tktchng, "K %s\n", zTktUuid); |
| 1076 | blob_appendf(&tktchng, "U %F\n", g.zLogin); |
| 1077 | md5sum_blob(&tktchng, &cksum); |
| @@ -1065,11 +1082,11 @@ | |
| 1082 | } |
| 1083 | manifest_crosslink_begin(); |
| 1084 | manifest_crosslink(rid, &tktchng); |
| 1085 | manifest_crosslink_end(); |
| 1086 | assert( blob_is_reset(&tktchng) ); |
| 1087 | printf("ticket %s succeeded for UID %s\n", |
| 1088 | (eCmd==set?"set":"add"),zTktUuid); |
| 1089 | } |
| 1090 | } |
| 1091 | } |
| 1092 | } |
| 1093 |