Example #1
0
        protected virtual void OnButtonRemoveBranchClicked(object sender, System.EventArgs e)
        {
            TreeIter it;

            if (!listBranches.Selection.GetSelected(out it))
            {
                return;
            }
            Branch b   = (Branch)storeBranches.GetValue(it, 0);
            string txt = null;

            if (!repo.IsBranchMerged(b.Name))
            {
                txt = GettextCatalog.GetString("WARNING: The branch has not yet been merged to HEAD");
            }
            if (MessageService.Confirm(GettextCatalog.GetString("Are you sure you want to delete the branch '{0}'?", b.Name), txt, AlertButton.Delete))
            {
                try {
                    repo.RemoveBranch(b.Name);
                    FillBranches();
                } catch (Exception ex) {
                    MessageService.ShowException(ex, GettextCatalog.GetString("The branch could not be deleted"));
                }
            }
        }