Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Refactor revert command SQL slightly. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
e66a12ec4bfa24bcc4fd096be6f08fbd |
| User & Date: | joel 2014-02-23 02:14:41.280 |
Context
|
2014-02-23
| ||
| 04:56 | Verify revert output in revert tests. check-in: 3949c9a33e user: joel tags: trunk | |
| 02:14 | Refactor revert command SQL slightly. check-in: e66a12ec4b user: joel tags: trunk | |
|
2014-02-22
| ||
| 05:31 | Add some utility functions to tester.tcl to reduce boilerplate code in certain tests. check-in: 23d3113bb1 user: joel tags: trunk | |
Changes
Changes to src/update.c.
| ︙ | ︙ | |||
715 716 717 718 719 720 721 |
zFile = mprintf("%/", g.argv[i]);
file_tree_name(zFile, &fname, 1);
db_multi_exec(
"REPLACE INTO torevert VALUES(%B);"
"INSERT OR IGNORE INTO torevert"
" SELECT pathname"
" FROM vfile"
| | < < < < | | < > > > > | | | | < | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
zFile = mprintf("%/", g.argv[i]);
file_tree_name(zFile, &fname, 1);
db_multi_exec(
"REPLACE INTO torevert VALUES(%B);"
"INSERT OR IGNORE INTO torevert"
" SELECT pathname"
" FROM vfile"
" WHERE origname=%B;",
&fname, &fname
);
blob_reset(&fname);
}
}else{
int vid;
vid = db_lget_int("checkout", 0);
vfile_check_signature(vid, 0);
db_multi_exec(
"DELETE FROM vmerge;"
"INSERT OR IGNORE INTO torevert "
" SELECT pathname"
" FROM vfile "
" WHERE chnged OR deleted OR rid=0 OR pathname!=origname;"
);
}
db_multi_exec(
"INSERT OR IGNORE INTO torevert"
" SELECT origname"
" FROM vfile"
" WHERE origname!=pathname AND pathname IN (SELECT name FROM torevert);"
);
blob_zero(&record);
db_prepare(&q, "SELECT name FROM torevert");
if( zRevision==0 ){
int vid = db_lget_int("checkout", 0);
zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
}
while( db_step(&q)==SQLITE_ROW ){
|
| ︙ | ︙ | |||
766 767 768 769 770 771 772 |
undo_save(zFile);
file_delete(zFull);
fossil_print("DELETE: %s\n", zFile);
}
db_multi_exec(
"UPDATE vfile"
" SET pathname=origname, origname=NULL"
| | | 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 |
undo_save(zFile);
file_delete(zFull);
fossil_print("DELETE: %s\n", zFile);
}
db_multi_exec(
"UPDATE vfile"
" SET pathname=origname, origname=NULL"
" WHERE pathname=%Q AND origname!=pathname;"
"DELETE FROM vfile WHERE pathname=%Q",
zFile, zFile
);
}else{
sqlite3_int64 mtime;
undo_save(zFile);
if( file_wd_size(zFull)>=0 && (isLink || file_wd_islink(zFull)) ){
|
| ︙ | ︙ |