Index: Bundle.properties =================================================================== RCS file: /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/Attic/Bundle.properties,v retrieving revision 1.1.2.22 diff -u -r1.1.2.22 Bundle.properties --- Bundle.properties 25 Apr 2007 12:07:42 -0000 1.1.2.22 +++ Bundle.properties 4 May 2007 13:58:57 -0000 @@ -86,3 +86,5 @@ MSG_Move_Progress = Moving ... MSG_Add_Progress = Adding ... MSG_NO_PUSH_PULL_PATH = no default +MSG_VERSION_CONFIRM = Confirm Mercurial version +MSG_VERSION_CONFIRM_QUERY The version of mercurial found ({0}) is not the version ({1}) supported by the Netbeans Mercurial Plugin..\nDo you want to use this version of mercurial with the plugin? Index: HgModuleConfig.java =================================================================== RCS file: /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/Attic/HgModuleConfig.java,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 HgModuleConfig.java --- HgModuleConfig.java 15 Mar 2007 17:23:41 -0000 1.1.2.1 +++ HgModuleConfig.java 4 May 2007 13:58:57 -0000 @@ -40,6 +40,7 @@ public static final String PROP_COMMIT_EXCLUSIONS = "commitExclusions"; // NOI18N public static final String PROP_DEFAULT_VALUES = "defaultValues"; // NOI18N public static final String PROP_TEXT_ANNOTATIONS_FORMAT = "textAnnotations"; // NOI18N + public static final String PROP_RUN_VERSION = "runVersion"; // NOI18N public static final String KEY_EXECUTABLE_BINARY = "svnExecBinary"; // NOI18N public static final String KEY_ANNOTATION_FORMAT = "annotationFormat"; // NOI18N Index: Mercurial.java =================================================================== RCS file: /shared/data/ccvs/repository/versioncontrol/mercurial/src/org/netbeans/modules/mercurial/Attic/Mercurial.java,v retrieving revision 1.1.2.26 diff -u -r1.1.2.26 Mercurial.java --- Mercurial.java 30 Apr 2007 16:51:41 -0000 1.1.2.26 +++ Mercurial.java 4 May 2007 13:58:57 -0000 @@ -33,6 +33,9 @@ import org.openide.filesystems.FileUtil; import org.netbeans.modules.mercurial.ui.diff.Setup; import org.netbeans.modules.mercurial.util.HgCommand; +import org.openide.util.NbBundle; +import javax.swing.JOptionPane; +import java.util.prefs.Preferences; /** * Main entry point for Mercurial functionality, use getInstance() to get the Mercurial object. @@ -73,6 +76,7 @@ private MercurialAnnotator mercurialAnnotator; private MercurialInterceptor mercurialInterceptor; private FileStatusCache fileStatusCache; + private HgSettings settings; private HashMap processorsToUrl; private boolean goodVersion; @@ -88,6 +92,25 @@ String version = HgCommand.getHgVersion(); if (version != null) { goodVersion = version.startsWith(MERCURIAL_GOOD_VERSION); + if (!goodVersion) { + Preferences prefs = HgModuleConfig.getDefault().getPreferences(); + String runVersion = prefs.get(HgModuleConfig.PROP_RUN_VERSION, null); + if (runVersion == null || !runVersion.equals(version)) { + int response = JOptionPane.showOptionDialog(null, + NbBundle.getMessage(Mercurial.class,"MSG_VERSION_CONFIRM_QUERY", version, MERCURIAL_GOOD_VERSION), + NbBundle.getMessage(Mercurial.class,"MSG_VERSION_CONFIRM"), + JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,null, null, null); + + if (response == JOptionPane.YES_OPTION) { + goodVersion = true; + prefs.put(HgModuleConfig.PROP_RUN_VERSION, version); + } else { + prefs.remove(HgModuleConfig.PROP_RUN_VERSION); + } + } else { + goodVersion = true; + } + } } else { goodVersion = false; }