Fossil SCM

Merge the venks-emacs changes into trunk.

drh 2011-06-07 02:09 trunk merge
Commit fbf417b681c35b9c4ec415bb3bd906a796ab263d
1 file changed +35 -18
+35 -18
--- src/tkt.c
+++ src/tkt.c
@@ -889,10 +889,11 @@
889889
** status, type, severity, priority, resolution,
890890
** foundin, private_contact, resolution, title or comment
891891
** Field names given above are the ones, defined in a standard
892892
** fossil environment. If you have added, deleted columns, you
893893
** change the all your configured columns.
894
+** If you use +FIELD, the VALUE Is appended to the field FIELD.
894895
** You can use more than one field/value pair on the commandline.
895896
** Using -q|--quote enables the special character decoding as
896897
** in "ticket show". So it's possible, to set multiline text or
897898
** text with special characters.
898899
**
@@ -1008,25 +1009,34 @@
10081009
/* read commandline and assign fields in the azValue array */
10091010
while( i<g.argc ){
10101011
char *zFName;
10111012
char *zFValue;
10121013
int j;
1014
+ int append = 0;
10131015
10141016
zFName = g.argv[i++];
10151017
if( i==g.argc ){
10161018
fossil_fatal("missing value for '%s'!",zFName);
10171019
}
10181020
zFValue = g.argv[i++];
1019
- j = fieldId(zFName);
10201021
if( tktEncoding == tktFossilize ){
10211022
zFValue=mprintf("%s",zFValue);
10221023
defossilize(zFValue);
10231024
}
1025
+ append = (zFName[0] == '+');
1026
+ if (append){
1027
+ zFName++;
1028
+ }
1029
+ j = fieldId(zFName);
10241030
if( j == -1 ){
10251031
fossil_fatal("unknown field name '%s'!",zFName);
10261032
}else{
1027
- azValue[j] = zFValue;
1033
+ if (append) {
1034
+ azAppend[j] = zFValue;
1035
+ } else {
1036
+ azValue[j] = zFValue;
1037
+ }
10281038
}
10291039
}
10301040
10311041
/* now add the needed artifacts to the repository */
10321042
blob_zero(&tktchng);
@@ -1037,24 +1047,31 @@
10371047
blob_appendf(&tktchng, "D %s\n", zDate);
10381048
free(zDate);
10391049
}
10401050
/* append defined elements */
10411051
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]);
10561073
}
10571074
}
10581075
blob_appendf(&tktchng, "K %s\n", zTktUuid);
10591076
blob_appendf(&tktchng, "U %F\n", g.zLogin);
10601077
md5sum_blob(&tktchng, &cksum);
@@ -1065,11 +1082,11 @@
10651082
}
10661083
manifest_crosslink_begin();
10671084
manifest_crosslink(rid, &tktchng);
10681085
manifest_crosslink_end();
10691086
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);
10721089
}
10731090
}
10741091
}
10751092
}
10761093
--- 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

Keyboard Shortcuts

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