Fossil

Check-in [a13217b8]
Login

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

Overview
Comment:Detect old stashfile schema and recreate to allow file renames to be stashed in existing checkout databases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | stash-fixes
Files: files | file ages | folders
SHA1: a13217b8975276ab79d3dacce19d07f749ab6a4b
User & Date: andybradford 2016-07-04 22:08:07
Context
2016-09-08
02:49
Merge updates from trunk. check-in: 63bcf60e user: mistachkin tags: stash-fixes
02:09
Merge in latest changes from trunk. Closed-Leaf check-in: 1912b2f8 user: andybradford tags: stash-fixes-openssl-1.1.0
2016-07-04
22:08
Detect old stashfile schema and recreate to allow file renames to be stashed in existing checkout databases. check-in: a13217b8 user: andybradford tags: stash-fixes
20:13
Merge in trunk and resolve conflict. check-in: 003b6581 user: andybradford tags: stash-fixes
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/stash.c.

479
480
481
482
483
484
485

486
487
488
489
490
491














492
493
494
495
496
497
498
**  fossil stash [g]diff ?STASHID? ?DIFF-OPTIONS?
*/
void stash_cmd(void){
  const char *zDb;
  const char *zCmd;
  int nCmd;
  int stashid = 0;

  undo_capture_command_line();
  db_must_be_within_tree();
  db_open_config(0, 0);
  db_begin_transaction();
  zDb = db_name("localdb");
  db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);














  if( g.argc<=2 ){
    zCmd = "save";
  }else{
    zCmd = g.argv[2];
  }
  nCmd = strlen(zCmd);
  if( memcmp(zCmd, "save", nCmd)==0 ){







>






>
>
>
>
>
>
>
>
>
>
>
>
>
>







479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
**  fossil stash [g]diff ?STASHID? ?DIFF-OPTIONS?
*/
void stash_cmd(void){
  const char *zDb;
  const char *zCmd;
  int nCmd;
  int stashid = 0;
  int rc;
  undo_capture_command_line();
  db_must_be_within_tree();
  db_open_config(0, 0);
  db_begin_transaction();
  zDb = db_name("localdb");
  db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);
  rc = db_exists("SELECT 1 FROM sqlite_master"
                 " WHERE name='stashfile'"
                 "   AND sql GLOB '* PRIMARY KEY(origname, stashid)*'");
  if( rc!=0 ){
    db_multi_exec(
      "CREATE TABLE \"%w\".stashfile_tmp AS SELECT * FROM stashfile;"
      "DROP TABLE stashfile;", zDb
    );
    db_multi_exec(zStashInit /*works-like:"%w,%w"*/, zDb, zDb);
    db_multi_exec(
      "INSERT INTO stashfile SELECT * FROM stashfile_tmp;"
      "DROP TABLE stashfile_tmp;"
    );
  }
  if( g.argc<=2 ){
    zCmd = "save";
  }else{
    zCmd = g.argv[2];
  }
  nCmd = strlen(zCmd);
  if( memcmp(zCmd, "save", nCmd)==0 ){