controller: try moving projects from .tmp twice and add more debug output
This commit is contained in:
parent
cdf28e8d20
commit
aae2433741
|
@ -455,7 +455,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void ClearFolderAttributes (string path)
|
private void ClearDirectoryAttributes (string path)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists (path))
|
if (!Directory.Exists (path))
|
||||||
return;
|
return;
|
||||||
|
@ -463,7 +463,7 @@ namespace SparkleShare {
|
||||||
string [] folders = Directory.GetDirectories (path);
|
string [] folders = Directory.GetDirectories (path);
|
||||||
|
|
||||||
foreach (string folder in folders)
|
foreach (string folder in folders)
|
||||||
ClearFolderAttributes (folder);
|
ClearDirectoryAttributes (folder);
|
||||||
|
|
||||||
string [] files = Directory.GetFiles(path);
|
string [] files = Directory.GetFiles(path);
|
||||||
|
|
||||||
|
@ -652,14 +652,21 @@ namespace SparkleShare {
|
||||||
string target_folder_path = Path.Combine (this.config.FoldersPath, target_folder_name);
|
string target_folder_path = Path.Combine (this.config.FoldersPath, target_folder_name);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ClearFolderAttributes (this.fetcher.TargetFolder);
|
|
||||||
Directory.Move (this.fetcher.TargetFolder, target_folder_path);
|
Directory.Move (this.fetcher.TargetFolder, target_folder_path);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SparkleLogger.LogInfo ("Controller", "Error moving directory: " + e.Message);
|
SparkleLogger.LogInfo ("Controller", "Error moving directory: \"" + e.Message + "\", trying again...");
|
||||||
|
|
||||||
|
try {
|
||||||
|
ClearDirectoryAttributes (this.fetcher.TargetFolder);
|
||||||
|
Directory.Move (this.fetcher.TargetFolder, target_folder_path);
|
||||||
|
|
||||||
|
} catch (Exception x) {
|
||||||
|
SparkleLogger.LogInfo ("Controller", "Error moving directory: " + x.Message);
|
||||||
this.watcher.EnableRaisingEvents = true;
|
this.watcher.EnableRaisingEvents = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string backend = SparkleFetcherBase.GetBackend (this.fetcher.RemoteUrl.AbsolutePath);
|
string backend = SparkleFetcherBase.GetBackend (this.fetcher.RemoteUrl.AbsolutePath);
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ namespace SparkleShare {
|
||||||
Program.Controller.OpenWebsite (url);
|
Program.Controller.OpenWebsite (url);
|
||||||
|
|
||||||
} else if (url.StartsWith ("restore://") && this.restore_revision_info == null) {
|
} else if (url.StartsWith ("restore://") && this.restore_revision_info == null) {
|
||||||
Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)", RegexOptions.Compiled);
|
Regex regex = new Regex ("restore://(.+)/([a-f0-9]+)/(.+)/(.{3} [0-9]+ [0-9]+h[0-9]+)/(.+)");
|
||||||
Match match = regex.Match (url);
|
Match match = regex.Match (url);
|
||||||
|
|
||||||
if (match.Success) {
|
if (match.Success) {
|
||||||
|
|
Loading…
Reference in a new issue