Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/PhasesHelper.java @ 446:9f0e6dfd417e smartgit3
Workaround for a Revlog#walk defect for the price of (almost) complete repo walk
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Tue, 05 Jun 2012 21:18:20 +0200 |
| parents | d0e5dc3cae6e |
| children | 056f724bdc21 |
comparison
equal
deleted
inserted
replaced
| 445:d0e5dc3cae6e | 446:9f0e6dfd417e |
|---|---|
| 110 * (a) collect only for a subset of repository, | 110 * (a) collect only for a subset of repository, |
| 111 * (b) be able to answer isDescendant(int csetRevIndex) using absolute indexing (i.e bitAt(csetRevIndex - rootRevIndex)) | 111 * (b) be able to answer isDescendant(int csetRevIndex) using absolute indexing (i.e bitAt(csetRevIndex - rootRevIndex)) |
| 112 */ | 112 */ |
| 113 final HashSet<Nodeid> parents2consider = new HashSet<Nodeid>(roots); | 113 final HashSet<Nodeid> parents2consider = new HashSet<Nodeid>(roots); |
| 114 final boolean[] result = new boolean[] { false }; | 114 final boolean[] result = new boolean[] { false }; |
| 115 hgRepo.getChangelog().walk(rootIndexes[0], csetRevIndex, new HgChangelog.ParentInspector() { | 115 hgRepo.getChangelog().walk(0/*rootIndexes[0]*/, csetRevIndex, new HgChangelog.ParentInspector() { |
| 116 | 116 |
| 117 public void next(int revisionIndex, Nodeid revision, int parent1, int parent2, Nodeid nidParent1, Nodeid nidParent2) { | 117 public void next(int revisionIndex, Nodeid revision, int parent1, int parent2, Nodeid nidParent1, Nodeid nidParent2) { |
| 118 boolean descendant = false; | 118 boolean descendant = false; |
| 119 if (!nidParent1.isNull() && parents2consider.contains(nidParent1)) { | 119 if (!nidParent1.isNull() && parents2consider.contains(nidParent1)) { |
| 120 parents2consider.add(nidParent1); | 120 parents2consider.add(revision); |
| 121 descendant = true; | 121 descendant = true; |
| 122 } | 122 } |
| 123 if (!nidParent2.isNull() && parents2consider.contains(nidParent2)) { | 123 if (!nidParent2.isNull() && parents2consider.contains(nidParent2)) { |
| 124 parents2consider.add(nidParent2); | 124 parents2consider.add(revision); |
| 125 descendant = true; | 125 descendant = true; |
| 126 } | 126 } |
| 127 if (descendant && revisionIndex == csetRevIndex) { | 127 if (descendant && revisionIndex == csetRevIndex) { |
| 128 // revision of interest descends from one of the roots | 128 // revision of interest descends from one of the roots |
| 129 result[0] = true; | 129 result[0] = true; |
