Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/Revlog.java @ 608:e1b29756f901
Clean, organize and resolve some TODOs and FIXMEs: minor refactorings and comments
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 07 May 2013 21:27:51 +0200 |
parents | 66f1cc23b906 |
children | 6526d8adbc0f |
comparison
equal
deleted
inserted
replaced
607:66f1cc23b906 | 608:e1b29756f901 |
---|---|
249 content.iterate(revisionIndex, revisionIndex, true, insp); | 249 content.iterate(revisionIndex, revisionIndex, true, insp); |
250 insp.checkFailed(); | 250 insp.checkFailed(); |
251 } catch (IOException ex) { | 251 } catch (IOException ex) { |
252 HgInvalidControlFileException e = new HgInvalidControlFileException(String.format("Access to revision %d content failed", revisionIndex), ex, null); | 252 HgInvalidControlFileException e = new HgInvalidControlFileException(String.format("Access to revision %d content failed", revisionIndex), ex, null); |
253 e.setRevisionIndex(revisionIndex); | 253 e.setRevisionIndex(revisionIndex); |
254 // TODO post 1.0 e.setFileName(content.getIndexFile() or this.getHumanFriendlyPath()) - shall decide whether | 254 // TODO [post 1.1] e.setFileName(content.getIndexFile() or this.getHumanFriendlyPath()) - shall decide whether |
255 // protected abstract getHFPath() with impl in HgDataFile, HgManifest and HgChangelog or path is data of either Revlog or RevlogStream | 255 // protected abstract getHFPath() with impl in HgDataFile, HgManifest and HgChangelog or path is data of either Revlog or RevlogStream |
256 // Do the same (add file name) below | 256 // Do the same (add file name) below |
257 throw e; | 257 throw e; |
258 } catch (HgInvalidControlFileException ex) { | 258 } catch (HgInvalidControlFileException ex) { |
259 throw ex.isRevisionIndexSet() ? ex : ex.setRevisionIndex(revisionIndex); | 259 throw ex.isRevisionIndexSet() ? ex : ex.setRevisionIndex(revisionIndex); |
373 } | 373 } |
374 } | 374 } |
375 }); | 375 }); |
376 if (parentInsp != null && _start > 0) { | 376 if (parentInsp != null && _start > 0) { |
377 assert missingParents.size() > 0; // in fact, more relaxed than assert. rather 'assume' | 377 assert missingParents.size() > 0; // in fact, more relaxed than assert. rather 'assume' |
378 // TODO int[] IntMap#keys() or even sort of iterator that can modify values | 378 // TODO [post-1.1] int[] IntMap#keys() or even sort of iterator that can modify values |
379 for (int k = missingParents.firstKey(), l = missingParents.lastKey(); k <= l; k++) { | 379 for (int k = missingParents.firstKey(), l = missingParents.lastKey(); k <= l; k++) { |
380 if (missingParents.containsKey(k)) { | 380 if (missingParents.containsKey(k)) { |
381 Nodeid nid = getRepo().getChangelog().getRevision(k); | 381 Nodeid nid = getRepo().getChangelog().getRevision(k); |
382 missingParents.put(k, nid); | 382 missingParents.put(k, nid); |
383 } | 383 } |
431 pw.init(); | 431 pw.init(); |
432 return pw; | 432 return pw; |
433 } | 433 } |
434 | 434 |
435 /* | 435 /* |
436 * class with cancel and few other exceptions support. TODO consider general superclass to share with e.g. HgManifestCommand.Mediator | 436 * class with cancel and few other exceptions support. |
437 * TODO [post-1.1] consider general superclass to share with e.g. HgManifestCommand.Mediator | |
437 */ | 438 */ |
438 protected abstract static class ErrorHandlingInspector implements RevlogStream.Inspector, CancelSupport { | 439 protected abstract static class ErrorHandlingInspector implements RevlogStream.Inspector, CancelSupport { |
439 private Exception failure; | 440 private Exception failure; |
440 private CancelSupport cancelSupport; | 441 private CancelSupport cancelSupport; |
441 | 442 |