public bool DoCommit() { bool bRes = true; SharpSvn.SvnCommitArgs cargs = new SharpSvn.SvnCommitArgs(); cargs.KeepLocks = true; SharpSvn.SvnCommitResult cres; List <string> paths = new List <string>(); foreach (KeyValuePair <String, Dictionary <string, Boolean> > element in lpath) { paths.Clear(); cargs.LogMessage = ap.AmendNo.ToString() + "-" + lver[element.Key] + "-V" + Version; log.WriteLog(cargs.LogMessage + " " + element.Key); foreach (KeyValuePair <string, Boolean> le in element.Value) { if (le.Value == false) { continue; } paths.Add(le.Key); log.WriteLog(le.Key); } if (paths.Count == 0) { log.WriteLog("无选中递交项!" + element.Key); continue; } try { bRes = sclient.Commit(paths, cargs, out cres); if (!bRes) { log.WriteLog("递交失败! " + cres.PostCommitError); } else { log.WriteLog("递交成功! " + cres.Revision.ToString()); } } catch (Exception ex) { MAConf.instance.WriteLog("获取状态失败" + ex.Message, LogLevel.Error); } } return(bRes); }
public void Execute(string workingCopyBase, Entities.Branch branch, string logMessage) { Dictionary<string, string> settings = settingsBLL.Get(); string userName = SettingsHelper.ValidateUsername(settings); string password = SettingsHelper.ValidatePassword(settings); string workingCopyPath = branch.Path(workingCopyBase); using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default()) { client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password); SharpSvn.SvnCommitArgs args = new SharpSvn.SvnCommitArgs(); args.LogMessage = logMessage; client.Commit(workingCopyPath, args); } }
public bool DoCommit() { bool bRes = true; SharpSvn.SvnCommitArgs cargs = new SharpSvn.SvnCommitArgs(); cargs.KeepLocks = true; SharpSvn.SvnCommitResult cres; List<string> paths = new List<string>(); foreach (KeyValuePair<String, Dictionary<string, Boolean>> element in lpath) { paths.Clear(); cargs.LogMessage = ap.AmendNo.ToString() + "-" + lver[element.Key] + "-V" + Version; log.WriteLog(cargs.LogMessage + " " + element.Key); foreach (KeyValuePair<string, Boolean> le in element.Value) { if (le.Value == false) continue; paths.Add(le.Key); log.WriteLog(le.Key); } if (paths.Count == 0) { log.WriteLog("无选中递交项!" + element.Key); continue; } try { bRes = sclient.Commit(paths, cargs, out cres); if (!bRes) { log.WriteLog("递交失败! " + cres.PostCommitError); } else { log.WriteLog("递交成功! " + cres.Revision.ToString()); } } catch (Exception ex) { MAConf.instance.WriteLog("获取状态失败" + ex.Message, LogLevel.Error); } } return bRes; }