135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
/*
** Impl of /json/tag/cancel.
*/
static cson_value * json_tag_cancel(){
char const * zName = NULL;
char const * zCheckin = NULL;
char fRaw = 0;
const char *zPrefix = NULL;
cson_value * payV = NULL;
cson_object * pay = NULL;
g.json.resultCode = FSL_JSON_E_NYI;
return payV;
if( !g.perm.Write ){
json_set_err(FSL_JSON_E_DENIED,
"Requires 'i' permissions.");
return NULL;
}
fRaw = json_find_option_bool("raw",NULL,NULL,0);
zPrefix = fRaw ? "" : "sym-";
zName = json_find_option_cstr("name",NULL,NULL);
if(!zName || !*zName){
if(!fossil_is_json()){
zName = json_command_arg(3);
}
if(!zName || !*zName){
json_set_err(FSL_JSON_E_MISSING_ARGS,
"'name' parameter is missing.");
return NULL;
}
}
zCheckin = json_find_option_cstr("checkin",NULL,NULL);
if( !zCheckin ){
if(!fossil_is_json()){
zCheckin = json_command_arg(4);
}
if(!zCheckin || !*zCheckin){
json_set_err(FSL_JSON_E_MISSING_ARGS,
"'checkin' parameter is missing.");
return NULL;
}
}
db_begin_transaction();
tag_add_artifact(zPrefix, zName, zCheckin, NULL, 0, 0, 0);
db_end_transaction(0);
return NULL;
}
/*
** Impl of /json/tag/find.
*/
static cson_value * json_tag_find(){
|