add toggle for using the delta tree via cli (#4694)

#### Does this PR need a docs update or release note?

- [x]  No

#### Issue(s)

* #4690

#### Test Plan

- [x]  Unit test
This commit is contained in:
Keepers 2023-11-17 17:00:58 -07:00 committed by GitHub
parent 8cf2c1b294
commit d45842fe5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -67,6 +67,12 @@ func addOneDriveCommands(cmd *cobra.Command) *cobra.Command {
flags.AddUserFlag(c) flags.AddUserFlag(c)
flags.AddGenericBackupFlags(c) flags.AddGenericBackupFlags(c)
fs.BoolVar(
&flags.UseDeltaTreeFV,
flags.UseDeltaTreeFN,
false,
"process backups using the delta tree instead of standard enumeration")
cobra.CheckErr(fs.MarkHidden(flags.UseDeltaTreeFN))
case listCommand: case listCommand:
c, fs = utils.AddCommand(cmd, oneDriveListCmd()) c, fs = utils.AddCommand(cmd, oneDriveListCmd())

View File

@ -12,6 +12,8 @@ const (
FileCreatedBeforeFN = "file-created-before" FileCreatedBeforeFN = "file-created-before"
FileModifiedAfterFN = "file-modified-after" FileModifiedAfterFN = "file-modified-after"
FileModifiedBeforeFN = "file-modified-before" FileModifiedBeforeFN = "file-modified-before"
UseDeltaTreeFN = "use-delta-tree"
) )
var ( var (
@ -22,6 +24,8 @@ var (
FileCreatedBeforeFV string FileCreatedBeforeFV string
FileModifiedAfterFV string FileModifiedAfterFV string
FileModifiedBeforeFV string FileModifiedBeforeFV string
UseDeltaTreeFV bool
) )
// AddOneDriveDetailsAndRestoreFlags adds flags that are common to both the // AddOneDriveDetailsAndRestoreFlags adds flags that are common to both the

View File

@ -27,6 +27,7 @@ func Control() control.Options {
opt.ToggleFeatures.DisableDelta = flags.DisableDeltaFV opt.ToggleFeatures.DisableDelta = flags.DisableDeltaFV
opt.ToggleFeatures.DisableSlidingWindowLimiter = flags.DisableSlidingWindowLimiterFV opt.ToggleFeatures.DisableSlidingWindowLimiter = flags.DisableSlidingWindowLimiterFV
opt.ToggleFeatures.ExchangeImmutableIDs = flags.EnableImmutableIDFV opt.ToggleFeatures.ExchangeImmutableIDs = flags.EnableImmutableIDFV
opt.ToggleFeatures.UseDeltaTree = flags.UseDeltaTreeFV
opt.Parallelism.ItemFetch = flags.FetchParallelismFV opt.Parallelism.ItemFetch = flags.FetchParallelismFV
return opt return opt

View File

@ -109,4 +109,7 @@ type Toggles struct {
// Setting this flag switches exchange backups to fallback to the default token // Setting this flag switches exchange backups to fallback to the default token
// bucket rate limiter. // bucket rate limiter.
DisableSlidingWindowLimiter bool `json:"disableSlidingWindowLimiter"` DisableSlidingWindowLimiter bool `json:"disableSlidingWindowLimiter"`
// see: https://github.com/alcionai/corso/issues/4688
UseDeltaTree bool `json:"useDeltaTree"`
} }