Lines 76-109
public class VersionsCache {
Link Here
|
76 |
if(revision.equals("-1")) return null; // NOI18N |
76 |
if(revision.equals("-1")) return null; // NOI18N |
77 |
|
77 |
|
78 |
File repository = Mercurial.getInstance().getTopmostManagedParent(base); |
78 |
File repository = Mercurial.getInstance().getTopmostManagedParent(base); |
79 |
OutputLogger logger = OutputLogger.getLogger(repository.getAbsolutePath()); |
|
|
80 |
if (Setup.REVISION_BASE.equals(revision)) { |
79 |
if (Setup.REVISION_BASE.equals(revision)) { |
81 |
try { |
80 |
try { |
82 |
File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N |
81 |
File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N |
83 |
HgCommand.doCat(repository, base, tempFile, logger); |
82 |
HgCommand.doCat(repository, base, tempFile, null); |
84 |
if (tempFile.length() == 0) return null; |
83 |
if (tempFile.length() == 0) return null; |
85 |
return tempFile; |
84 |
return tempFile; |
86 |
} catch (HgException e) { |
85 |
} catch (HgException e) { |
87 |
IOException ioe = new IOException(); |
86 |
IOException ioe = new IOException(); |
88 |
ioe.initCause(e); |
87 |
ioe.initCause(e); |
89 |
throw ioe; |
88 |
throw ioe; |
90 |
} finally { |
|
|
91 |
logger.closeLog(); |
92 |
} |
89 |
} |
93 |
} else if (Setup.REVISION_CURRENT.equals(revision)) { |
90 |
} else if (Setup.REVISION_CURRENT.equals(revision)) { |
94 |
return base; |
91 |
return base; |
95 |
} else { |
92 |
} else { |
96 |
try { |
93 |
try { |
97 |
File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N |
94 |
File tempFile = File.createTempFile("tmp", "-" + base.getName()); //NOI18N |
98 |
HgCommand.doCat(repository, base, tempFile, revision, logger); |
95 |
HgCommand.doCat(repository, base, tempFile, revision, null); |
99 |
if (tempFile.length() == 0) return null; |
96 |
if (tempFile.length() == 0) return null; |
100 |
return tempFile; |
97 |
return tempFile; |
101 |
} catch (HgException e) { |
98 |
} catch (HgException e) { |
102 |
IOException ioe = new IOException(); |
99 |
IOException ioe = new IOException(); |
103 |
ioe.initCause(e); |
100 |
ioe.initCause(e); |
104 |
throw ioe; |
101 |
throw ioe; |
105 |
} finally { |
|
|
106 |
logger.closeLog(); |
107 |
} |
102 |
} |
108 |
} |
103 |
} |
109 |
} |
104 |
} |