Fossil

Check-in [a6a1a3cf0c]
Login

Check-in [a6a1a3cf0c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:branch close: dry-run mode no longer skips the saving steps.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-close-subcommand
Files: files | file ages | folders
SHA3-256: a6a1a3cf0cc6a8ccfddf3a082f25d872ecfb66601222c2fab08062bae11db7b5
User & Date: stephan 2021-07-22 06:16:29.940
Context
2021-07-22
06:25
branch close: minor doc and style cleanups. Delay output of control artifact in dry-run mode until after Z-card is calculated. Only show new dry-run artifact in --verbose mode. ... (check-in: 25197505b1 user: stephan tags: branch-close-subcommand)
06:16
branch close: dry-run mode no longer skips the saving steps. ... (check-in: a6a1a3cf0c user: stephan tags: branch-close-subcommand)
05:59
Initial impl of (branch close) subcommand. ... (check-in: 0bdb19f3d3 user: stephan tags: branch-close-subcommand)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
400
401
402
403
404
405
406






407

408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424





425
426
427
428
429
430
431
  while(SQLITE_ROW==db_step(&q)){
    const char * zHash = db_column_text(&q, 0);
    blob_appendf(&manifest, "T +closed %s\n", zHash);
  }
  user_select();
  blob_appendf(&manifest, "U %F\n", login_name());
  db_finalize(&q);






  {

    Blob cksum = empty_blob;
    md5sum_blob(&manifest, &cksum);
    blob_appendf(&manifest, "Z %b\n", &cksum);
    blob_reset(&cksum);
  }
  if(fDryRun){
    fossil_print("Dry-run mode. Not saving control artifact:\n%b",
                 &manifest);
  }else{
    const int newRid = content_put(&manifest);
    if(0==newRid){
      fossil_fatal("Problem saving new manifest: %s\n%b",
                   g.zErrMsg, &manifest);
    }else if(manifest_crosslink(newRid, &manifest, 0)==0){
      fossil_fatal("Crosslinking error: %s", g.zErrMsg);
    }
    fossil_print("Saved new control artifact (RID %d)\n", newRid);





  }
  blob_reset(&manifest);
  br_close_end:
  db_multi_exec("DROP TABLE brclose");
  db_end_transaction(doRollback);
}








>
>
>
>
>
>

>




<
<
<
<
<
|

|




|
>
>
>
>
>







400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418





419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
  while(SQLITE_ROW==db_step(&q)){
    const char * zHash = db_column_text(&q, 0);
    blob_appendf(&manifest, "T +closed %s\n", zHash);
  }
  user_select();
  blob_appendf(&manifest, "U %F\n", login_name());
  db_finalize(&q);
  if(fDryRun){
    fossil_print("Dry-run mode: will roll back new artifact:\n%b",
                 &manifest);
    /* Run through the saving steps, though, noting that doing so
    ** will clear out &manifest. */
  }
  {
    int newRid;
    Blob cksum = empty_blob;
    md5sum_blob(&manifest, &cksum);
    blob_appendf(&manifest, "Z %b\n", &cksum);
    blob_reset(&cksum);





    newRid = content_put(&manifest);
    if(0==newRid){
      fossil_fatal("Problem saving new artifact: %s\n%b",
                   g.zErrMsg, &manifest);
    }else if(manifest_crosslink(newRid, &manifest, 0)==0){
      fossil_fatal("Crosslinking error: %s", g.zErrMsg);
    }
    fossil_print("Saved new control artifact %z (RID %d).\n",
                 rid_to_uuid(newRid), newRid);
    if(fDryRun){
      fossil_print("Dry-run mode: rolling back new artifact.\n");
      assert(doRollback!=0);
    }
  }
  blob_reset(&manifest);
  br_close_end:
  db_multi_exec("DROP TABLE brclose");
  db_end_transaction(doRollback);
}