diff --git a/Duplicati/Library/Main/Operation/RestoreHandler.cs b/Duplicati/Library/Main/Operation/RestoreHandler.cs index c6f55a59a..47119a058 100644 --- a/Duplicati/Library/Main/Operation/RestoreHandler.cs +++ b/Duplicati/Library/Main/Operation/RestoreHandler.cs @@ -149,11 +149,9 @@ namespace Duplicati.Library.Main.Operation if (m_result.TaskControlRendevouz() == TaskControlState.Stop) return; -#if DEBUG - if (!m_options.NoLocalBlocks) -#endif // If other local files already have the blocks we want, we use them instead of downloading - ScanForExistingSourceBlocks(database, m_options, m_blockbuffer, blockhasher, m_result); + if (!m_options.NoLocalBlocks) + ScanForExistingSourceBlocks(database, m_options, m_blockbuffer, blockhasher, m_result); if (m_result.TaskControlRendevouz() == TaskControlState.Stop) return; @@ -330,11 +328,7 @@ namespace Duplicati.Library.Main.Operation //Look for existing blocks in the original source files only using(new Logging.Timer("ScanForExistingSourceBlocksFast")) -#if DEBUG if (!m_options.NoLocalBlocks && !string.IsNullOrEmpty(m_options.Restorepath)) -#else - if (!string.IsNullOrEmpty(m_options.Restorepath)) -#endif { m_result.OperationProgressUpdater.UpdatePhase(OperationPhase.Restore_ScanForLocalBlocks); ScanForExistingSourceBlocksFast(database, m_options, m_blockbuffer, blockhasher, result); diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index 76822b8b3..ef718f963 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -359,6 +359,8 @@ namespace Duplicati.Library.Main "time", "version", "allow-passphrase-change", + "no-local-db", + "no-local-blocks", }; } } @@ -494,9 +496,7 @@ namespace Duplicati.Library.Main new CommandLineArgument("keep-time", CommandLineArgument.ArgumentType.Timespan, Strings.Options.KeeptimeShort, Strings.Options.KeeptimeLong), new CommandLineArgument("upload-verification-file", CommandLineArgument.ArgumentType.Boolean, Strings.Options.UploadverificationfileShort, Strings.Options.UploadverificationfileLong, "false"), new CommandLineArgument("allow-passphrase-change", CommandLineArgument.ArgumentType.Boolean, Strings.Options.AllowpassphrasechangeShort, Strings.Options.AllowpassphrasechangeLong, "false"), -#if DEBUG - new CommandLineArgument("no-local-blocks", CommandLineArgument.ArgumentType.Boolean, "Prevents using local blocks for restore", "", "false"), -#endif + new CommandLineArgument("no-local-blocks", CommandLineArgument.ArgumentType.Boolean, Strings.Options.NolocalblocksShort, Strings.Options.NolocalblocksLong, "false"), }); return lst; @@ -1678,12 +1678,14 @@ namespace Duplicati.Library.Main get { return m_options.ContainsKey("patch-with-local-blocks"); } } -#if DEBUG + /// + /// Gets a value indicating whether local blocks usage should be skipped. + /// + /// true if no local blocks; otherwise, false. public bool NoLocalBlocks { get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-local-blocks"); } } -#endif /// /// Gets a flag indicating if the local database should not be used diff --git a/Duplicati/Library/Main/Strings.cs b/Duplicati/Library/Main/Strings.cs index c31e4a3cd..c9e49af9d 100644 --- a/Duplicati/Library/Main/Strings.cs +++ b/Duplicati/Library/Main/Strings.cs @@ -195,7 +195,9 @@ namespace Duplicati.Library.Main.Strings public static string SkiprestoreverificationLong { get { return LC.L(@"After restoring files, the file hash of all restored files are checked to verify that the restore was successfull. Use this option to disable the check and avoid waiting for the verification."); } } public static string OldmemorylookupdefaultsShort { get { return LC.L(@"Activate caches"); } } public static string OldmemorylookupdefaultsLong { get { return LC.L(@"Activate in-memory caches, which are now off by default"); } } - } + public static string NolocalblocksShort { get { return LC.L(@"Do not use local data"); } } + public static string NolocalblocksLong { get { return LC.L(@"Duplicati will attempt to use data from source files to minimize the amount of downloaded data. Use this option to skip this optimization and only use remote data."); } } + } internal static class Foresthash {