Lines 33-38
Link Here
|
33 |
import org.openide.filesystems.FileUtil; |
33 |
import org.openide.filesystems.FileUtil; |
34 |
import org.netbeans.modules.mercurial.ui.diff.Setup; |
34 |
import org.netbeans.modules.mercurial.ui.diff.Setup; |
35 |
import org.netbeans.modules.mercurial.util.HgCommand; |
35 |
import org.netbeans.modules.mercurial.util.HgCommand; |
|
|
36 |
import org.openide.util.NbBundle; |
37 |
import javax.swing.JOptionPane; |
38 |
import java.util.prefs.Preferences; |
36 |
|
39 |
|
37 |
/** |
40 |
/** |
38 |
* Main entry point for Mercurial functionality, use getInstance() to get the Mercurial object. |
41 |
* Main entry point for Mercurial functionality, use getInstance() to get the Mercurial object. |
Lines 73-78
Link Here
|
73 |
private MercurialAnnotator mercurialAnnotator; |
76 |
private MercurialAnnotator mercurialAnnotator; |
74 |
private MercurialInterceptor mercurialInterceptor; |
77 |
private MercurialInterceptor mercurialInterceptor; |
75 |
private FileStatusCache fileStatusCache; |
78 |
private FileStatusCache fileStatusCache; |
|
|
79 |
private HgSettings settings; |
76 |
private HashMap<String, RequestProcessor> processorsToUrl; |
80 |
private HashMap<String, RequestProcessor> processorsToUrl; |
77 |
private boolean goodVersion; |
81 |
private boolean goodVersion; |
78 |
|
82 |
|
Lines 88-93
Link Here
|
88 |
String version = HgCommand.getHgVersion(); |
92 |
String version = HgCommand.getHgVersion(); |
89 |
if (version != null) { |
93 |
if (version != null) { |
90 |
goodVersion = version.startsWith(MERCURIAL_GOOD_VERSION); |
94 |
goodVersion = version.startsWith(MERCURIAL_GOOD_VERSION); |
|
|
95 |
if (!goodVersion) { |
96 |
Preferences prefs = HgModuleConfig.getDefault().getPreferences(); |
97 |
String runVersion = prefs.get(HgModuleConfig.PROP_RUN_VERSION, null); |
98 |
if (runVersion == null || !runVersion.equals(version)) { |
99 |
int response = JOptionPane.showOptionDialog(null, |
100 |
NbBundle.getMessage(Mercurial.class,"MSG_VERSION_CONFIRM_QUERY", version, MERCURIAL_GOOD_VERSION), |
101 |
NbBundle.getMessage(Mercurial.class,"MSG_VERSION_CONFIRM"), |
102 |
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,null, null, null); |
103 |
|
104 |
if (response == JOptionPane.YES_OPTION) { |
105 |
goodVersion = true; |
106 |
prefs.put(HgModuleConfig.PROP_RUN_VERSION, version); |
107 |
} else { |
108 |
prefs.remove(HgModuleConfig.PROP_RUN_VERSION); |
109 |
} |
110 |
} else { |
111 |
goodVersion = true; |
112 |
} |
113 |
} |
91 |
} else { |
114 |
} else { |
92 |
goodVersion = false; |
115 |
goodVersion = false; |
93 |
} |
116 |
} |