Example #1
0
        private void FinishFeature()
        {
            DateTime start = DateTime.Now;

            var properties = new Dictionary <string, string>
            {
                { "RebaseOnDevelopmentBranch", FeatureRebaseOnDevelopmentBranch.ToString() },
                { "DeleteBranch", FeatureDeleteBranch.ToString() }
            };

            Logger.Event("FinishFeature", properties);

            if (GitFlowPage.ActiveRepo != null)
            {
                GitFlowPage.ActiveOutputWindow();

                ShowProgressBar();

                var gf     = new VsGitFlowWrapper(GitFlowPage.ActiveRepoPath, GitFlowPage.OutputWindow);
                var result = gf.FinishFeature(SelectedFeature.Name, FeatureRebaseOnDevelopmentBranch, FeatureDeleteBranch);
                if (!result.Success)
                {
                    ShowErrorMessage(result);
                }

                HideProgressBar();
                ShowFinishFeature = Visibility.Collapsed;
                UpdateMenus();
                HideAll();
                OnPropertyChanged("AllFeatures");
                Te.Refresh();
            }

            Logger.Metric("Duration-FinishFeature", (DateTime.Now - start).Milliseconds);
        }
Example #2
0
        private void FinishFeature()
        {
            try
            {
                DateTime start = DateTime.Now;

                var properties = new Dictionary <string, string>
                {
                    { "RebaseOnDevelopmentBranch", FeatureRebaseOnDevelopmentBranch.ToString() },
                    { "DeleteLocalBranch", FeatureDeleteLocalBranch.ToString() },
                    { "DeleteRemoteBranch", FeatureDeleteRemoteBranch.ToString() },
                    { "Squash", FeatureSquash.ToString() },
                    { "NoFastForward", FeatureNoFastForward.ToString() }
                };
                Logger.Event("FinishFeature", properties);

                if (GitFlowPage.ActiveRepo != null)
                {
                    GitFlowPage.ActiveOutputWindow();

                    ShowProgressBar();

                    var gf = new VsGitFlowWrapper(GitFlowPage.ActiveRepoPath, GitFlowPage.OutputWindow);
                    if (FeatureSquash)
                    {
                        ShowInfoMessage("Waiting for your editor to close the file...");
                    }
                    var result = gf.FinishFeature(SelectedFeature.Name, FeatureRebaseOnDevelopmentBranch, FeatureDeleteLocalBranch, FeatureDeleteRemoteBranch, FeatureSquash, FeatureNoFastForward);
                    if (!result.Success)
                    {
                        ShowErrorMessage(result);
                    }

                    HideProgressBar();
                    ShowFinishFeature = Visibility.Collapsed;
                    UpdateMenus();
                    HideAll();
                    OnPropertyChanged("AllFeatures");
                    if (result.Success)
                    {
                        Te.Refresh();
                    }
                }

                Logger.Metric("Duration-FinishFeature", (DateTime.Now - start).Milliseconds);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.ToString());
                Logger.Exception(ex);
            }
        }
Example #3
0
        private void StartHotfix()
        {
            try
            {
                if (String.IsNullOrEmpty(HotfixName))
                {
                    return;
                }

                Logger.Event("StartHotfix");
                DateTime start = DateTime.Now;

                if (GitFlowPage.ActiveRepo != null)
                {
                    GitFlowPage.ActiveOutputWindow();
                    ShowProgressBar();

                    var gf     = new VsGitFlowWrapper(GitFlowPage.ActiveRepoPath, GitFlowPage.OutputWindow);
                    var result = gf.StartHotfix(HotfixName);
                    if (!result.Success)
                    {
                        ShowErrorMessage(result);
                    }

                    HideProgressBar();
                    ShowStartHotfix = Visibility.Collapsed;
                    HotfixName      = String.Empty;
                    UpdateMenus();
                    HideAll();
                    OnPropertyChanged("AllHotfixes");
                    if (result.Success)
                    {
                        Te.Refresh();
                    }
                }
                Logger.Metric("Duration-StartHotfix", (DateTime.Now - start).Milliseconds);
            }
            catch (ArgumentException ex)
            {
                ShowErrorMessage(ex.Message);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.ToString());
                Logger.Exception(ex);
            }
        }
Example #4
0
        private void FinishRelease()
        {
            try
            {
                DateTime start      = DateTime.Now;
                var      properties = new Dictionary <string, string>
                {
                    { "TaggedRelease", (!String.IsNullOrEmpty(ReleaseTagMessage)).ToString() },
                    { "DeleteBranch", ReleaseDeleteBranch.ToString() },
                    { "ForceDeletion", ReleaseForceDeletion.ToString() },
                    { "PushChanges", ReleasePushChanges.ToString() },
                    { "NoBackMerge", ReleaseNoBackMerge.ToString() }
                };
                Logger.Event("FinishRelease", properties);

                if (GitFlowPage.ActiveRepo != null)
                {
                    GitFlowPage.ActiveOutputWindow();
                    ShowProgressBar();

                    var gf     = new VsGitFlowWrapper(GitFlowPage.ActiveRepoPath, GitFlowPage.OutputWindow);
                    var result = gf.FinishRelease(SelectedRelease.Name, ReleaseTagMessage, ReleaseDeleteBranch, ReleaseForceDeletion, ReleasePushChanges, ReleaseNoBackMerge);
                    if (!result.Success)
                    {
                        ShowErrorMessage(result);
                    }

                    HideAll();
                    HideProgressBar();
                    ShowFinishRelease = Visibility.Collapsed;
                    OnPropertyChanged("AllReleases");
                    UpdateMenus();
                    if (result.Success)
                    {
                        Te.Refresh();
                    }
                }
                Logger.Metric("Duration-FinishRelease", (DateTime.Now - start).Milliseconds);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.ToString());
                Logger.Exception(ex);
            }
        }
Example #5
0
        private void OnInitialize()
        {
            try
            {
                DateTime start = DateTime.Now;

                Logger.Event("Init");
                if (GitFlowPage.ActiveRepo != null)
                {
                    GitFlowPage.OutputWindow.Activate();
                    ProgressVisibility = Visibility.Visible;

                    var gf     = new VsGitFlowWrapper(GitFlowPage.ActiveRepo.RepositoryPath, GitFlowPage.OutputWindow);
                    var result = gf.Init(new GitFlowRepoSettings
                    {
                        DevelopBranch = Develop,
                        MasterBranch  = Master,
                        FeatureBranch = FeaturePrefix,
                        BugfixBranch  = BugfixPrefix,
                        ReleaseBranch = ReleasePrefix,
                        SupportBranch = SupportPrefix,
                        HotfixBranch  = HotfixPrefix,
                        VersionTag    = VersionTagPrefix
                    });
                    if (!result.Success)
                    {
                        Te.ShowErrorNotification(result.CommandOutput);
                    }

                    ProgressVisibility = Visibility.Hidden;
                    InitGridVisibility = Visibility.Hidden;
                    Te.Refresh();
                }
                Logger.Metric("Duration-Init", (DateTime.Now - start).Milliseconds);
            }
            catch (Exception e)
            {
                Te.ShowErrorNotification(e.ToString());
                Logger.Exception(e);
            }
        }