Fossil SCM
Add a --nofork option to "tag branch" so that --raw is not being used for two different purposes. Modify and tidy up the corresponding help text.
Commit
c887b2b66e643ef09989ecfda62733f9b274066a
Parent
c863ec1a98c424f…
1 file changed
+45
-42
+45
-42
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -257,19 +257,20 @@ | ||
| 257 | 257 | ** is not complete at that stage. |
| 258 | 258 | */ |
| 259 | 259 | static void tag_prepare_fork( |
| 260 | 260 | Blob *pCtrl, |
| 261 | 261 | const char *zTagname, |
| 262 | - int rid | |
| 262 | + int rid, | |
| 263 | + int preflen /* Tag prefix length to adjust name if reqd */ | |
| 263 | 264 | ){ |
| 264 | 265 | Stmt q; |
| 265 | 266 | Manifest origin; |
| 266 | 267 | Blob originContent; |
| 267 | 268 | char *zDate; |
| 268 | 269 | int i; |
| 269 | 270 | |
| 270 | - blob_appendf(pCtrl, "C Create\\snamed\\sfork\\s%s\n", zTagname+4); | |
| 271 | + blob_appendf(pCtrl, "C Create\\snamed\\sfork\\s%s\n", zTagname+preflen); | |
| 271 | 272 | content_get(rid, &originContent); |
| 272 | 273 | manifest_parse(&origin, &originContent); |
| 273 | 274 | zDate = db_text(0, "SELECT datetime('now')"); |
| 274 | 275 | zDate[10] = 'T'; |
| 275 | 276 | blob_appendf(pCtrl, "D %s\n", zDate); |
| @@ -309,11 +310,12 @@ | ||
| 309 | 310 | static void tag_add_artifact( |
| 310 | 311 | const char *zTagname, /* The tag to add or cancel */ |
| 311 | 312 | const char *zObjName, /* Name of object attached to */ |
| 312 | 313 | const char *zValue, /* Value for the tag. Might be NULL */ |
| 313 | 314 | int tagtype, /* 0:cancel 1:singleton 2:propagated */ |
| 314 | - int fork /* Should a fork created from zObjName? */ | |
| 315 | + int fork, /* Should a fork created from zObjName? */ | |
| 316 | + int preflen /* Tag prefix length to adjust name if reqd */ | |
| 315 | 317 | ){ |
| 316 | 318 | int rid; |
| 317 | 319 | int nrid; |
| 318 | 320 | char *zDate; |
| 319 | 321 | Blob uuid; |
| @@ -334,11 +336,11 @@ | ||
| 334 | 336 | if( validate16(zTagname, strlen(zTagname)) ){ |
| 335 | 337 | fossil_fatal("invalid tag name \"%s\" - might be confused with a UUID", |
| 336 | 338 | zTagname); |
| 337 | 339 | } |
| 338 | 340 | if( fork ){ |
| 339 | - tag_prepare_fork(&ctrl, zTagname, rid); | |
| 341 | + tag_prepare_fork(&ctrl, zTagname, rid, preflen); | |
| 340 | 342 | }else{ |
| 341 | 343 | zDate = db_text(0, "SELECT datetime('now')"); |
| 342 | 344 | zDate[10] = 'T'; |
| 343 | 345 | blob_appendf(&ctrl, "D %s\n", zDate); |
| 344 | 346 | blob_appendf(&ctrl, "T %c%F %b", zTagtype[tagtype], zTagname, &uuid); |
| @@ -367,32 +369,31 @@ | ||
| 367 | 369 | ** Run various subcommands to control tags and properties |
| 368 | 370 | ** |
| 369 | 371 | ** %fossil tag add ?--raw? TAGNAME UUID ?VALUE? |
| 370 | 372 | ** |
| 371 | 373 | ** Add a new tag or property to UUID. The tag will |
| 372 | -** be usable instead of a UUID in commands like | |
| 373 | -** update and such. | |
| 374 | -** | |
| 375 | -** %fossil tag branch ?--raw? TAGNAME UUID ?VALUE? | |
| 376 | -** | |
| 377 | -** A fork of UUID will be created. Then the new tag | |
| 378 | -** or property will be added to the fork that | |
| 379 | -** propagate to all direct children. | |
| 380 | -** | |
| 381 | -** Additionally all symbolic tags of that fork | |
| 382 | -** inherited from UUID will be cancelled. | |
| 383 | -** | |
| 384 | -** However, if the option '--raw' was given, no | |
| 385 | -** fork will be created but the tag/property will be | |
| 386 | -** added to UUID directly and no tag will be | |
| 387 | -** canceled. | |
| 388 | -** | |
| 389 | -** Please see the description of '--raw' below too. | |
| 374 | +** be usable instead of a UUID in commands such as | |
| 375 | +** update and merge. | |
| 376 | +** | |
| 377 | +** %fossil tag branch ?--raw? ?--nofork? TAGNAME UUID ?VALUE? | |
| 378 | +** | |
| 379 | +** A fork will be created so that the new checkin | |
| 380 | +** is a sibling of UUID and identical to it except | |
| 381 | +** for a generated comment. Then the new tag will | |
| 382 | +** be added to the new checkin and propagated to | |
| 383 | +** all direct children. Additionally all symbolic | |
| 384 | +** tags of that checkin inherited from UUID will | |
| 385 | +** be cancelled. | |
| 386 | +** | |
| 387 | +** However, if the option --nofork is given, no | |
| 388 | +** fork will be created and the tag/property will be | |
| 389 | +** added to UUID directly. No tags will be canceled. | |
| 390 | 390 | ** |
| 391 | 391 | ** %fossil tag cancel ?--raw? TAGNAME UUID |
| 392 | 392 | ** |
| 393 | -** Cancel the tag TAGNAME from UUID | |
| 393 | +** Remove the tag TAGNAME from UUID, and also remove | |
| 394 | +** the propagation of the tag to any descendants. | |
| 394 | 395 | ** |
| 395 | 396 | ** %fossil tag find ?--raw? TAGNAME |
| 396 | 397 | ** |
| 397 | 398 | ** List all baselines that use TAGNAME |
| 398 | 399 | ** |
| @@ -399,32 +400,33 @@ | ||
| 399 | 400 | ** %fossil tag list ?--raw? ?UUID? |
| 400 | 401 | ** |
| 401 | 402 | ** List all tags, or if UUID is supplied, list |
| 402 | 403 | ** all tags and their values for UUID. |
| 403 | 404 | ** |
| 404 | -** The option ?--raw? is to expose the internal interface | |
| 405 | -** for tag handling. This option is not necessary for the | |
| 406 | -** normal use. | |
| 407 | -** | |
| 408 | -** If you use a tagname that might be confused with a UUID, | |
| 409 | -** you have to explicitly disambiguate it by prefixing it | |
| 410 | -** with "tag:". For instance: | |
| 411 | -** | |
| 412 | -** fossil update cfcfcfee | |
| 413 | -** | |
| 414 | -** is not the same as: | |
| 405 | +** The option --raw allows the manipulation of all types of | |
| 406 | +** tags used for various internal purposes in fossil. You | |
| 407 | +** should not use this option to make changes unless you are | |
| 408 | +** sure what you are doing. | |
| 409 | +** | |
| 410 | +** If you need to use a tagname that might be confused with | |
| 411 | +** a UUID, you can explicitly disambiguate it by prefixing | |
| 412 | +** it with "tag:". For instance: | |
| 413 | +** | |
| 414 | +** fossil update decaf | |
| 415 | +** | |
| 416 | +** will be taken as a UUID and fossil will probably complain | |
| 417 | +** that no such revision was found. However | |
| 415 | 418 | ** |
| 416 | 419 | ** fossil update tag:cfcfcfee |
| 417 | 420 | ** |
| 418 | -** The first will be taken as UUID and fossil will complain | |
| 419 | -** if no such revision was found, and the second one expect | |
| 420 | -** "cfcfcfee" to be a tag/branch name! | |
| 421 | +** will assume that "decaf" is a tag/branch name. | |
| 421 | 422 | ** |
| 422 | 423 | */ |
| 423 | 424 | void tag_cmd(void){ |
| 424 | 425 | int n; |
| 425 | 426 | int raw = find_option("raw","",0)!=0; |
| 427 | + int fork = find_option("nofork","",0)==0; | |
| 426 | 428 | const char *prefix = raw ? "" : "sym-"; |
| 427 | 429 | int preflen = strlen(prefix); |
| 428 | 430 | Blob tagname; |
| 429 | 431 | |
| 430 | 432 | db_find_and_open_repository(1); |
| @@ -443,22 +445,23 @@ | ||
| 443 | 445 | if( g.argc!=5 && g.argc!=6 ){ |
| 444 | 446 | usage("add ?--raw? TAGNAME UUID ?VALUE?"); |
| 445 | 447 | } |
| 446 | 448 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 447 | 449 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 448 | - tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 1, 0); | |
| 450 | + tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 1, 0, 0); | |
| 449 | 451 | }else |
| 450 | 452 | |
| 451 | 453 | if( strncmp(g.argv[2],"branch",n)==0 ){ |
| 452 | 454 | char *zValue; |
| 453 | 455 | if( g.argc!=5 && g.argc!=6 ){ |
| 454 | - usage("branch ?--raw? TAGNAME UUID ?VALUE?"); | |
| 456 | + usage("branch ?--raw? ?--nofork? TAGNAME UUID ?VALUE?"); | |
| 455 | 457 | } |
| 456 | 458 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 457 | 459 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 458 | - tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 2, raw==0); | |
| 459 | - if( !raw ){ | |
| 460 | + tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 2, fork!=0, | |
| 461 | + preflen); | |
| 462 | + if( fork ){ | |
| 460 | 463 | const char *zUuid = db_text(0, "SELECT uuid, MAX(rowid) FROM blob"); |
| 461 | 464 | printf("New_Fork \"%s\": %s\n", g.argv[3], zUuid); |
| 462 | 465 | } |
| 463 | 466 | }else |
| 464 | 467 | |
| @@ -465,11 +468,11 @@ | ||
| 465 | 468 | if( strncmp(g.argv[2],"cancel",n)==0 ){ |
| 466 | 469 | if( g.argc!=5 ){ |
| 467 | 470 | usage("cancel ?--raw? TAGNAME UUID"); |
| 468 | 471 | } |
| 469 | 472 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 470 | - tag_add_artifact(blob_str(&tagname), g.argv[4], 0, 0, 0); | |
| 473 | + tag_add_artifact(blob_str(&tagname), g.argv[4], 0, 0, 0, 0); | |
| 471 | 474 | }else |
| 472 | 475 | |
| 473 | 476 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 474 | 477 | Stmt q; |
| 475 | 478 | if( g.argc!=4 ){ |
| 476 | 479 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -257,19 +257,20 @@ | |
| 257 | ** is not complete at that stage. |
| 258 | */ |
| 259 | static void tag_prepare_fork( |
| 260 | Blob *pCtrl, |
| 261 | const char *zTagname, |
| 262 | int rid |
| 263 | ){ |
| 264 | Stmt q; |
| 265 | Manifest origin; |
| 266 | Blob originContent; |
| 267 | char *zDate; |
| 268 | int i; |
| 269 | |
| 270 | blob_appendf(pCtrl, "C Create\\snamed\\sfork\\s%s\n", zTagname+4); |
| 271 | content_get(rid, &originContent); |
| 272 | manifest_parse(&origin, &originContent); |
| 273 | zDate = db_text(0, "SELECT datetime('now')"); |
| 274 | zDate[10] = 'T'; |
| 275 | blob_appendf(pCtrl, "D %s\n", zDate); |
| @@ -309,11 +310,12 @@ | |
| 309 | static void tag_add_artifact( |
| 310 | const char *zTagname, /* The tag to add or cancel */ |
| 311 | const char *zObjName, /* Name of object attached to */ |
| 312 | const char *zValue, /* Value for the tag. Might be NULL */ |
| 313 | int tagtype, /* 0:cancel 1:singleton 2:propagated */ |
| 314 | int fork /* Should a fork created from zObjName? */ |
| 315 | ){ |
| 316 | int rid; |
| 317 | int nrid; |
| 318 | char *zDate; |
| 319 | Blob uuid; |
| @@ -334,11 +336,11 @@ | |
| 334 | if( validate16(zTagname, strlen(zTagname)) ){ |
| 335 | fossil_fatal("invalid tag name \"%s\" - might be confused with a UUID", |
| 336 | zTagname); |
| 337 | } |
| 338 | if( fork ){ |
| 339 | tag_prepare_fork(&ctrl, zTagname, rid); |
| 340 | }else{ |
| 341 | zDate = db_text(0, "SELECT datetime('now')"); |
| 342 | zDate[10] = 'T'; |
| 343 | blob_appendf(&ctrl, "D %s\n", zDate); |
| 344 | blob_appendf(&ctrl, "T %c%F %b", zTagtype[tagtype], zTagname, &uuid); |
| @@ -367,32 +369,31 @@ | |
| 367 | ** Run various subcommands to control tags and properties |
| 368 | ** |
| 369 | ** %fossil tag add ?--raw? TAGNAME UUID ?VALUE? |
| 370 | ** |
| 371 | ** Add a new tag or property to UUID. The tag will |
| 372 | ** be usable instead of a UUID in commands like |
| 373 | ** update and such. |
| 374 | ** |
| 375 | ** %fossil tag branch ?--raw? TAGNAME UUID ?VALUE? |
| 376 | ** |
| 377 | ** A fork of UUID will be created. Then the new tag |
| 378 | ** or property will be added to the fork that |
| 379 | ** propagate to all direct children. |
| 380 | ** |
| 381 | ** Additionally all symbolic tags of that fork |
| 382 | ** inherited from UUID will be cancelled. |
| 383 | ** |
| 384 | ** However, if the option '--raw' was given, no |
| 385 | ** fork will be created but the tag/property will be |
| 386 | ** added to UUID directly and no tag will be |
| 387 | ** canceled. |
| 388 | ** |
| 389 | ** Please see the description of '--raw' below too. |
| 390 | ** |
| 391 | ** %fossil tag cancel ?--raw? TAGNAME UUID |
| 392 | ** |
| 393 | ** Cancel the tag TAGNAME from UUID |
| 394 | ** |
| 395 | ** %fossil tag find ?--raw? TAGNAME |
| 396 | ** |
| 397 | ** List all baselines that use TAGNAME |
| 398 | ** |
| @@ -399,32 +400,33 @@ | |
| 399 | ** %fossil tag list ?--raw? ?UUID? |
| 400 | ** |
| 401 | ** List all tags, or if UUID is supplied, list |
| 402 | ** all tags and their values for UUID. |
| 403 | ** |
| 404 | ** The option ?--raw? is to expose the internal interface |
| 405 | ** for tag handling. This option is not necessary for the |
| 406 | ** normal use. |
| 407 | ** |
| 408 | ** If you use a tagname that might be confused with a UUID, |
| 409 | ** you have to explicitly disambiguate it by prefixing it |
| 410 | ** with "tag:". For instance: |
| 411 | ** |
| 412 | ** fossil update cfcfcfee |
| 413 | ** |
| 414 | ** is not the same as: |
| 415 | ** |
| 416 | ** fossil update tag:cfcfcfee |
| 417 | ** |
| 418 | ** The first will be taken as UUID and fossil will complain |
| 419 | ** if no such revision was found, and the second one expect |
| 420 | ** "cfcfcfee" to be a tag/branch name! |
| 421 | ** |
| 422 | */ |
| 423 | void tag_cmd(void){ |
| 424 | int n; |
| 425 | int raw = find_option("raw","",0)!=0; |
| 426 | const char *prefix = raw ? "" : "sym-"; |
| 427 | int preflen = strlen(prefix); |
| 428 | Blob tagname; |
| 429 | |
| 430 | db_find_and_open_repository(1); |
| @@ -443,22 +445,23 @@ | |
| 443 | if( g.argc!=5 && g.argc!=6 ){ |
| 444 | usage("add ?--raw? TAGNAME UUID ?VALUE?"); |
| 445 | } |
| 446 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 447 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 448 | tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 1, 0); |
| 449 | }else |
| 450 | |
| 451 | if( strncmp(g.argv[2],"branch",n)==0 ){ |
| 452 | char *zValue; |
| 453 | if( g.argc!=5 && g.argc!=6 ){ |
| 454 | usage("branch ?--raw? TAGNAME UUID ?VALUE?"); |
| 455 | } |
| 456 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 457 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 458 | tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 2, raw==0); |
| 459 | if( !raw ){ |
| 460 | const char *zUuid = db_text(0, "SELECT uuid, MAX(rowid) FROM blob"); |
| 461 | printf("New_Fork \"%s\": %s\n", g.argv[3], zUuid); |
| 462 | } |
| 463 | }else |
| 464 | |
| @@ -465,11 +468,11 @@ | |
| 465 | if( strncmp(g.argv[2],"cancel",n)==0 ){ |
| 466 | if( g.argc!=5 ){ |
| 467 | usage("cancel ?--raw? TAGNAME UUID"); |
| 468 | } |
| 469 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 470 | tag_add_artifact(blob_str(&tagname), g.argv[4], 0, 0, 0); |
| 471 | }else |
| 472 | |
| 473 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 474 | Stmt q; |
| 475 | if( g.argc!=4 ){ |
| 476 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -257,19 +257,20 @@ | |
| 257 | ** is not complete at that stage. |
| 258 | */ |
| 259 | static void tag_prepare_fork( |
| 260 | Blob *pCtrl, |
| 261 | const char *zTagname, |
| 262 | int rid, |
| 263 | int preflen /* Tag prefix length to adjust name if reqd */ |
| 264 | ){ |
| 265 | Stmt q; |
| 266 | Manifest origin; |
| 267 | Blob originContent; |
| 268 | char *zDate; |
| 269 | int i; |
| 270 | |
| 271 | blob_appendf(pCtrl, "C Create\\snamed\\sfork\\s%s\n", zTagname+preflen); |
| 272 | content_get(rid, &originContent); |
| 273 | manifest_parse(&origin, &originContent); |
| 274 | zDate = db_text(0, "SELECT datetime('now')"); |
| 275 | zDate[10] = 'T'; |
| 276 | blob_appendf(pCtrl, "D %s\n", zDate); |
| @@ -309,11 +310,12 @@ | |
| 310 | static void tag_add_artifact( |
| 311 | const char *zTagname, /* The tag to add or cancel */ |
| 312 | const char *zObjName, /* Name of object attached to */ |
| 313 | const char *zValue, /* Value for the tag. Might be NULL */ |
| 314 | int tagtype, /* 0:cancel 1:singleton 2:propagated */ |
| 315 | int fork, /* Should a fork created from zObjName? */ |
| 316 | int preflen /* Tag prefix length to adjust name if reqd */ |
| 317 | ){ |
| 318 | int rid; |
| 319 | int nrid; |
| 320 | char *zDate; |
| 321 | Blob uuid; |
| @@ -334,11 +336,11 @@ | |
| 336 | if( validate16(zTagname, strlen(zTagname)) ){ |
| 337 | fossil_fatal("invalid tag name \"%s\" - might be confused with a UUID", |
| 338 | zTagname); |
| 339 | } |
| 340 | if( fork ){ |
| 341 | tag_prepare_fork(&ctrl, zTagname, rid, preflen); |
| 342 | }else{ |
| 343 | zDate = db_text(0, "SELECT datetime('now')"); |
| 344 | zDate[10] = 'T'; |
| 345 | blob_appendf(&ctrl, "D %s\n", zDate); |
| 346 | blob_appendf(&ctrl, "T %c%F %b", zTagtype[tagtype], zTagname, &uuid); |
| @@ -367,32 +369,31 @@ | |
| 369 | ** Run various subcommands to control tags and properties |
| 370 | ** |
| 371 | ** %fossil tag add ?--raw? TAGNAME UUID ?VALUE? |
| 372 | ** |
| 373 | ** Add a new tag or property to UUID. The tag will |
| 374 | ** be usable instead of a UUID in commands such as |
| 375 | ** update and merge. |
| 376 | ** |
| 377 | ** %fossil tag branch ?--raw? ?--nofork? TAGNAME UUID ?VALUE? |
| 378 | ** |
| 379 | ** A fork will be created so that the new checkin |
| 380 | ** is a sibling of UUID and identical to it except |
| 381 | ** for a generated comment. Then the new tag will |
| 382 | ** be added to the new checkin and propagated to |
| 383 | ** all direct children. Additionally all symbolic |
| 384 | ** tags of that checkin inherited from UUID will |
| 385 | ** be cancelled. |
| 386 | ** |
| 387 | ** However, if the option --nofork is given, no |
| 388 | ** fork will be created and the tag/property will be |
| 389 | ** added to UUID directly. No tags will be canceled. |
| 390 | ** |
| 391 | ** %fossil tag cancel ?--raw? TAGNAME UUID |
| 392 | ** |
| 393 | ** Remove the tag TAGNAME from UUID, and also remove |
| 394 | ** the propagation of the tag to any descendants. |
| 395 | ** |
| 396 | ** %fossil tag find ?--raw? TAGNAME |
| 397 | ** |
| 398 | ** List all baselines that use TAGNAME |
| 399 | ** |
| @@ -399,32 +400,33 @@ | |
| 400 | ** %fossil tag list ?--raw? ?UUID? |
| 401 | ** |
| 402 | ** List all tags, or if UUID is supplied, list |
| 403 | ** all tags and their values for UUID. |
| 404 | ** |
| 405 | ** The option --raw allows the manipulation of all types of |
| 406 | ** tags used for various internal purposes in fossil. You |
| 407 | ** should not use this option to make changes unless you are |
| 408 | ** sure what you are doing. |
| 409 | ** |
| 410 | ** If you need to use a tagname that might be confused with |
| 411 | ** a UUID, you can explicitly disambiguate it by prefixing |
| 412 | ** it with "tag:". For instance: |
| 413 | ** |
| 414 | ** fossil update decaf |
| 415 | ** |
| 416 | ** will be taken as a UUID and fossil will probably complain |
| 417 | ** that no such revision was found. However |
| 418 | ** |
| 419 | ** fossil update tag:cfcfcfee |
| 420 | ** |
| 421 | ** will assume that "decaf" is a tag/branch name. |
| 422 | ** |
| 423 | */ |
| 424 | void tag_cmd(void){ |
| 425 | int n; |
| 426 | int raw = find_option("raw","",0)!=0; |
| 427 | int fork = find_option("nofork","",0)==0; |
| 428 | const char *prefix = raw ? "" : "sym-"; |
| 429 | int preflen = strlen(prefix); |
| 430 | Blob tagname; |
| 431 | |
| 432 | db_find_and_open_repository(1); |
| @@ -443,22 +445,23 @@ | |
| 445 | if( g.argc!=5 && g.argc!=6 ){ |
| 446 | usage("add ?--raw? TAGNAME UUID ?VALUE?"); |
| 447 | } |
| 448 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 449 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 450 | tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 1, 0, 0); |
| 451 | }else |
| 452 | |
| 453 | if( strncmp(g.argv[2],"branch",n)==0 ){ |
| 454 | char *zValue; |
| 455 | if( g.argc!=5 && g.argc!=6 ){ |
| 456 | usage("branch ?--raw? ?--nofork? TAGNAME UUID ?VALUE?"); |
| 457 | } |
| 458 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 459 | zValue = g.argc==6 ? g.argv[5] : 0; |
| 460 | tag_add_artifact(blob_str(&tagname), g.argv[4], zValue, 2, fork!=0, |
| 461 | preflen); |
| 462 | if( fork ){ |
| 463 | const char *zUuid = db_text(0, "SELECT uuid, MAX(rowid) FROM blob"); |
| 464 | printf("New_Fork \"%s\": %s\n", g.argv[3], zUuid); |
| 465 | } |
| 466 | }else |
| 467 | |
| @@ -465,11 +468,11 @@ | |
| 468 | if( strncmp(g.argv[2],"cancel",n)==0 ){ |
| 469 | if( g.argc!=5 ){ |
| 470 | usage("cancel ?--raw? TAGNAME UUID"); |
| 471 | } |
| 472 | blob_append(&tagname, g.argv[3], strlen(g.argv[3])); |
| 473 | tag_add_artifact(blob_str(&tagname), g.argv[4], 0, 0, 0, 0); |
| 474 | }else |
| 475 | |
| 476 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 477 | Stmt q; |
| 478 | if( g.argc!=4 ){ |
| 479 |