Update from using AbsolutePath to LocalPath for all uris, fix some uri path combining.
This commit is contained in:
parent
bbd322a7d0
commit
b2b49012c1
|
@ -75,17 +75,17 @@ namespace SparkleLib.Git {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.Host.Equals ("gitorious.org") && !uri.Scheme.StartsWith ("http")) {
|
if (uri.Host.Equals ("gitorious.org") && !uri.Scheme.StartsWith ("http")) {
|
||||||
if (!uri.AbsolutePath.Equals ("/") &&
|
if (!uri.LocalPath.Equals ("/") &&
|
||||||
!uri.AbsolutePath.EndsWith (".git")) {
|
!uri.LocalPath.EndsWith (".git")) {
|
||||||
|
|
||||||
uri = new Uri ("ssh://git@gitorious.org" + uri.AbsolutePath + ".git");
|
uri = new Uri (Path.Combine( "ssh://git@gitorious.org", uri.LocalPath, ".git"));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uri = new Uri ("ssh://git@gitorious.org" + uri.AbsolutePath);
|
uri = new Uri (Path.Combine ("ssh://git@gitorious.org", uri.LocalPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (uri.Host.Equals ("github.com") && !uri.Scheme.StartsWith ("http")) {
|
} else if (uri.Host.Equals ("github.com") && !uri.Scheme.StartsWith ("http")) {
|
||||||
uri = new Uri ("ssh://git@github.com" + uri.AbsolutePath);
|
uri = new Uri (Path.Combine("ssh://git@github.com", uri.LocalPath));
|
||||||
|
|
||||||
} else if (uri.Host.Equals ("bitbucket.org") && !uri.Scheme.StartsWith ("http")) {
|
} else if (uri.Host.Equals ("bitbucket.org") && !uri.Scheme.StartsWith ("http")) {
|
||||||
// Nothing really
|
// Nothing really
|
||||||
|
@ -93,9 +93,9 @@ namespace SparkleLib.Git {
|
||||||
} else {
|
} else {
|
||||||
if (string.IsNullOrEmpty (uri.UserInfo) && !uri.Scheme.StartsWith ("http")) {
|
if (string.IsNullOrEmpty (uri.UserInfo) && !uri.Scheme.StartsWith ("http")) {
|
||||||
if (uri.Port == -1)
|
if (uri.Port == -1)
|
||||||
uri = new Uri (uri.Scheme + "://storage@" + uri.Host + uri.AbsolutePath);
|
uri = new Uri (Path.Combine (uri.Scheme + "://storage@" + uri.Host, uri.LocalPath));
|
||||||
else
|
else
|
||||||
uri = new Uri (uri.Scheme + "://storage@" + uri.Host + ":" + uri.Port + uri.AbsolutePath);
|
uri = new Uri (Path.Combine (uri.Scheme + "://storage@" + uri.Host + ":" + uri.Port, uri.LocalPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.use_git_bin = false; // TODO
|
this.use_git_bin = false; // TODO
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
|
|
||||||
bool repo_is_encrypted = (RemoteUrl.AbsolutePath.Contains ("-crypto") ||
|
bool repo_is_encrypted = (RemoteUrl.LocalPath.Contains ("-crypto") ||
|
||||||
RemoteUrl.Host.Equals ("sparkleshare.net"));
|
RemoteUrl.Host.Equals ("sparkleshare.net"));
|
||||||
|
|
||||||
Finished (repo_is_encrypted, IsFetchedRepoEmpty, Warnings);
|
Finished (repo_is_encrypted, IsFetchedRepoEmpty, Warnings);
|
||||||
|
@ -224,7 +224,7 @@ namespace SparkleLib {
|
||||||
n +
|
n +
|
||||||
"Have fun! :)" + n;
|
"Have fun! :)" + n;
|
||||||
|
|
||||||
if (RemoteUrl.AbsolutePath.Contains ("-crypto") || RemoteUrl.Host.Equals ("sparkleshare.net"))
|
if (RemoteUrl.LocalPath.Contains ("-crypto") || RemoteUrl.Host.Equals ("sparkleshare.net"))
|
||||||
text = text.Replace ("a SparkleShare repository", "an encrypted SparkleShare repository");
|
text = text.Replace ("a SparkleShare repository", "an encrypted SparkleShare repository");
|
||||||
|
|
||||||
File.WriteAllText (file_path, text);
|
File.WriteAllText (file_path, text);
|
||||||
|
|
|
@ -635,7 +635,7 @@ namespace SparkleShare {
|
||||||
this.watcher.EnableRaisingEvents = false;
|
this.watcher.EnableRaisingEvents = false;
|
||||||
|
|
||||||
this.fetcher.Complete ();
|
this.fetcher.Complete ();
|
||||||
string canonical_name = Path.GetFileName (this.fetcher.RemoteUrl.AbsolutePath);
|
string canonical_name = Path.GetFileName (this.fetcher.RemoteUrl.LocalPath);
|
||||||
|
|
||||||
canonical_name = canonical_name.Replace ("-crypto", "");
|
canonical_name = canonical_name.Replace ("-crypto", "");
|
||||||
canonical_name = canonical_name.Replace ("_", " ");
|
canonical_name = canonical_name.Replace ("_", " ");
|
||||||
|
@ -676,7 +676,7 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string backend = SparkleFetcherBase.GetBackend (this.fetcher.RemoteUrl.AbsolutePath);
|
string backend = SparkleFetcherBase.GetBackend (this.fetcher.RemoteUrl.LocalPath);
|
||||||
|
|
||||||
this.config.AddFolder (target_folder_name, this.fetcher.Identifier,
|
this.config.AddFolder (target_folder_name, this.fetcher.Identifier,
|
||||||
this.fetcher.RemoteUrl.ToString (), backend);
|
this.fetcher.RemoteUrl.ToString (), backend);
|
||||||
|
|
|
@ -392,7 +392,7 @@ namespace SparkleShare {
|
||||||
Uri uri = new Uri (remote_url);
|
Uri uri = new Uri (remote_url);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string address = remote_url.Replace (uri.AbsolutePath, "");
|
string address = uri.ToString ().Replace (uri.LocalPath, "");
|
||||||
|
|
||||||
new_plugin = SparklePlugin.Create (uri.Host, address, address, "", "", "/path/to/project");
|
new_plugin = SparklePlugin.Create (uri.Host, address, address, "", "", "/path/to/project");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue