本文整理汇总了C#中SvnClient.RemoteCopy方法的典型用法代码示例。如果您正苦于以下问题:C# SvnClient.RemoteCopy方法的具体用法?C# SvnClient.RemoteCopy怎么用?C# SvnClient.RemoteCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SvnClient
的用法示例。
在下文中一共展示了SvnClient.RemoteCopy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteSVNTask
protected override void ExecuteSVNTask(SvnClient client)
{
if (Dir == null)
{
Dir = new DirectoryInfo(Project.BaseDirectory);
}
if (!Dir.Exists)
{
throw new BuildException(string.Format(Resources.MissingDirectory, Dir.FullName), Location);
}
SVNFunctions svnFunctions = new SVNFunctions(Project, Properties);
string sourceUri = svnFunctions.GetUriFromPath(Dir.FullName);
Log(Level.Info, Resources.SVNCopyCopying, sourceUri, SvnUri);
SvnCopyArgs args = new SvnCopyArgs();
args.ThrowOnError = true;
args.LogMessage = Message;
SvnCommitResult result;
client.RemoteCopy(SvnTarget.FromString(sourceUri), SvnUri, args, out result);
if (result != null)
{
Log(Level.Info, Resources.SVNCopyResult, Dir.FullName, SvnUri, result.Revision, result.Author);
}
}
示例2: createSVNTag
private static void createSVNTag(SvnClient client, SvnUriTarget source)
{
ConsoleLogStartAction(Resources.UILogging.CreateSvnTag);
Console.WriteLine(Resources.Questions.SVNDestination);
var uriDestination = Console.ReadLine();
var destination = new Uri(uriDestination);
client.RemoteCopy(source, destination);
ConsoleEndAction();
}
示例3: CreateBranch
static public void CreateBranch(Uri fromUri, Uri toUri)
{
using (SvnClient svnClient = new SvnClient())
{
try
{
SvnTarget target = SvnTarget.FromUri(fromUri);
SvnUriTarget targetBranch = new SvnUriTarget(toUri);
SvnCopyArgs args = new SvnCopyArgs();
args.LogMessage = Properties.Settings.Default.SVN_Commit_Msg;
svnClient.RemoteCopy(target, toUri, args);
}
catch (Exception ex)
{
LogMessage(ex.Message);
}
}
}
示例4: ChangedDirs
public void ChangedDirs()
{
SvnSandBox sbox = new SvnSandBox(this);
Uri uri = sbox.CreateRepository(SandBoxRepository.Empty);
using (InstallHook(uri, SvnHookType.PreCommit, OnChangedDirs))
{
using (SvnClient cl = new SvnClient())
{
SvnCreateDirectoryArgs da = new SvnCreateDirectoryArgs();
da.CreateParents = true;
da.LogMessage = "Created!";
cl.RemoteCreateDirectories(
new Uri[]
{
new Uri(uri, "a/b/c/d/e/f"),
new Uri(uri, "a/b/c/d/g/h"),
new Uri(uri, "i/j/k"),
new Uri(uri, "l/m/n"),
new Uri(uri, "l/m/n/o/p")
}, da);
}
}
using (InstallHook(uri, SvnHookType.PreCommit, OnCopyDir))
{
using (SvnClient cl = new SvnClient())
{
SvnCopyArgs ca = new SvnCopyArgs();
ca.CreateParents = true;
ca.LogMessage = "Created!";
cl.RemoteCopy(
new SvnUriTarget[]
{
new Uri(uri, "a/b/c/d"),
new Uri(uri, "i/j")
}, uri, ca);
}
}
}
示例5: Tag
public void Tag(string name, string taggerName, string taggerEmail, string comment, DateTime localTime, string taggedPath)
{
/*
TempFile commentFile;
var args = "tag";
AddComment(comment, ref args, out commentFile);
// tag names are not quoted because they cannot contain whitespace or quotes
args += " -- " + name;
using (commentFile)
{
var startInfo = GetStartInfo(args);
startInfo.EnvironmentVariables["GIT_COMMITTER_NAME"] = taggerName;
startInfo.EnvironmentVariables["GIT_COMMITTER_EMAIL"] = taggerEmail;
startInfo.EnvironmentVariables["GIT_COMMITTER_DATE"] = GetUtcTimeString(localTime);
ExecuteUnless(startInfo, null);
}
*/
using (var client = new SvnClient())
{
SvnUI.Bind(client, parentWindow);
var svnCopyArgs = new SvnCopyArgs { LogMessage = comment, CreateParents = true, AlwaysCopyAsChild = false };
var workingCopyUri = client.GetUriFromWorkingCopy(workingCopyPath);
var tagsUri = client.GetUriFromWorkingCopy(tagPath);
var sourceUri = useSvnStandardDirStructure ? client.GetUriFromWorkingCopy(trunkPath) : workingCopyUri;
var tagUri = new Uri(useSvnStandardDirStructure ? tagsUri : workingCopyUri, name);
var svnCommitResult = (SvnCommitResult)null;
var result = client.RemoteCopy(sourceUri, tagUri, svnCopyArgs, out svnCommitResult);
if (result)
{
result &= client.SetRevisionProperty(svnCommitResult.RepositoryRoot, new SvnRevision(svnCommitResult.Revision), SvnPropertyNames.SvnAuthor, taggerName);
result &= client.SetRevisionProperty(svnCommitResult.RepositoryRoot, new SvnRevision(svnCommitResult.Revision), SvnPropertyNames.SvnDate, SvnPropertyNames.FormatDate(localTime));
}
result &= client.Update(workingCopyPath, new SvnUpdateArgs { AddsAsModifications = false, AllowObstructions = false, Depth = SvnDepth.Infinity, IgnoreExternals = true, KeepDepth = true, Revision = SvnRevision.Head, UpdateParents = false });
}
}