comparison src/org/tmatesoft/hg/core/HgLogCommand.java @ 231:1792b37650f2

Introduced access to conflict resolution information (merge state)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 01 Jun 2011 05:44:25 +0200
parents 41a778e3fd31
children 6e1373b54e9b
comparison
equal deleted inserted replaced
230:0dd9da7489dc 231:1792b37650f2
213 csetTransform.checkFailure(); 213 csetTransform.checkFailure();
214 if (fileNode.isCopy()) { 214 if (fileNode.isCopy()) {
215 // even if we do not follow history, report file rename 215 // even if we do not follow history, report file rename
216 do { 216 do {
217 if (handler instanceof FileHistoryHandler) { 217 if (handler instanceof FileHistoryHandler) {
218 FileRevision src = new FileRevision(repo, fileNode.getCopySourceRevision(), fileNode.getCopySourceName()); 218 HgFileRevision src = new HgFileRevision(repo, fileNode.getCopySourceRevision(), fileNode.getCopySourceName());
219 FileRevision dst = new FileRevision(repo, fileNode.getRevision(0), fileNode.getPath()); 219 HgFileRevision dst = new HgFileRevision(repo, fileNode.getRevision(0), fileNode.getPath());
220 try { 220 try {
221 ((FileHistoryHandler) handler).copy(src, dst); 221 ((FileHistoryHandler) handler).copy(src, dst);
222 } catch (RuntimeException ex) { 222 } catch (RuntimeException ex) {
223 throw new HgCallbackTargetException(ex).setRevision(fileNode.getCopySourceRevision()).setFileName(fileNode.getCopySourceName()); 223 throw new HgCallbackTargetException(ex).setRevision(fileNode.getCopySourceRevision()).setFileName(fileNode.getCopySourceName());
224 } 224 }
313 public void next(HgChangeset changeset) { 313 public void next(HgChangeset changeset) {
314 result.add(changeset.clone()); 314 result.add(changeset.clone());
315 } 315 }
316 } 316 }
317 317
318 public static final class FileRevision { 318 /**
319 private final HgRepository repo; 319 * @deprecated pulled up, use {@link HgFileRevision} instead.
320 private final Nodeid revision; 320 */
321 private final Path path; 321 @Deprecated
322 322 public interface FileRevision {
323 /*package-local*/FileRevision(HgRepository hgRepo, Nodeid rev, Path p) { 323 public abstract Path getPath();
324 if (hgRepo == null || rev == null || p == null) { 324 public abstract Nodeid getRevision();
325 // since it's package local, it is our code to blame for non validated arguments 325 public abstract void putContentTo(ByteChannel sink) throws HgDataStreamException, IOException, CancelledException;
326 throw new HgBadStateException();
327 }
328 repo = hgRepo;
329 revision = rev;
330 path = p;
331 }
332
333 public Path getPath() {
334 return path;
335 }
336 public Nodeid getRevision() {
337 return revision;
338 }
339 public void putContentTo(ByteChannel sink) throws HgDataStreamException, IOException, CancelledException {
340 HgDataFile fn = repo.getFileNode(path);
341 int localRevision = fn.getLocalRevision(revision);
342 fn.contentWithFilters(localRevision, sink);
343 }
344 } 326 }
345 } 327 }