Mercurial > jhg
comparison src/org/tmatesoft/hg/core/Cset.java @ 124:cea84c5995e6
Changeset to access parent nodeids
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 15 Feb 2011 06:30:05 +0100 |
parents | a3a2e5deb320 |
children | 26ad21b250e4 |
comparison
equal
deleted
inserted
replaced
123:4f509f5bc8cb | 124:cea84c5995e6 |
---|---|
115 initFileChanges(); | 115 initFileChanges(); |
116 } | 116 } |
117 return deletedFiles; | 117 return deletedFiles; |
118 } | 118 } |
119 | 119 |
120 // XXX do I need boolean isMergeRevision()? | |
121 | |
122 public Nodeid getFirstParentRevision() { | |
123 // XXX may read once for both p1 and p2 | |
124 // or use ParentWalker to minimize reads even more. | |
125 byte[] p1 = new byte[20]; | |
126 statusHelper.getRepo().getChangelog().parents(revNumber, new int[2], p1, null); | |
127 return Nodeid.fromBinary(p1, 0); | |
128 } | |
129 | |
130 public Nodeid getSecondParentRevision() { | |
131 byte[] p2 = new byte[20]; | |
132 statusHelper.getRepo().getChangelog().parents(revNumber, new int[2], null, p2); | |
133 return Nodeid.fromBinary(p2, 0); | |
134 } | |
135 | |
120 @Override | 136 @Override |
121 public Cset clone() { | 137 public Cset clone() { |
122 try { | 138 try { |
123 Cset copy = (Cset) super.clone(); | 139 Cset copy = (Cset) super.clone(); |
124 copy.changeset = changeset.clone(); | 140 copy.changeset = changeset.clone(); |
148 throw new IllegalArgumentException(); | 164 throw new IllegalArgumentException(); |
149 } | 165 } |
150 added.add(new FileRevision(repo, nid, s)); | 166 added.add(new FileRevision(repo, nid, s)); |
151 } | 167 } |
152 for (Path s : r.getRemoved()) { | 168 for (Path s : r.getRemoved()) { |
169 // with Path from getRemoved, may just copy | |
153 deleted.add(s); | 170 deleted.add(s); |
154 } | 171 } |
155 modified.trimToSize(); | 172 modified.trimToSize(); |
156 added.trimToSize(); | 173 added.trimToSize(); |
157 deleted.trimToSize(); | 174 deleted.trimToSize(); |