StackPanel ITreeViewItem.Header() { string ImageFile; if (IsGingerDefualtFolder) { ImageFile = "@Documents_16x16.png"; } else { ImageFile = "@Folder2_16x16.png"; } return(TreeViewUtils.CreateItemHeader(Name, ImageFile, SourceControlIntegration.GetItemSourceControlImage(Path, ref ItemSourceControlStatus))); }
private static void HandleSolutionLoadSourceControl(Solution solution) { string RepositoryRootFolder = string.Empty; SourceControlBase.eSourceControlType type = SourceControlIntegration.CheckForSolutionSourceControlType(solution.Folder, ref RepositoryRootFolder); if (type == SourceControlBase.eSourceControlType.GIT) { solution.SourceControl = new GITSourceControl(); } else if (type == SourceControlBase.eSourceControlType.SVN) { solution.SourceControl = new SVNSourceControl(); } if (solution.SourceControl != null) { if (string.IsNullOrEmpty(WorkSpace.Instance.UserProfile.SolutionSourceControlUser) || string.IsNullOrEmpty(WorkSpace.Instance.UserProfile.SolutionSourceControlPass)) { if (WorkSpace.Instance.UserProfile.SourceControlUser != null && WorkSpace.Instance.UserProfile.SourceControlPass != null) { solution.SourceControl.SourceControlUser = WorkSpace.Instance.UserProfile.SourceControlUser; solution.SourceControl.SourceControlPass = WorkSpace.Instance.UserProfile.SourceControlPass; solution.SourceControl.SolutionSourceControlAuthorEmail = WorkSpace.Instance.UserProfile.SolutionSourceControlAuthorEmail; solution.SourceControl.SolutionSourceControlAuthorName = WorkSpace.Instance.UserProfile.SolutionSourceControlAuthorName; } } else { solution.SourceControl.SourceControlUser = WorkSpace.Instance.UserProfile.SolutionSourceControlUser; solution.SourceControl.SourceControlPass = WorkSpace.Instance.UserProfile.SolutionSourceControlPass; solution.SourceControl.SolutionSourceControlAuthorEmail = WorkSpace.Instance.UserProfile.SolutionSourceControlAuthorEmail; solution.SourceControl.SolutionSourceControlAuthorName = WorkSpace.Instance.UserProfile.SolutionSourceControlAuthorName; } string error = string.Empty; solution.SourceControl.SolutionFolder = solution.Folder; solution.SourceControl.RepositoryRootFolder = RepositoryRootFolder; solution.SourceControl.SourceControlURL = solution.SourceControl.GetRepositoryURL(ref error); solution.SourceControl.SourceControlLocalFolder = WorkSpace.Instance.UserProfile.SourceControlLocalFolder; solution.SourceControl.SourceControlProxyAddress = WorkSpace.Instance.UserProfile.SolutionSourceControlProxyAddress; solution.SourceControl.SourceControlProxyPort = WorkSpace.Instance.UserProfile.SolutionSourceControlProxyPort; solution.SourceControl.SourceControlTimeout = WorkSpace.Instance.UserProfile.SolutionSourceControlTimeout; WorkSpace.Instance.SourceControl = solution.SourceControl; RepositoryItemBase.SetSourceControl(solution.SourceControl); RepositoryFolderBase.SetSourceControl(solution.SourceControl); } }
public void SetSolutionSourceControl(Solution solution, ref string repositoryRootFolder) { SourceControlBase.eSourceControlType type = SourceControlIntegration.CheckForSolutionSourceControlType(solution.Folder, ref repositoryRootFolder); if (type == SourceControlBase.eSourceControlType.GIT) { solution.SourceControl = new GITSourceControl(); } else if (type == SourceControlBase.eSourceControlType.SVN) { // FIXME after SVN moved to .net core // solution.SourceControl = new SVNSourceControl(); Reporter.ToLog(eLogLevel.ERROR, "Source Control of type SVN is not yet supported in GingerConsole"); } }
private void SourceControlLock(object sender, RoutedEventArgs e) { RepositoryItemBase RI = ((ITreeViewItem)this).NodeObject() as RepositoryItemBase; if (RI != null && (RI.SourceControlStatus == eImageType.SourceControlLockedByMe || RI.SourceControlStatus == eImageType.SourceControlLockedByAnotherUser)) { Reporter.ToUser(eUserMsgKey.SourceControlItemAlreadyLocked); return; } string lockComment = string.Empty; if (GingerCore.General.GetInputWithValidation("Lock", "Lock Comment:", ref lockComment)) { SourceControlIntegration.Lock(WorkSpace.Instance.Solution.SourceControl, this.NodePath(), lockComment); mTreeView.Tree.RefreshHeader((ITreeViewItem)this); } }
public void SourceControlGetLatestVersion(object sender, System.Windows.RoutedEventArgs e) { if (Reporter.ToUser(eUserMsgKey.LoseChangesWarn) == Amdocs.Ginger.Common.eUserMsgSelection.No) { return; } Reporter.ToStatus(eStatusMsgKey.GetLatestFromSourceControl); if (string.IsNullOrEmpty(this.NodePath())) { Reporter.ToUser(eUserMsgKey.SourceControlUpdateFailed, "Invalid Path provided"); } else { SourceControlIntegration.GetLatest(this.NodePath(), WorkSpace.Instance.Solution.SourceControl); } Reporter.HideStatusMessage(); }
public void SetSolutionSourceControl(Solution solution, ref string repositoryRootFolder) { SourceControlBase.eSourceControlType type = SourceControlIntegration.CheckForSolutionSourceControlType(solution.Folder, ref repositoryRootFolder); if (type == SourceControlBase.eSourceControlType.GIT) { if ((WorkSpace.Instance != null && WorkSpace.Instance.UserProfile != null && WorkSpace.Instance.UserProfile.SourceControlUseShellClient) || !RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { solution.SourceControl = new GitSourceControlShellWrapper(); } else { solution.SourceControl = new GITSourceControl(); } } else if (type == SourceControlBase.eSourceControlType.SVN) { solution.SourceControl = new SVNSourceControlShellWrapper(); } }
private void DownloadSolutionFromSourceControl() { if (SourceControlURL != null && SourcecontrolUser != "" && sourceControlPass != null) { Reporter.ToLog(eLogLevel.DEBUG, "Downloading Solution from source control"); if (SourceControlURL.IndexOf(".git") != -1) { // App.DownloadSolution(value.Substring(0, value.IndexOf(".git") + 4)); SourceControlIntegration.DownloadSolution(Solution); } else { // App.DownloadSolution(value); //RepositoryItemHelper.RepositoryItemFactory.DownloadSolution(SourceControlURL); SourceControlIntegration.DownloadSolution(Solution); } } }
public void SourceControlGetLatestVersion(object sender, System.Windows.RoutedEventArgs e) { if (Reporter.ToUser(eUserMsgKeys.LoseChangesWarn) == MessageBoxResult.No) { return; } Reporter.ToGingerHelper(eGingerHelperMsgKey.GetLatestFromSourceControl); if (string.IsNullOrEmpty(this.NodePath())) { Reporter.ToUser(eUserMsgKeys.SourceControlUpdateFailed, "Invalid Path provided"); } else { SourceControlIntegration.GetLatest(this.NodePath(), App.UserProfile.Solution.SourceControl); } mTreeView.Tree.RefreshSelectedTreeNodeParent(); Reporter.CloseGingerHelper(); }
private void btnSourceControlGetLatest_Click(object sender, RoutedEventArgs e) { if (Reporter.ToUser(eUserMsgKey.LoseChangesWarn) == Amdocs.Ginger.Common.eUserMsgSelection.No) { return; } Reporter.ToStatus(eStatusMsgKey.GetLatestFromSourceControl); if (string.IsNullOrEmpty(WorkSpace.Instance.Solution.Folder)) { Reporter.ToUser(eUserMsgKey.SourceControlUpdateFailed, "Invalid Path provided"); } else { SourceControlIntegration.GetLatest(WorkSpace.Instance.Solution.Folder, WorkSpace.Instance.Solution.SourceControl); } App.OnAutomateBusinessFlowEvent(AutomateEventArgs.eEventType.UpdateAppAgentsMapping, null); Reporter.HideStatusMessage(); }
private void btnSourceControlGetLatest_Click(object sender, RoutedEventArgs e) { if (Reporter.ToUser(eUserMsgKey.LoseChangesWarn) == Amdocs.Ginger.Common.eUserMsgSelection.No) { return; } AutoLogProxy.UserOperationStart("btnSourceControlGetLatest_Click"); Reporter.ToStatus(eStatusMsgKey.GetLatestFromSourceControl); if (string.IsNullOrEmpty(WorkSpace.UserProfile.Solution.Folder)) { Reporter.ToUser(eUserMsgKey.SourceControlUpdateFailed, "Invalid Path provided"); } else { SourceControlIntegration.GetLatest(WorkSpace.UserProfile.Solution.Folder, WorkSpace.UserProfile.Solution.SourceControl); } App.UpdateApplicationsAgentsMapping(false); Reporter.HideStatusMessage(); AutoLogProxy.UserOperationEnd(); }
private void btnSourceControlGetLatest_Click(object sender, RoutedEventArgs e) { if (Reporter.ToUser(eUserMsgKeys.LoseChangesWarn) == MessageBoxResult.No) { return; } AutoLogProxy.UserOperationStart("btnSourceControlGetLatest_Click"); Reporter.ToGingerHelper(eGingerHelperMsgKey.GetLatestFromSourceControl); if (string.IsNullOrEmpty(App.UserProfile.Solution.Folder)) { Reporter.ToUser(eUserMsgKeys.SourceControlUpdateFailed, "Invalid Path provided"); } else { SourceControlIntegration.GetLatest(App.UserProfile.Solution.Folder, App.UserProfile.Solution.SourceControl); } App.UpdateApplicationsAgentsMapping(false); Reporter.CloseGingerHelper(); AutoLogProxy.UserOperationEnd(); }
private eImageType GetSourceControlImageByPath(string path) { return(SourceControlIntegration.GetFileImage(path)); }
private void SourceControlUnlock(object sender, RoutedEventArgs e) { SourceControlIntegration.UnLock(App.UserProfile.Solution.SourceControl, this.NodePath()); mTreeView.Tree.RefreshHeader((ITreeViewItem)this); }
private void SourceControlGetInfo(object sender, RoutedEventArgs e) { SourceControlItemInfoDetails SCIID = SourceControlIntegration.GetInfo(App.UserProfile.Solution.SourceControl, this.NodePath()); SourceControlItemInfoPage SCIIP = new SourceControlItemInfoPage(SCIID); SCIIP.ShowAsWindow(); }
private void ResolveSourceControlConflicts(eResolveConflictsSide side) { Reporter.ToStatus(eStatusMsgKey.ResolveSourceControlConflicts); SourceControlIntegration.ResolveConflicts(WorkSpace.Instance.Solution.SourceControl, WorkSpace.Instance.Solution.Folder, side); Reporter.HideStatusMessage(); }
public void DownloadSolution(string SolutionFolder) { SourceControlBase mSourceControl; if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.GIT) { mSourceControl = new GITSourceControl(); } else if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.SVN) { mSourceControl = new SVNSourceControl(); } else { mSourceControl = new SVNSourceControl(); } if (mSourceControl != null) { WorkSpace.Instance.UserProfile.SourceControlType = mSourceControl.GetSourceControlType; mSourceControl.SourceControlURL = WorkSpace.Instance.UserProfile.SourceControlURL; mSourceControl.SourceControlUser = WorkSpace.Instance.UserProfile.SourceControlUser; mSourceControl.SourceControlPass = WorkSpace.Instance.UserProfile.SourceControlPass; mSourceControl.SourceControlLocalFolder = WorkSpace.Instance.UserProfile.SourceControlLocalFolder; mSourceControl.SolutionFolder = SolutionFolder; mSourceControl.SourceControlConfigureProxy = WorkSpace.Instance.UserProfile.SolutionSourceControlConfigureProxy; mSourceControl.SourceControlProxyAddress = WorkSpace.Instance.UserProfile.SolutionSourceControlProxyAddress; mSourceControl.SourceControlProxyPort = WorkSpace.Instance.UserProfile.SolutionSourceControlProxyPort; mSourceControl.SourceControlTimeout = WorkSpace.Instance.UserProfile.SolutionSourceControlTimeout; mSourceControl.supressMessage = true; } if (WorkSpace.Instance.UserProfile.SourceControlLocalFolder == string.Empty) { Reporter.ToUser(eUserMsgKey.SourceControlConnMissingLocalFolderInput); } if (SolutionFolder.EndsWith("\\")) { SolutionFolder = SolutionFolder.Substring(0, SolutionFolder.Length - 1); } SolutionInfo sol = new SolutionInfo(); sol.LocalFolder = SolutionFolder; if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.SVN && Directory.Exists(PathHelper.GetLongPath(sol.LocalFolder))) { sol.ExistInLocaly = true; } else if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.GIT && Directory.Exists(PathHelper.GetLongPath(sol.LocalFolder + @"\.git"))) { sol.ExistInLocaly = true; } else { sol.ExistInLocaly = false; } sol.SourceControlLocation = SolutionFolder.Substring(SolutionFolder.LastIndexOf("\\") + 1); if (sol == null) { Reporter.ToUser(eUserMsgKey.AskToSelectSolution); return; } string ProjectURI = string.Empty; if (WorkSpace.Instance.UserProfile.SourceControlType == SourceControlBase.eSourceControlType.SVN) { ProjectURI = WorkSpace.Instance.UserProfile.SourceControlURL.StartsWith("SVN", StringComparison.CurrentCultureIgnoreCase) ? sol.SourceControlLocation : WorkSpace.Instance.UserProfile.SourceControlURL + sol.SourceControlLocation; } else { ProjectURI = WorkSpace.Instance.UserProfile.SourceControlURL; } bool getProjectResult = true; getProjectResult = SourceControlIntegration.CreateConfigFile(mSourceControl); if (getProjectResult != true) { return; } if (sol.ExistInLocaly == true) { mSourceControl.RepositoryRootFolder = sol.LocalFolder; SourceControlIntegration.GetLatest(sol.LocalFolder, mSourceControl); } else { getProjectResult = SourceControlIntegration.GetProject(mSourceControl, sol.LocalFolder, ProjectURI); } }
public bool Revert(string path, SourceControlBase SourceControl) { return(SourceControlIntegration.Revert(SourceControl, path)); }
StackPanel ITreeViewItem.Header() { string ImageFile = "@Folder2_16x16.png"; //TODO: find icon for Applications return(TreeViewUtils.CreateItemHeader(Folder, ImageFile, SourceControlIntegration.GetItemSourceControlImage(Path, ref ItemSourceControlStatus))); }
public bool GetLatest(string path, SourceControlBase SourceControl) { return(SourceControlIntegration.GetLatest(path, SourceControl)); }