MCPcopy
hub / github.com/rclone/rclone / runBisync

Method runBisync

cmd/bisync/bisync_test.go:1103–1230  ·  view source on GitHub ↗
(ctx context.Context, args []string)

Source from the content-addressed store, hash-verified

1101}
1102
1103func (b *bisyncTest) runBisync(ctx context.Context, args []string) (err error) {
1104 opt := &bisync.Options{
1105 Workdir: b.workDir,
1106 NoCleanup: true,
1107 SaveQueues: true,
1108 MaxDelete: bisync.DefaultMaxDelete,
1109 CheckFilename: bisync.DefaultCheckFilename,
1110 CheckSync: bisync.CheckSyncTrue,
1111 TestFn: b.TestFn,
1112 }
1113 ctx, opt = b.checkPreReqs(ctx, opt)
1114 octx, ci := fs.AddConfig(ctx)
1115 fs1, fs2 := b.fs1, b.fs2
1116
1117 addSubdir := func(path, subdir string) fs.Fs {
1118 remote := path + subdir
1119 f, err := cache.Get(ctx, remote)
1120 require.NoError(b.t, err, "parsing remote %q", remote)
1121 return f
1122 }
1123
1124 for _, arg := range args {
1125 val := ""
1126 pos := strings.Index(arg, "=")
1127 if pos > 0 {
1128 arg, val = arg[:pos], arg[pos+1:]
1129 }
1130 switch arg {
1131 case "resync":
1132 opt.Resync = true
1133 case "dry-run":
1134 ci.DryRun = true
1135 opt.DryRun = true
1136 case "force":
1137 opt.Force = true
1138 case "create-empty-src-dirs":
1139 opt.CreateEmptySrcDirs = true
1140 case "remove-empty-dirs":
1141 opt.RemoveEmptyDirs = true
1142 case "check-sync-only":
1143 opt.CheckSync = bisync.CheckSyncOnly
1144 case "no-check-sync":
1145 opt.CheckSync = bisync.CheckSyncFalse
1146 case "check-access":
1147 opt.CheckAccess = true
1148 case "check-filename":
1149 opt.CheckFilename = val
1150 case "filters-file":
1151 opt.FiltersFile = val
1152 case "max-delete":
1153 opt.MaxDelete, err = strconv.Atoi(val)
1154 require.NoError(b.t, err, "parsing max-delete=%q", val)
1155 case "size-only":
1156 ci.SizeOnly = true
1157 case "ignore-size":
1158 ci.IgnoreSize = true
1159 case "checksum":
1160 ci.CheckSum = true

Callers 1

runTestStepMethod · 0.95

Calls 15

checkPreReqsMethod · 0.95
replaceHexMethod · 0.95
logPrintfMethod · 0.95
AddConfigFunction · 0.92
GetFunction · 0.92
DebugfFunction · 0.92
ListRFunction · 0.92
SetDirModTimeFunction · 0.92
CaptureOutputFunction · 0.92
BisyncFunction · 0.92
SetMethod · 0.65
FeaturesMethod · 0.65

Tested by

no test coverage detected