This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 127451
Collapse All | Expand All

(-)a/mercurial/src/org/netbeans/modules/mercurial/ui/merge/MergeAction.java (-29 / +20 lines)
Lines 68-74 public class MergeAction extends Context Link Here
68
public class MergeAction extends ContextAction {
68
public class MergeAction extends ContextAction {
69
69
70
    private final VCSContext context;
70
    private final VCSContext context;
71
    private String revStr;
72
    private final static int MULTIPLE_AUTOMERGE_HEAD_LIMIT = 2;
71
    private final static int MULTIPLE_AUTOMERGE_HEAD_LIMIT = 2;
73
    
72
    
74
    public MergeAction(String name, VCSContext context) {
73
    public MergeAction(String name, VCSContext context) {
Lines 97-135 public class MergeAction extends Context Link Here
97
                    JOptionPane.INFORMATION_MESSAGE);
96
                    JOptionPane.INFORMATION_MESSAGE);
98
            return;
97
            return;
99
        }
98
        }
100
        if(root != null && !HgCommand.isMergeRequired(root)){
101
            HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE")); // NOI18N
102
            HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE_SEP")); // NOI18N
103
            HgUtils.outputMercurialTab( NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE")); // NOI18N
104
            HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class, "MSG_MERGE_DONE")); // NOI18N
105
            HgUtils.outputMercurialTab(""); // NOI18N
106
            JOptionPane.showMessageDialog(null,
107
                NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE"),// NOI18N
108
                NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE"),// NOI18N
109
                JOptionPane.INFORMATION_MESSAGE);
110
            return;
111
        }
112
113
        String repository = root.getAbsolutePath();
99
        String repository = root.getAbsolutePath();
114
        try{
115
            List<String> headList = HgCommand.getHeadRevisions(root);
116
            revStr = null;
117
            if (headList.size() > MULTIPLE_AUTOMERGE_HEAD_LIMIT){
118
                final MergeRevisions mergeDlg = new MergeRevisions(root);
119
                if (!mergeDlg.showDialog()) {
120
                    return;
121
                }
122
                revStr = mergeDlg.getSelectionRevision();               
123
            }
124
        } catch(HgException ex) {
125
                    NotifyDescriptor.Exception e = new NotifyDescriptor.Exception(ex);
126
                    DialogDisplayer.getDefault().notifyLater(e);
127
        }
128
        
129
        RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository);
100
        RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(repository);
130
        HgProgressSupport support = new HgProgressSupport() {
101
        HgProgressSupport support = new HgProgressSupport() {
131
            public void perform() {
102
            public void perform() {
132
                try {
103
                try {
104
                    List<String> headList = HgCommand.getHeadRevisions(root);
105
                    String revStr = null;
106
                    if (headList.size() <= 1) {
107
                        HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE")); // NOI18N
108
                        HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE_SEP")); // NOI18N
109
                        HgUtils.outputMercurialTab( NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE")); // NOI18N
110
                        HgUtils.outputMercurialTabInRed( NbBundle.getMessage(MergeAction.class, "MSG_MERGE_DONE")); // NOI18N
111
                        HgUtils.outputMercurialTab(""); // NOI18N
112
                        JOptionPane.showMessageDialog(null,
113
                            NbBundle.getMessage(MergeAction.class,"MSG_NOTHING_TO_MERGE"),// NOI18N
114
                            NbBundle.getMessage(MergeAction.class,"MSG_MERGE_TITLE"),// NOI18N
115
                            JOptionPane.INFORMATION_MESSAGE);
116
                         return;
117
                    } else if (headList.size() > MULTIPLE_AUTOMERGE_HEAD_LIMIT){
118
                        final MergeRevisions mergeDlg = new MergeRevisions(root);
119
                        if (!mergeDlg.showDialog()) {
120
                            return;
121
                        }
122
                        revStr = mergeDlg.getSelectionRevision();               
123
                    }
133
                    HgUtils.outputMercurialTabInRed(
124
                    HgUtils.outputMercurialTabInRed(
134
                            NbBundle.getMessage(MergeAction.class, "MSG_MERGE_TITLE")); // NOI18N
125
                            NbBundle.getMessage(MergeAction.class, "MSG_MERGE_TITLE")); // NOI18N
135
                    HgUtils.outputMercurialTabInRed(
126
                    HgUtils.outputMercurialTabInRed(

Return to bug 127451