MCPcopy
hub / github.com/rclone/rclone / setResyncDefaults

Method setResyncDefaults

cmd/bisync/resync.go:16–37  ·  view source on GitHub ↗

for backward compatibility, --resync is now equivalent to --resync-mode path1 and either flag is sufficient without the other.

()

Source from the content-addressed store, hash-verified

14// for backward compatibility, --resync is now equivalent to --resync-mode path1
15// and either flag is sufficient without the other.
16func (b *bisyncRun) setResyncDefaults() {
17 if b.opt.Resync && b.opt.ResyncMode == PreferNone {
18 fs.Debug(nil, Color(terminal.Dim, "defaulting to --resync-mode path1 as --resync is set"))
19 b.opt.ResyncMode = PreferPath1
20 }
21 if b.opt.ResyncMode != PreferNone {
22 b.opt.Resync = true
23 }
24
25 // checks and warnings
26 if (b.opt.ResyncMode == PreferNewer || b.opt.ResyncMode == PreferOlder) && (b.fs1.Precision() == fs.ModTimeNotSupported || b.fs2.Precision() == fs.ModTimeNotSupported) {
27 fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as at least one remote does not support modtimes."), b.opt.ResyncMode.String())
28 b.opt.ResyncMode = PreferPath1
29 } else if (b.opt.ResyncMode == PreferNewer || b.opt.ResyncMode == PreferOlder) && !b.opt.Compare.Modtime {
30 fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as --compare does not include modtime."), b.opt.ResyncMode.String())
31 b.opt.ResyncMode = PreferPath1
32 }
33 if (b.opt.ResyncMode == PreferLarger || b.opt.ResyncMode == PreferSmaller) && !b.opt.Compare.Size {
34 fs.Logf(nil, Color(terminal.YellowFg, "WARNING: ignoring --resync-mode %s as --compare does not include size."), b.opt.ResyncMode.String())
35 b.opt.ResyncMode = PreferPath1
36 }
37}
38
39// resync implements the --resync mode.
40// It will generate path1 and path2 listings,

Callers 1

BisyncFunction · 0.95

Calls 5

DebugFunction · 0.92
LogfFunction · 0.92
ColorFunction · 0.85
PrecisionMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected