270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
" isexe BOOLEAN," /* Does target have execute permission? */
" deleted BOOLEAN DEFAULT 0,"/* File marked by "rm" to become unmanaged */
" fnt TEXT %s" /* Filename of same file on target version */
");",
filename_collation(), filename_collation()
);
/* Add files found in the current version
*/
db_multi_exec(
"INSERT OR IGNORE INTO fv(fn,fnt,idv,idt,ridv,ridt,isexe,chnged,deleted)"
" SELECT pathname, pathname, id, 0, rid, 0, isexe, chnged, deleted"
" FROM vfile WHERE vid=%d",
vid
);
/* Compute file name changes on V->T. Record name changes in files that
** have changed locally.
*/
|
|
>
>
|
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
" isexe BOOLEAN," /* Does target have execute permission? */
" deleted BOOLEAN DEFAULT 0,"/* File marked by "rm" to become unmanaged */
" fnt TEXT %s" /* Filename of same file on target version */
");",
filename_collation(), filename_collation()
);
/* Add files found in the current version. If a file is renamed locally,
** use origname to compare with the original pathname in the target.
*/
db_multi_exec(
"INSERT OR IGNORE INTO fv(fn,fnt,idv,idt,ridv,ridt,isexe,chnged,deleted)"
" SELECT pathname, COALESCE(origname,pathname), id, 0, rid, 0,"
" isexe, chnged, deleted"
" FROM vfile WHERE vid=%d",
vid
);
/* Compute file name changes on V->T. Record name changes in files that
** have changed locally.
*/
|
626
627
628
629
630
631
632
633
634
635
636
637
638
639
|
zPwd = file_getcwd(0,0);
db_multi_exec(
"SELECT rmdir(%Q||name) FROM dir_to_delete"
" WHERE (%Q||name)<>%Q ORDER BY name DESC",
g.zLocalRoot, g.zLocalRoot, zPwd
);
fossil_free(zPwd);
if( g.argc<=3 ){
/* All files updated. Shift the current check-out to the target. */
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
checkout_set_all_exe(tid);
manifest_to_disk(tid);
db_set_checkout(tid);
}else{
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
|
zPwd = file_getcwd(0,0);
db_multi_exec(
"SELECT rmdir(%Q||name) FROM dir_to_delete"
" WHERE (%Q||name)<>%Q ORDER BY name DESC",
g.zLocalRoot, g.zLocalRoot, zPwd
);
fossil_free(zPwd);
/* Before deleting the old vid, transfer renames from the current vid. */
db_multi_exec(
"WITH mv AS ("
" SELECT pathname AS path, origname AS orig"
" FROM vfile"
" WHERE vid=%i AND origname IS NOT NULL AND pathname!=origname"
")"
" UPDATE vfile"
" SET pathname=path, origname=orig"
" FROM mv"
" WHERE vid=%i AND pathname=orig",
vid, tid
);
if( g.argc<=3 ){
/* All files updated. Shift the current check-out to the target. */
db_multi_exec("DELETE FROM vfile WHERE vid!=%d", tid);
checkout_set_all_exe(tid);
manifest_to_disk(tid);
db_set_checkout(tid);
}else{
|