本文整理汇总了C#中GitSharp.Core.Transport.URIish类的典型用法代码示例。如果您正苦于以下问题:C# URIish类的具体用法?C# URIish怎么用?C# URIish使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
URIish类属于GitSharp.Core.Transport命名空间,在下文中一共展示了URIish类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: canHandle
public static bool canHandle(URIish uri)
{
if (uri == null)
throw new System.ArgumentNullException("uri");
return "git".Equals(uri.Scheme);
}
开发者ID:dev218,项目名称:GitSharp,代码行数:7,代码来源:TransportGitAnon.cs
示例2: SubmoduleEntry
public SubmoduleEntry(string name, string path, URIish url, UpdateMethod update)
{
Name = name;
Path = path;
Url = url;
Update = update;
}
开发者ID:dev218,项目名称:GitSharp,代码行数:7,代码来源:SubmoduleConfig.cs
示例3: canHandle
public static bool canHandle(URIish uri)
{
if (uri == null)
throw new ArgumentNullException("uri");
if (!uri.IsRemote)
{
return false;
}
string scheme = uri.Scheme;
if ("ssh".Equals(scheme))
{
return true;
}
if ("ssh+git".Equals(scheme))
{
return true;
}
if ("git+ssh".Equals(scheme))
{
return true;
}
if (scheme == null && uri.Host != null && uri.Path != null)
{
return true;
}
return false;
}
开发者ID:dev218,项目名称:GitSharp,代码行数:33,代码来源:TransportGitSsh.cs
示例4: canHandle
public static bool canHandle(URIish uri)
{
if (!uri.IsRemote)
{
return false;
}
string scheme = uri.Scheme;
if ("ssh".Equals(scheme))
{
return true;
}
if ("ssh+git".Equals(scheme))
{
return true;
}
if ("git+ssh".Equals(scheme))
{
return true;
}
if (scheme == null && uri.Host != null && uri.Path != null)
{
return true;
}
return false;
}
开发者ID:georgeck,项目名称:GitSharp,代码行数:31,代码来源:TransportGitSsh.cs
示例5: FetchHeadRecord
public FetchHeadRecord(ObjectId newValue, bool notForMerge, string sourceName, URIish sourceUri)
{
NewValue = newValue;
NotForMerge = notForMerge;
SourceName = sourceName;
SourceURI = sourceUri;
}
开发者ID:dev218,项目名称:GitSharp,代码行数:7,代码来源:FetchHeadRecord.cs
示例6: canHandle
public static bool canHandle(URIish uri)
{
if (uri == null)
throw new ArgumentNullException ("uri");
return uri.IsRemote && "sftp".Equals(uri.Scheme);
}
开发者ID:stschake,项目名称:GitSharp,代码行数:7,代码来源:TransportSftp.cs
示例7: canHandle
public static bool canHandle(URIish uri)
{
if (!uri.IsRemote)
{
return false;
}
return S3_SCHEME == uri.Scheme;
}
开发者ID:jagregory,项目名称:GitSharp,代码行数:9,代码来源:TransportAmazonS3.cs
示例8: testWindowsFile2
public void testWindowsFile2()
{
const string str = "D:\\m y";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual("D:/m y", u.Path);
Assert.AreEqual("D:/m y", u.ToString());
Assert.AreEqual(u, new URIish(str));
}
开发者ID:dev218,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs
示例9: testUnixFile
public void testUnixFile()
{
const string str = "/home/m y";
var u = new URIish(str);
Assert.IsNull(u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual(str, u.Path);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
开发者ID:dev218,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs
示例10: testFileProtoWindows
public void testFileProtoWindows()
{
const string str = "file:///D:/m y";
var u = new URIish(str);
Assert.AreEqual("file", u.Scheme);
Assert.IsFalse(u.IsRemote);
Assert.AreEqual("D:/m y", u.Path);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
开发者ID:nestalk,项目名称:GitSharp,代码行数:10,代码来源:URIishTests.cs
示例11: TransportLocal
public TransportLocal(Repository local, URIish uri)
: base(local, uri)
{
string dir = FS.resolve(new DirectoryInfo(PWD), uri.Path).FullName;
if(Directory.Exists(Path.Combine(dir, Constants.DOT_GIT)))
{
dir = Path.Combine(dir, Constants.DOT_GIT);
}
remoteGitDir = new DirectoryInfo(dir);
}
开发者ID:yolanother,项目名称:GitSharp,代码行数:11,代码来源:TransportLocal.cs
示例12: testGitProtoUnix
public void testGitProtoUnix()
{
const string str = "git://example.com/home/m y";
var u = new URIish(str);
Assert.AreEqual("git", u.Scheme);
Assert.IsTrue(u.IsRemote);
Assert.AreEqual("example.com", u.Host);
Assert.AreEqual("/home/m y", u.Path);
Assert.AreEqual(str, u.ToString());
Assert.AreEqual(u, new URIish(str));
}
开发者ID:nestalk,项目名称:GitSharp,代码行数:11,代码来源:URIishTests.cs
示例13: canHandle
public static bool canHandle(URIish uri)
{
if (uri == null)
throw new ArgumentNullException ("uri");
if (!uri.IsRemote)
{
return false;
}
return S3_SCHEME == uri.Scheme;
}
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:TransportAmazonS3.cs
示例14: canHandle
public static bool canHandle(URIish uri)
{
if (uri == null)
throw new ArgumentNullException("uri");
if (!uri.IsRemote)
{
return false;
}
string s = uri.Scheme;
return "http".Equals(s) || "https".Equals(s) || "ftp".Equals(s);
}
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:TransportHttp.cs
示例15: canHandle
public static bool canHandle(URIish uri)
{
if (uri.Host != null || uri.Port > 0 || uri.User != null || uri.Pass != null || uri.Path == null)
{
return false;
}
if ("file".Equals(uri.Scheme) || uri.Scheme == null)
{
return FS.resolve(new DirectoryInfo(PWD), uri.Path).Exists;
}
return false;
}
开发者ID:jagregory,项目名称:GitSharp,代码行数:14,代码来源:TransportLocal.cs
示例16: CanHandle
public static bool CanHandle(URIish uri)
{
if (uri == null)
throw new ArgumentNullException ("uri");
if (uri.Host != null || uri.Port > 0 || uri.User != null || uri.Pass != null || uri.Path == null)
return false;
if ("file".Equals(uri.Scheme) || uri.Scheme == null)
{
FileInfo file = resolve(new DirectoryInfo("."), uri.Path);
return file.Name.EndsWith(".bundle");
}
return false;
}
开发者ID:stschake,项目名称:GitSharp,代码行数:15,代码来源:TransportBundleFile.cs
示例17: testAddURI
public void testAddURI()
{
readConfig(string.Empty);
URIish uri = new URIish("/some/dir");
RemoteConfig rc = new RemoteConfig(config, "backup");
Assert.AreEqual(0, rc.URIs.Count);
Assert.IsTrue(rc.AddURI(uri));
Assert.AreEqual(1, rc.URIs.Count);
Assert.AreSame(uri, rc.URIs[0]);
Assert.IsFalse(rc.AddURI(new URIish(uri.ToString())));
Assert.AreEqual(1, rc.URIs.Count);
}
开发者ID:georgeck,项目名称:GitSharp,代码行数:15,代码来源:RemoteConfigTests.cs
示例18: TransportHttp
public TransportHttp(Repository local, URIish uri)
: base(local, uri)
{
try
{
string uriString = uri.ToString();
if (!uriString.EndsWith("/"))
{
uriString += "/";
}
_baseUrl = new Uri(uriString);
_objectsUrl = new Uri(_baseUrl, "objects/");
}
catch (UriFormatException e)
{
throw new NotSupportedException("Invalid URL " + uri, e);
}
}
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:18,代码来源:TransportHttp.cs
示例19: printRefUpdateResult
private void printRefUpdateResult(URIish uri, OperationResult result, RemoteRefUpdate rru)
{
if (!shownUri)
{
shownUri = true;
OutputStream.WriteLine("To " + uri);
}
string remoteName = rru.RemoteName;
string srcRef = rru.IsDelete ? null : rru.SourceRef;
switch (rru.Status)
{
case RemoteRefUpdate.UpdateStatus.OK:
{
if (rru.IsDelete)
printUpdateLine('-', "[deleted]", null, remoteName, null);
else
{
GitSharp.Core.Ref oldRef = result.GetAdvertisedRef(remoteName);
if (oldRef == null)
{
string summary = remoteName.StartsWith(Constants.R_TAGS) ? "[new tag]" : "[new branch]";
printUpdateLine('*', summary, srcRef, remoteName, null);
}
else
{
bool fastForward = rru.FastForward;
char flag = fastForward ? ' ' : '+';
string summary = oldRef.ObjectId.Abbreviate(Repository._internal_repo).name() +
(fastForward ? ".." : "...") +
rru.NewObjectId.Abbreviate(Repository._internal_repo).name();
string message = fastForward ? null : "forced update";
printUpdateLine(flag, summary, srcRef, remoteName, message);
}
}
break;
}
case RemoteRefUpdate.UpdateStatus.NON_EXISTING:
printUpdateLine('X', "[no match]", null, remoteName, null);
break;
case RemoteRefUpdate.UpdateStatus.REJECTED_NODELETE:
printUpdateLine('!', "[rejected]", null, remoteName, "remote side does not support deleting refs");
break;
case RemoteRefUpdate.UpdateStatus.REJECTED_NONFASTFORWARD:
printUpdateLine('!', "[rejected]", srcRef, remoteName, "non-fast forward");
break;
case RemoteRefUpdate.UpdateStatus.REJECTED_REMOTE_CHANGED:
{
string message = "remote ref object changed - is not expected one " +
rru.ExpectedOldObjectId.Abbreviate(Repository._internal_repo).name();
printUpdateLine('!', "[rejected]", srcRef, remoteName, message);
break;
}
case RemoteRefUpdate.UpdateStatus.REJECTED_OTHER_REASON:
printUpdateLine('!', "[rejected]", srcRef, remoteName, rru.Message);
break;
case RemoteRefUpdate.UpdateStatus.UP_TO_DATE:
if (Verbose)
printUpdateLine('=', "[up to date]", srcRef, remoteName, null);
break;
case RemoteRefUpdate.UpdateStatus.NOT_ATTEMPTED:
case RemoteRefUpdate.UpdateStatus.AWAITING_REPORT:
printUpdateLine('?', "[unexpected push-process behavior]", srcRef, remoteName, rru.Message);
break;
}
}
开发者ID:dev218,项目名称:GitSharp,代码行数:74,代码来源:PushCommand.cs
示例20: printPushResult
private void printPushResult(URIish uri, PushResult result)
{
shownUri = false;
bool everythingUpToDate = true;
foreach (RemoteRefUpdate rru in result.RemoteUpdates)
{
if (rru.Status == RemoteRefUpdate.UpdateStatus.UP_TO_DATE)
{
if (Verbose)
printRefUpdateResult(uri, result, rru);
}
else
{
everythingUpToDate = false;
}
}
foreach (RemoteRefUpdate rru in result.RemoteUpdates)
{
if (rru.Status == RemoteRefUpdate.UpdateStatus.OK)
printRefUpdateResult(uri, result, rru);
}
foreach (RemoteRefUpdate rru in result.RemoteUpdates)
{
if (rru.Status != RemoteRefUpdate.UpdateStatus.OK && rru.Status != RemoteRefUpdate.UpdateStatus.UP_TO_DATE)
printRefUpdateResult(uri, result, rru);
}
if (everythingUpToDate)
OutputStream.WriteLine("Everything up-to-date");
}
开发者ID:dev218,项目名称:GitSharp,代码行数:33,代码来源:PushCommand.cs
注:本文中的GitSharp.Core.Transport.URIish类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论