(ctx context.Context, thisNamePair namePair, thisPath string, thisFs fs.Fs, thisPathNum int, renameSkipped *bilib.Names)
| 332 | } |
| 333 | |
| 334 | func (b *bisyncRun) delete(ctx context.Context, thisNamePair namePair, thisPath string, thisFs fs.Fs, thisPathNum int, renameSkipped *bilib.Names) (err error) { |
| 335 | skip := operations.SkipDestructive(ctx, thisNamePair.oldName, "delete") |
| 336 | if !skip { |
| 337 | b.indent(fmt.Sprintf("!Path%d", thisPathNum), thisPath+thisNamePair.oldName, fmt.Sprintf("Deleting Path%d copy", thisPathNum)) |
| 338 | ctx = b.setBackupDir(ctx, thisPathNum) |
| 339 | ci := fs.GetConfig(ctx) |
| 340 | var backupDir fs.Fs |
| 341 | if ci.BackupDir != "" { |
| 342 | backupDir, err = operations.BackupDir(ctx, thisFs, thisFs, thisNamePair.oldName) |
| 343 | if err != nil { |
| 344 | b.critical = true |
| 345 | return err |
| 346 | } |
| 347 | } |
| 348 | obj, err := thisFs.NewObject(ctx, thisNamePair.oldName) |
| 349 | if err != nil { |
| 350 | b.critical = true |
| 351 | return err |
| 352 | } |
| 353 | if err = operations.DeleteFileWithBackupDir(ctx, obj, backupDir); err != nil { |
| 354 | err = fmt.Errorf("%s delete failed for %s: %w", thisPath, thisPath+thisNamePair.oldName, err) |
| 355 | b.critical = true |
| 356 | return err |
| 357 | } |
| 358 | } else { |
| 359 | renameSkipped.Add(thisNamePair.oldName) // (due to dry-run, not equality) |
| 360 | } |
| 361 | return nil |
| 362 | } |
| 363 | |
| 364 | func (b *bisyncRun) conflictWinner(ds1, ds2 *deltaSet, remote1, remote2 string) int { |
| 365 | switch b.opt.ConflictResolve { |
no test coverage detected