20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
*/
#include "config.h"
#include "add.h"
#include <assert.h>
#include <dirent.h>
#include "cygsup.h"
/*
** WARNING: For Fossil version 1.x this value was always zero. For Fossil
** 2.x, it will probably always be one. When this value is zero,
** files in the checkout will not be moved by the "mv" command.
**
** If the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option is used,
** the "move-files" setting will be consulted instead of using
** this value.
**
** To retain the Fossil version 1.x behavior when using Fossil 2.x,
** the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option must be used
** -AND- the "move-files" setting must be set to non-zero.
*/
#ifndef FOSSIL_MV_CHECKOUT_FILE_ON_MV
#define FOSSIL_MV_CHECKOUT_FILE_ON_MV (0)
#endif
/*
** WARNING: For Fossil version 1.x this value was always zero. For Fossil
** 2.x, it will probably always be one. When this value is zero,
** files in the checkout will not be removed by the "rm" command.
**
** If the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option is used,
** the "remove-files" setting will be consulted instead of using
** this value.
**
** To retain the Fossil version 1.x behavior when using Fossil 2.x,
** the FOSSIL_ENABLE_LEGACY_MV_RM compile-time option must be used
** -AND- the "move-files" setting must be set to non-zero.
*/
#ifndef FOSSIL_RM_CHECKOUT_FILE_ON_RM
#define FOSSIL_RM_CHECKOUT_FILE_ON_RM (0)
#endif
/*
** This routine returns the names of files in a working checkout that
** are created by Fossil itself, and hence should not be added, deleted,
** or merge, and should be omitted from "clean" and "extras" lists.
**
** Return the N-th name. The first name has N==0. When all names have
** been used, return 0.
|
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
|
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
+
+
+
+
|
dryRunFlag = find_option("dry-run","n",0)!=0;
/* We should be done with options.. */
verify_all_options();
db_must_be_within_tree();
db_begin_transaction();
#if FOSSIL_ENABLE_LEGACY_MV_RM
removeFiles = db_get_boolean("remove-files",0);
#else
removeFiles = FOSSIL_RM_CHECKOUT_FILE_ON_RM;
#endif
if( removeFiles ) init_files_to_remove();
db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
filename_collation());
for(i=2; i<g.argc; i++){
Blob treeName;
char *zTreeName;
|
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
|
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
|
+
+
+
+
|
fossil_fatal("no checkout rename files in");
}
if( g.argc<4 ){
usage("OLDNAME NEWNAME");
}
zDest = g.argv[g.argc-1];
db_begin_transaction();
#if FOSSIL_ENABLE_LEGACY_MV_RM
moveFiles = db_get_boolean("move-files",0);
#else
moveFiles = FOSSIL_MV_CHECKOUT_FILE_ON_MV;
#endif
if( moveFiles ) init_files_to_move();
file_tree_name(zDest, &dest, 1);
db_multi_exec(
"UPDATE vfile SET origname=pathname WHERE origname IS NULL;"
);
db_multi_exec(
"CREATE TEMP TABLE mv(f TEXT UNIQUE ON CONFLICT IGNORE, t TEXT);"
|