Promoted the option --no-local-blocks to a normal option, so restores can be tested without fiddling with source data.

This commit is contained in:
Kenneth Skovhede
2015-01-27 22:12:52 +01:00
parent f3e6ae46b3
commit bbec2e8301
3 changed files with 12 additions and 14 deletions
@@ -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);
+7 -5
View File
@@ -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
/// <summary>
/// Gets a value indicating whether local blocks usage should be skipped.
/// </summary>
/// <value><c>true</c> if no local blocks; otherwise, <c>false</c>.</value>
public bool NoLocalBlocks
{
get { return Library.Utility.Utility.ParseBoolOption(m_options, "no-local-blocks"); }
}
#endif
/// <summary>
/// Gets a flag indicating if the local database should not be used
+3 -1
View File
@@ -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
{