# HG changeset patch # User padraigob@netbeans.org # Date 1203952463 0 # Node ID e6ac7de3eec9b39f67f8e8cdc7029be528d019d4 # Parent ddfe4b037f0b4438e1695d7d50912bac04775fad 127558: Allow null OutputLogger to be passed to handleError in HgCommand. Do not use OutputLogger in VersionsCache.getFileRevision diff -r ddfe4b037f0b -r e6ac7de3eec9 mercurial/src/org/netbeans/modules/mercurial/VersionsCache.java --- a/mercurial/src/org/netbeans/modules/mercurial/VersionsCache.java Mon Feb 25 08:05:15 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/VersionsCache.java Mon Feb 25 15:14:23 2008 +0000 @@ -76,34 +76,29 @@ public class VersionsCache { if(revision.equals("-1")) return null; // NOI18N File repository = Mercurial.getInstance().getTopmostManagedParent(base); - OutputLogger logger = OutputLogger.getLogger(repository.getAbsolutePath()); if (Setup.REVISION_BASE.equals(revision)) { try { File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N - HgCommand.doCat(repository, base, tempFile, logger); + HgCommand.doCat(repository, base, tempFile, null); if (tempFile.length() == 0) return null; return tempFile; } catch (HgException e) { IOException ioe = new IOException(); ioe.initCause(e); throw ioe; - } finally { - logger.closeLog(); } } else if (Setup.REVISION_CURRENT.equals(revision)) { return base; } else { try { File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N - HgCommand.doCat(repository, base, tempFile, revision, logger); + HgCommand.doCat(repository, base, tempFile, revision, null); if (tempFile.length() == 0) return null; return tempFile; } catch (HgException e) { IOException ioe = new IOException(); ioe.initCause(e); throw ioe; - } finally { - logger.closeLog(); } } } diff -r ddfe4b037f0b -r e6ac7de3eec9 mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java --- a/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Mon Feb 25 08:05:15 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Mon Feb 25 15:14:23 2008 +0000 @@ -2717,7 +2717,7 @@ public class HgCommand { } private static void handleError(List command, List list, String message, OutputLogger logger) throws HgException{ - if (command != null && list != null){ + if (command != null && list != null && logger != null){ Mercurial.LOG.log(Level.WARNING, "command: " + HgUtils.replaceHttpPassword(command)); // NOI18N Mercurial.LOG.log(Level.WARNING, "output: " + HgUtils.replaceHttpPassword(list)); // NOI18N logger.outputInRed(NbBundle.getMessage(HgCommand.class, "MSG_COMMAND_ERR")); // NOI18N