comparison src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java @ 429:cd658b24a620

FIXMEs: javadoc, proper use of constants
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 18:29:03 +0200
parents 48f993aa2f41
children 12f668401613
comparison
equal deleted inserted replaced
428:ead6c67f3319 429:cd658b24a620
149 private ManifestRevision getDirstateParentManifest() { 149 private ManifestRevision getDirstateParentManifest() {
150 return dirstateParentManifest; 150 return dirstateParentManifest;
151 } 151 }
152 152
153 /** 153 /**
154 * may be invoked few times, TIP or WORKING_COPY indicate comparison shall be run against working copy parent 154 * Walk working copy, analyze status for each file found and missing.
155 * XXX NOTE, use of TIP constant requires certain care. TIP here doesn't mean latest cset, but actual working copy parent. 155 * May be invoked few times.
156 * 156 *
157 * @param baseRevision 157 * <p>There's no dedicated constant to for working copy parent, at least now.
158 * @param inspector 158 * Use {@link HgRepository#WORKING_COPY} to indicate comparison
159 * shall be run against working copy parent. Although a bit confusing, single case doesn't
160 * justify a dedicated constant.
161 *
162 * @param baseRevision revision index to check against, or {@link HgRepository#WORKING_COPY}. Note, {@link HgRepository#TIP} is not supported.
163 * @param inspector callback to receive status information
159 * @throws IOException to propagate IO errors from {@link FileIterator} 164 * @throws IOException to propagate IO errors from {@link FileIterator}
160 * @throws CancelledException if operation execution was cancelled 165 * @throws CancelledException if operation execution was cancelled
161 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> 166 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
162 */ 167 */
163 public void walk(int baseRevision, HgStatusInspector inspector) throws IOException, CancelledException, HgRuntimeException { 168 public void walk(int baseRevision, HgStatusInspector inspector) throws IOException, CancelledException, HgRuntimeException {
168 getDirstate(); 173 getDirstate();
169 } 174 }
170 if (getDirstateParentManifest() == null) { 175 if (getDirstateParentManifest() == null) {
171 initDirstateParentManifest(); 176 initDirstateParentManifest();
172 } 177 }
178 // XXX NOTE, use of TIP for working copy parent is questionable, at least. Instead, TIP shall mean latest cset or not allowed at all
173 ManifestRevision collect = null; // non null indicates we compare against base revision 179 ManifestRevision collect = null; // non null indicates we compare against base revision
174 Set<Path> baseRevFiles = Collections.emptySet(); // files from base revision not affected by status calculation 180 Set<Path> baseRevFiles = Collections.emptySet(); // files from base revision not affected by status calculation
175 if (baseRevision != TIP && baseRevision != WORKING_COPY) { 181 if (baseRevision != TIP && baseRevision != WORKING_COPY) {
176 collect = getManifest(baseRevision); 182 collect = getManifest(baseRevision);
177 baseRevFiles = new TreeSet<Path>(collect.files()); 183 baseRevFiles = new TreeSet<Path>(collect.files());
283 } 289 }
284 } 290 }
285 } 291 }
286 292
287 /** 293 /**
294 * A {@link #walk(int, HgStatusInspector)} that records all the status information in the {@link HgStatusCollector.Record} object.
288 * 295 *
289 * @param baseRevision 296 * @see #walk(int, HgStatusInspector)
297 * @param baseRevision revision index to check against, or {@link HgRepository#WORKING_COPY}. Note, {@link HgRepository#TIP} is not supported.
290 * @return information object that describes change between the revisions 298 * @return information object that describes change between the revisions
291 * @throws IOException to propagate IO errors from {@link FileIterator} 299 * @throws IOException to propagate IO errors from {@link FileIterator}
292 * @throws CancelledException if operation execution was cancelled
293 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> 300 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
294 */ 301 */
295 public HgStatusCollector.Record status(int baseRevision) throws IOException, HgRuntimeException { 302 public HgStatusCollector.Record status(int baseRevision) throws IOException, HgRuntimeException {
296 HgStatusCollector.Record rv = new HgStatusCollector.Record(); 303 HgStatusCollector.Record rv = new HgStatusCollector.Record();
297 try { 304 try {