Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgDataFile.java @ 415:ee8264d80747
Explicit constant for regular file flags, access to flags for a given file revision
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 22 Mar 2012 18:54:11 +0100 |
parents | a57a21aa4190 |
children | d30083c80d52 |
comparison
equal
deleted
inserted
replaced
414:bb278ccf9866 | 415:ee8264d80747 |
---|---|
526 return Path.create(metadata.find(0, "copy")); | 526 return Path.create(metadata.find(0, "copy")); |
527 } | 527 } |
528 throw new UnsupportedOperationException(); // XXX REVISIT, think over if Exception is good (clients would check isCopy() anyway, perhaps null is sufficient?) | 528 throw new UnsupportedOperationException(); // XXX REVISIT, think over if Exception is good (clients would check isCopy() anyway, perhaps null is sufficient?) |
529 } | 529 } |
530 | 530 |
531 /** | |
532 * | |
533 * @return revision this file was copied from | |
534 * @throws HgInvalidControlFileException if access to revlog or file metadata failed | |
535 * @throws UnsupportedOperationException if this file doesn't represent a copy ({@link #isCopy()} was false) | |
536 */ | |
531 public Nodeid getCopySourceRevision() throws HgInvalidControlFileException { | 537 public Nodeid getCopySourceRevision() throws HgInvalidControlFileException { |
532 if (isCopy()) { | 538 if (isCopy()) { |
533 return Nodeid.fromAscii(metadata.find(0, "copyrev")); // XXX reuse/cache Nodeid | 539 return Nodeid.fromAscii(metadata.find(0, "copyrev")); // XXX reuse/cache Nodeid |
534 } | 540 } |
535 throw new UnsupportedOperationException(); | 541 throw new UnsupportedOperationException(); |
536 } | 542 } |
537 | 543 /* FIXME |
544 public Nodeid getRevisionAtChangeset(int changesetRevision) { | |
545 } | |
546 | |
547 public HgManifest.Flags getFlagsAtChangeset(int changesetRevisionIndex) { | |
548 } | |
549 */ | |
550 | |
551 /** | |
552 * FIXME EXCEPTIONS | |
553 * @throws HgInvalidControlFileException | |
554 * @throws HgInvalidRevisionException | |
555 */ | |
556 public HgManifest.Flags getFlags(int fileRevisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException { | |
557 int changesetRevIndex = getChangesetRevisionIndex(fileRevisionIndex); | |
558 return getRepo().getManifest().extractFlags(changesetRevIndex, getPath()); | |
559 } | |
560 | |
538 @Override | 561 @Override |
539 public String toString() { | 562 public String toString() { |
540 StringBuilder sb = new StringBuilder(getClass().getSimpleName()); | 563 StringBuilder sb = new StringBuilder(getClass().getSimpleName()); |
541 sb.append('('); | 564 sb.append('('); |
542 sb.append(getPath()); | 565 sb.append(getPath()); |