
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.75 KB | hits: 25 | expires: Never
SharpSvn Local File Rename Commit
private string SvnRepository = "http://svnserver/svn/repo/trunk/";
public void Start() {
System.IO.File.Move("c:\LocalSvn\1.txt", "c:\LocalSvn\2.txt");
SvnRename("c:\LocalSvn\1.txt", "c:\LocalSvn\2.txt");
}
private Uri RelativePath(string sFullPath) {
return new Uri(SvnRepository + sFullPath.Replace(Path, "").Replace('\', '/').Substring(1));
}
public void SvnRename(string sPath, string sOldPath) {
using (SvnClient cl = new SvnClient()) {
Uri UriFrom = RelativePath(sOldPath);
Uri UriTo = RelativePath(sPath);
cl.RemoteMove(UriFrom,UriTo
, new SvnMoveArgs { LogMessage = "Rename From:" + sOldPath + " To:"
+ sPath });
//Local
}
}