for backward compatibility, --resync is now equivalent to --resync-mode path1 and either flag is sufficient without the other.
()
| 14 | // for backward compatibility, --resync is now equivalent to --resync-mode path1 |
| 15 | // and either flag is sufficient without the other. |
| 16 | func (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, |