static string GetActionString(SvnNotifyAction action) { switch (action) { case SvnNotifyAction.Add: case SvnNotifyAction.CommitAdded: return("added"); case SvnNotifyAction.Copy: return("copied"); case SvnNotifyAction.Delete: case SvnNotifyAction.UpdateDelete: case SvnNotifyAction.CommitDeleted: return("deleted"); case SvnNotifyAction.Restore: return("restored"); case SvnNotifyAction.Revert: return("reverted"); case SvnNotifyAction.RevertFailed: return("revert failed"); case SvnNotifyAction.Resolved: return("resolved"); case SvnNotifyAction.Skip: return("skipped"); case SvnNotifyAction.UpdateUpdate: return("updated"); case SvnNotifyAction.UpdateExternal: return("updated external"); case SvnNotifyAction.CommitModified: return("modified"); case SvnNotifyAction.CommitReplaced: return("replaced"); case SvnNotifyAction.LockFailedLock: return("lock failed"); case SvnNotifyAction.LockFailedUnlock: return("unlock failed"); case SvnNotifyAction.LockLocked: return("locked"); case SvnNotifyAction.LockUnlocked: return("unlocked"); default: return("unknown"); } }
string GetActionText(SvnNotifyAction action) { string actionText = action.ToString(); switch (action) { case SvnNotifyAction.UpdateAdd: case SvnNotifyAction.UpdateDelete: case SvnNotifyAction.UpdateReplace: case SvnNotifyAction.UpdateUpdate: case SvnNotifyAction.UpdateCompleted: case SvnNotifyAction.UpdateExternal: case SvnNotifyAction.UpdateSkipWorkingOnly: case SvnNotifyAction.UpdateSkipObstruction: case SvnNotifyAction.UpdateSkipAccessDenied: case SvnNotifyAction.UpdateShadowedAdd: case SvnNotifyAction.UpdateShadowedDelete: case SvnNotifyAction.UpdateShadowedUpdate: case SvnNotifyAction.UpdateExternalRemoved: case SvnNotifyAction.UpdateBrokenLock: actionText = actionText.Substring(6); break; case SvnNotifyAction.UpgradedDirectory: actionText = "Upgraded"; break; case SvnNotifyAction.CommitAdded: case SvnNotifyAction.CommitDeleted: case SvnNotifyAction.CommitModified: case SvnNotifyAction.CommitReplaced: case SvnNotifyAction.CommitAddCopy: case SvnNotifyAction.CommitReplacedWithCopy: case SvnNotifyAction.CommitFinalizing: actionText = actionText.Substring(6); break; case SvnNotifyAction.CommitSendData: actionText = "Sending"; break; case SvnNotifyAction.BlameRevision: actionText = "Annotating"; break; case SvnNotifyAction.UpdateStarted: case SvnNotifyAction.RecordMergeInfoStarted: case SvnNotifyAction.FollowUrlRedirect: case SvnNotifyAction.OperationRequiresTarget: actionText = null; break; } return(actionText); }
static string GetActionString(SvnNotifyAction action) { switch (action) { case SvnNotifyAction.Add: case SvnNotifyAction.CommitAdded: return "added"; case SvnNotifyAction.Copy: return "copied"; case SvnNotifyAction.Delete: case SvnNotifyAction.UpdateDelete: case SvnNotifyAction.CommitDeleted: return "deleted"; case SvnNotifyAction.Restore: return "restored"; case SvnNotifyAction.Revert: return "reverted"; case SvnNotifyAction.RevertFailed: return "revert failed"; case SvnNotifyAction.Resolved: return "resolved"; case SvnNotifyAction.Skip: return "skipped"; case SvnNotifyAction.UpdateUpdate: return "updated"; case SvnNotifyAction.UpdateExternal: return "updated external"; case SvnNotifyAction.CommitModified: return "modified"; case SvnNotifyAction.CommitReplaced: return "replaced"; case SvnNotifyAction.LockFailedLock: return "lock failed"; case SvnNotifyAction.LockFailedUnlock: return "unlock failed"; case SvnNotifyAction.LockLocked: return "locked"; case SvnNotifyAction.LockUnlocked: return "unlocked"; default: return "unknown"; } }
public string getstringact(SvnNotifyAction act) { string result = null; switch (act) { case SvnNotifyAction.Add: result = "添加"; break; case SvnNotifyAction.BlameRevision: break; case SvnNotifyAction.ChangeListClear: break; case SvnNotifyAction.ChangeListMoved: break; case SvnNotifyAction.ChangeListSet: break; case SvnNotifyAction.CommitAddCopy: result = "提交添加副本"; break; case SvnNotifyAction.CommitAdded: break; case SvnNotifyAction.CommitDeleted: break; case SvnNotifyAction.CommitModified: break; case SvnNotifyAction.CommitReplaced: break; case SvnNotifyAction.CommitReplacedWithCopy: break; case SvnNotifyAction.CommitSendData: break; case SvnNotifyAction.Copy: break; case SvnNotifyAction.Delete: break; case SvnNotifyAction.Excluded: result = "要排除"; break; case SvnNotifyAction.Exists: result = "已存在"; break; case SvnNotifyAction.ExternalFailed: result = "外部失败"; break; case SvnNotifyAction.FailedConflict: result = "失败冲突"; break; case SvnNotifyAction.FailedForbiddenByServer: break; case SvnNotifyAction.FailedLocked: break; case SvnNotifyAction.FailedMissing: break; case SvnNotifyAction.FailedNoParent: break; case SvnNotifyAction.FailedOutOfDate: result = "已过期且失败"; break; case SvnNotifyAction.FollowUrlRedirect: break; case SvnNotifyAction.LockFailedLock: break; case SvnNotifyAction.LockFailedUnlock: break; case SvnNotifyAction.LockLocked: break; case SvnNotifyAction.LockUnlocked: break; case SvnNotifyAction.MergeBegin: break; case SvnNotifyAction.MergeBeginForeign: break; case SvnNotifyAction.MergeCompleted: break; case SvnNotifyAction.NonExistentPath: break; case SvnNotifyAction.PatchApplied: break; case SvnNotifyAction.PatchAppliedHunk: break; case SvnNotifyAction.PatchFoundAlreadyApplied: break; case SvnNotifyAction.PatchRejectedHunk: break; case SvnNotifyAction.PropertyAdded: break; case SvnNotifyAction.PropertyDeleted: break; case SvnNotifyAction.PropertyDeletedNonExistent: break; case SvnNotifyAction.PropertyModified: break; case SvnNotifyAction.RecordMergeInfo: break; case SvnNotifyAction.RecordMergeInfoElided: break; case SvnNotifyAction.RecordMergeInfoStarted: break; case SvnNotifyAction.Resolved: break; case SvnNotifyAction.Restore: result = "恢复"; break; case SvnNotifyAction.Revert: result = "还原"; break; case SvnNotifyAction.RevertFailed: result = "还原失败"; break; case SvnNotifyAction.RevisionPropertyDeleted: break; case SvnNotifyAction.RevisionPropertySet: break; case SvnNotifyAction.Skip: result = "跳过"; break; case SvnNotifyAction.SkipConflicted: result = "跳过冲突"; break; case SvnNotifyAction.StatusCompleted: result = "状态已完成"; break; case SvnNotifyAction.StatusExternal: break; case SvnNotifyAction.TreeConflict: result = "数冲突"; break; case SvnNotifyAction.UpdateAdd: result = "更新新增"; break; case SvnNotifyAction.UpdateCompleted: result = "更新已完成"; break; case SvnNotifyAction.UpdateDelete: result = "更新删除"; break; case SvnNotifyAction.UpdateExternal: result = "更新外部"; break; case SvnNotifyAction.UpdateExternalRemoved: result = "更新外部已删除"; break; case SvnNotifyAction.UpdateReplace: result = "更新替换"; break; case SvnNotifyAction.UpdateShadowedAdd: break; case SvnNotifyAction.UpdateShadowedDelete: break; case SvnNotifyAction.UpdateShadowedUpdate: break; case SvnNotifyAction.UpdateSkipAccessDenied: break; case SvnNotifyAction.UpdateSkipObstruction: break; case SvnNotifyAction.UpdateSkipWorkingOnly: break; case SvnNotifyAction.UpdateStarted: result = "更新已开始"; break; case SvnNotifyAction.UpdateUpdate: result = "更新修改"; break; case SvnNotifyAction.UpgradedDirectory: result = "更新目录"; break; } return result ?? (result = act.ToString()); }
/// <summary> /// 获取svn的中文通知方式 /// </summary> /// <param name="act"></param> /// <returns></returns> public string GetNotifyAction(SvnNotifyAction act) { string result = null; switch (act) { case SvnNotifyAction.Add: result = "添加"; break; case SvnNotifyAction.BlameRevision: break; case SvnNotifyAction.ChangeListClear: break; case SvnNotifyAction.ChangeListMoved: break; case SvnNotifyAction.ChangeListSet: break; case SvnNotifyAction.CommitAddCopy: result = "提交添加副本"; break; case SvnNotifyAction.CommitAdded: break; case SvnNotifyAction.CommitDeleted: break; case SvnNotifyAction.CommitModified: break; case SvnNotifyAction.CommitReplaced: break; case SvnNotifyAction.CommitReplacedWithCopy: break; case SvnNotifyAction.CommitSendData: break; case SvnNotifyAction.Copy: break; case SvnNotifyAction.Delete: break; case SvnNotifyAction.Excluded: result = "要排除"; break; case SvnNotifyAction.Exists: result = "已存在"; break; case SvnNotifyAction.ExternalFailed: result = "外部失败"; break; case SvnNotifyAction.FailedConflict: result = "失败冲突"; break; case SvnNotifyAction.FailedForbiddenByServer: break; case SvnNotifyAction.FailedLocked: break; case SvnNotifyAction.FailedMissing: break; case SvnNotifyAction.FailedNoParent: break; case SvnNotifyAction.FailedOutOfDate: result = "已过期且失败"; break; case SvnNotifyAction.FollowUrlRedirect: break; case SvnNotifyAction.LockFailedLock: break; case SvnNotifyAction.LockFailedUnlock: break; case SvnNotifyAction.LockLocked: break; case SvnNotifyAction.LockUnlocked: break; case SvnNotifyAction.MergeBegin: break; case SvnNotifyAction.MergeBeginForeign: break; case SvnNotifyAction.MergeCompleted: break; case SvnNotifyAction.NonExistentPath: break; case SvnNotifyAction.PatchApplied: break; case SvnNotifyAction.PatchAppliedHunk: break; case SvnNotifyAction.PatchFoundAlreadyApplied: break; case SvnNotifyAction.PatchRejectedHunk: break; case SvnNotifyAction.PropertyAdded: break; case SvnNotifyAction.PropertyDeleted: break; case SvnNotifyAction.PropertyDeletedNonExistent: break; case SvnNotifyAction.PropertyModified: break; case SvnNotifyAction.RecordMergeInfo: break; case SvnNotifyAction.RecordMergeInfoElided: break; case SvnNotifyAction.RecordMergeInfoStarted: break; case SvnNotifyAction.Resolved: break; case SvnNotifyAction.Restore: result = "恢复"; break; case SvnNotifyAction.Revert: result = "还原"; break; case SvnNotifyAction.RevertFailed: result = "还原失败"; break; case SvnNotifyAction.RevisionPropertyDeleted: break; case SvnNotifyAction.RevisionPropertySet: break; case SvnNotifyAction.Skip: result = "跳过"; break; case SvnNotifyAction.SkipConflicted: result = "跳过冲突"; break; case SvnNotifyAction.StatusCompleted: result = "状态已完成"; break; case SvnNotifyAction.StatusExternal: break; case SvnNotifyAction.TreeConflict: result = "数冲突"; break; case SvnNotifyAction.UpdateAdd: result = "新增"; break; case SvnNotifyAction.UpdateCompleted: result = "更新已完成"; break; case SvnNotifyAction.UpdateDelete: result = "删除"; break; case SvnNotifyAction.UpdateExternal: result = "更新外部"; break; case SvnNotifyAction.UpdateExternalRemoved: result = "更新外部已删除"; break; case SvnNotifyAction.UpdateReplace: result = "替换"; break; case SvnNotifyAction.UpdateShadowedAdd: break; case SvnNotifyAction.UpdateShadowedDelete: break; case SvnNotifyAction.UpdateShadowedUpdate: break; case SvnNotifyAction.UpdateSkipAccessDenied: break; case SvnNotifyAction.UpdateSkipObstruction: break; case SvnNotifyAction.UpdateSkipWorkingOnly: break; case SvnNotifyAction.UpdateStarted: result = "更新已开始"; break; case SvnNotifyAction.UpdateUpdate: result = "修改"; break; case SvnNotifyAction.UpgradedDirectory: result = "更新目录"; break; } return(result ?? (act.ToString())); }
string GetActionText(SvnNotifyAction action) { string actionText = action.ToString(); switch (action) { case SvnNotifyAction.UpdateAdd: case SvnNotifyAction.UpdateDelete: case SvnNotifyAction.UpdateReplace: case SvnNotifyAction.UpdateUpdate: case SvnNotifyAction.UpdateCompleted: case SvnNotifyAction.UpdateExternal: actionText = actionText.Substring(6); break; case SvnNotifyAction.CommitAdded: case SvnNotifyAction.CommitDeleted: case SvnNotifyAction.CommitModified: case SvnNotifyAction.CommitReplaced: actionText = actionText.Substring(6); break; case SvnNotifyAction.CommitSendData: actionText = "Sending"; break; case SvnNotifyAction.BlameRevision: actionText = "Annotating"; break; } return actionText; }
public void OnClientNotify(object sender, SvnNotifyEventArgs e) { //e.Detach(); string path = e.FullPath; Uri uri = e.Uri; SvnNotifyAction action = e.Action; long rev = e.Revision; Enqueue(delegate() { ListViewItem item = null; string text = GetActionText(action); if (string.IsNullOrEmpty(text)) { return; } item = new ListViewItem(text); switch (action) { case SvnNotifyAction.BlameRevision: { string file; if (uri != null) { file = SvnTools.GetFileName(uri); } else { file = Path.GetFileName(path); } item.SubItems.Add(string.Format("{0} - r{1}", file, rev)); break; } default: if (uri != null) { item.SubItems.Add(uri.ToString()); } else if (!string.IsNullOrEmpty(path)) { string sr = SplitRoot; if (!string.IsNullOrEmpty(sr) && SvnItem.IsBelowRoot(path, sr)) { string np = SvnItem.SubPath(path, sr, true); if (np.IndexOf(':') == 1) { path = np; // Full path } else { path = np.Replace(Path.DirectorySeparatorChar, '/'); } } item.SubItems.Add(path); } break; } if (item != null) { _toAdd.Add(item); } }); }