# HG changeset patch # User padraigob@netbeans.org # Date 1205844891 0 # Node ID 7e5cbc0923feea2f3e682db1367b262247fded7e # Parent 0247b1fc069360d340e082082302921cf94aff82 129980: Do not throw exception in getOriginalFile. diff -r 0247b1fc0693 -r 7e5cbc0923fe mercurial/src/org/netbeans/modules/mercurial/Mercurial.java --- a/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Fri Mar 14 11:18:35 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/Mercurial.java Tue Mar 18 12:54:51 2008 +0000 @@ -324,13 +324,16 @@ public class Mercurial { public void getOriginalFile(File workingCopy, File originalFile) { FileInformation info = fileStatusCache.getStatus(workingCopy); + LOG.log(Level.FINE, "getOriginalFile: {0} {1}", new Object[] {workingCopy, info}); // NOI18N if ((info.getStatus() & STATUS_DIFFABLE) == 0) return; + + // We can get status returned as UptoDate instead of LocallyNew + // because refreshing of status after creation has been scheduled + // but may not have happened yet. try { File original = VersionsCache.getInstance().getFileRevision(workingCopy, Setup.REVISION_BASE); - if (original == null) { - throw new IOException("Unable to get BASE revision of " + workingCopy); - } + if (original == null) return; org.netbeans.modules.versioning.util.Utils.copyStreamsCloseAll(new FileOutputStream(originalFile), new FileInputStream(original)); original.delete(); } catch (IOException e) {