Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/ChangelogHelper.java @ 628:6526d8adbc0f
Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 22 May 2013 15:52:31 +0200 |
parents | 9c9c442b5f2e |
children |
comparison
equal
deleted
inserted
replaced
627:5153eb73b18d | 628:6526d8adbc0f |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 TMate Software Ltd | 2 * Copyright (c) 2011-2013 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
17 package org.tmatesoft.hg.internal; | 17 package org.tmatesoft.hg.internal; |
18 | 18 |
19 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 19 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
20 import org.tmatesoft.hg.repo.HgDataFile; | 20 import org.tmatesoft.hg.repo.HgDataFile; |
21 import org.tmatesoft.hg.repo.HgInternals; | 21 import org.tmatesoft.hg.repo.HgInternals; |
22 import org.tmatesoft.hg.repo.HgInvalidControlFileException; | |
23 import org.tmatesoft.hg.repo.HgRepository; | 22 import org.tmatesoft.hg.repo.HgRepository; |
23 import org.tmatesoft.hg.repo.HgRuntimeException; | |
24 import org.tmatesoft.hg.util.Path; | 24 import org.tmatesoft.hg.util.Path; |
25 | 25 |
26 /** | 26 /** |
27 * | 27 * |
28 * @author Artem Tikhomirov | 28 * @author Artem Tikhomirov |
54 /** | 54 /** |
55 * Walks changelog in reverse order | 55 * Walks changelog in reverse order |
56 * @param file | 56 * @param file |
57 * @return changeset where specified file is mentioned among affected files, or <code>null</code> if none found up to leftBoundary | 57 * @return changeset where specified file is mentioned among affected files, or <code>null</code> if none found up to leftBoundary |
58 */ | 58 */ |
59 public RawChangeset findLatestChangeWith(Path file) throws HgInvalidControlFileException { | 59 public RawChangeset findLatestChangeWith(Path file) throws HgRuntimeException { |
60 HgDataFile df = repo.getFileNode(file); | 60 HgDataFile df = repo.getFileNode(file); |
61 if (!df.exists()) { | 61 if (!df.exists()) { |
62 return null; | 62 return null; |
63 } | 63 } |
64 int changelogRev = df.getChangesetRevisionIndex(HgRepository.TIP); | 64 int changelogRev = df.getChangesetRevisionIndex(HgRepository.TIP); |