comparison src/org/tmatesoft/hg/repo/HgDataFile.java @ 490:b3c16d1aede0

Refactoring: move HgRepository's implementation aspects to Internals (which is now its imlementation counterpart and primary repository class to be used by other parts of the library)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 16 Aug 2012 17:08:34 +0200
parents 909306e412e2
children abfbe81154b5
comparison
equal deleted inserted replaced
489:9c0138cda59a 490:b3c16d1aede0
180 progress.done(); 180 progress.done();
181 if (fc != null) { 181 if (fc != null) {
182 try { 182 try {
183 fc.close(); 183 fc.close();
184 } catch (IOException ex) { 184 } catch (IOException ex) {
185 getRepo().getContext().getLog().dump(getClass(), Warn, ex, null); 185 getRepo().getSessionContext().getLog().dump(getClass(), Warn, ex, null);
186 } 186 }
187 } 187 }
188 } 188 }
189 } else { 189 } else {
190 Nodeid fileRev = getWorkingCopyRevision(); 190 Nodeid fileRev = getWorkingCopyRevision();
206 Nodeid p = wcParents.first().isNull() ? wcParents.second() : wcParents.first(); 206 Nodeid p = wcParents.first().isNull() ? wcParents.second() : wcParents.first();
207 final HgChangelog clog = getRepo().getChangelog(); 207 final HgChangelog clog = getRepo().getChangelog();
208 final int csetRevIndex; 208 final int csetRevIndex;
209 if (p.isNull()) { 209 if (p.isNull()) {
210 // no dirstate parents 210 // no dirstate parents
211 getRepo().getContext().getLog().dump(getClass(), Info, "No dirstate parents, resort to TIP", getPath()); 211 getRepo().getSessionContext().getLog().dump(getClass(), Info, "No dirstate parents, resort to TIP", getPath());
212 // if it's a repository with no dirstate, use TIP then 212 // if it's a repository with no dirstate, use TIP then
213 csetRevIndex = clog.getLastRevision(); 213 csetRevIndex = clog.getLastRevision();
214 if (csetRevIndex == -1) { 214 if (csetRevIndex == -1) {
215 // shall not happen provided there's .i for this data file (hence at least one cset) 215 // shall not happen provided there's .i for this data file (hence at least one cset)
216 // and perhaps exception is better here. However, null as "can't find" indication seems reasonable. 216 // and perhaps exception is better here. However, null as "can't find" indication seems reasonable.
281 } 281 }
282 if (metadata == null) { 282 if (metadata == null) {
283 metadata = new Metadata(); 283 metadata = new Metadata();
284 } 284 }
285 ErrorHandlingInspector insp; 285 ErrorHandlingInspector insp;
286 final LogFacility lf = getRepo().getContext().getLog(); 286 final LogFacility lf = getRepo().getSessionContext().getLog();
287 if (metadata.none(fileRevisionIndex)) { 287 if (metadata.none(fileRevisionIndex)) {
288 insp = new ContentPipe(sink, 0, lf); 288 insp = new ContentPipe(sink, 0, lf);
289 } else if (metadata.known(fileRevisionIndex)) { 289 } else if (metadata.known(fileRevisionIndex)) {
290 insp = new ContentPipe(sink, metadata.dataOffset(fileRevisionIndex), lf); 290 insp = new ContentPipe(sink, metadata.dataOffset(fileRevisionIndex), lf);
291 } else { 291 } else {