# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/Bundle.properties --- versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/Bundle.properties Base (1.18) +++ versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/Bundle.properties Locally Modified (Based On 1.18) @@ -45,6 +45,9 @@ MSG_EXTERNAL_CLONE_FROM = INFO Clone From: {0} MSG_EXTERNAL_CLONE_TO = INFO To: {0} MSG_CLONE_NOTHING = Nothing yet comitted, so nothing to Clone. + +MSG_CLONE_NOT_PROJECT = Unable to open Cloned Project.\n\nTo be opened this muct be a NetBeans Project and all NetBeans Project Files\nmust have been committed in the project being Cloned. + LBL_Clone_Progress=Cloning {0}... ClonePanel.fromLabel.text=Source Repository: ClonePanel.toLabel.text=&Parent Directory: Index: versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java --- versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java Base (1.19) +++ versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneAction.java Locally Modified (Based On 1.19) @@ -152,7 +152,13 @@ try { FileObject cloneProj = FileUtil.toFileObject(clonePrjFile); Project prj = projectManager.findProject(cloneProj); + if(prj == null){ + HgUtils.warningDialog(CloneAction.class, + "MSG_CLONE_TITLE",// NOI18N + "MSG_CLONE_NOT_PROJECT");// NOI18N + }else{ HgProjectUtils.openProject(prj, this, HgModuleConfig.getDefault().getSetMainProject()); + } hg.versionedFilesChanged(); hg.refreshAllAnnotations(); Index: versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneCompleted.java --- versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneCompleted.java Base (1.1) +++ versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/CloneCompleted.java Locally Modified (Based On 1.1) @@ -65,6 +65,7 @@ import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.netbeans.modules.mercurial.Mercurial; +import org.netbeans.modules.mercurial.util.HgUtils; /** * @@ -162,9 +163,7 @@ if (projectFolder != null) { try { Project p = ProjectManager.getDefault().findProject(projectFolder); - if (p != null) { openProject(p); - } } catch (IOException e1) { Throwable cause = new Throwable(NbBundle.getMessage(CloneAction.class, "BK1014", projectFolder)); e1.initCause(cause); @@ -173,17 +172,26 @@ } } } else { - if (projectToBeOpened == null) { - return; - } openProject(projectToBeOpened); } } else if (panel.createButton.equals(src)) { + if (workingFolder == null) { + HgUtils.warningDialog(CloneAction.class, + "MSG_CLONE_TITLE",// NOI18N + "MSG_CLONE_NOT_PROJECT");// NOI18N + }else{ ProjectUtilities.newProjectWizard(workingFolder); } } + } private void openProject(Project p) { + if (p == null) { + HgUtils.warningDialog(CloneAction.class, + "MSG_CLONE_TITLE",// NOI18N + "MSG_CLONE_NOT_PROJECT");// NOI18N + return; + } Project[] projects = new Project[]{p}; OpenProjects.getDefault().open(projects, false); Index: versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ProjectUtilities.java --- versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ProjectUtilities.java Base (1.1) +++ versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/clone/ProjectUtilities.java Locally Modified (Based On 1.1) @@ -75,6 +75,7 @@ private static final String ProjectTab_ID_LOGICAL = "projectTabLogical_tc"; // NOI18N public static void selectAndExpandProject( final Project p ) { + if (p == null) return; // invoke later to select the being opened project if the focus is outside ProjectTab SwingUtilities.invokeLater (new Runnable () { @@ -121,6 +122,8 @@ * */ public static void newProjectWizard(File workingDirectory) { + if (workingDirectory == null) return; + Action action = CommonProjectActions.newProjectAction(); if (action != null) { File original = ProjectChooser.getProjectsFolder();