Mercurial > hg4j
diff src/org/tmatesoft/hg/core/HgIncomingCommand.java @ 366:189dc6dc1c3e
Use exceptions to expose errors reading mercurial data
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 16 Dec 2011 04:43:18 +0100 |
parents | d68dcb3b5f49 |
children | 9517df1ef7ec |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/core/HgIncomingCommand.java Sun Dec 11 00:39:07 2011 +0100 +++ b/src/org/tmatesoft/hg/core/HgIncomingCommand.java Fri Dec 16 04:43:18 2011 +0100 @@ -100,9 +100,10 @@ * * @return list of nodes present at remote and missing locally * @throws HgRemoteConnectionException when failed to communicate with remote repository + * @throws HgInvalidControlFileException FIXME * @throws CancelledException */ - public List<Nodeid> executeLite() throws HgRemoteConnectionException, CancelledException { + public List<Nodeid> executeLite() throws HgRemoteConnectionException, HgInvalidControlFileException, CancelledException { LinkedHashSet<Nodeid> result = new LinkedHashSet<Nodeid>(); RepositoryComparator repoCompare = getComparator(); for (BranchChain bc : getMissingBranches()) { @@ -121,11 +122,12 @@ * Full information about incoming changes * * @throws HgRemoteConnectionException when failed to communicate with remote repository + * @throws HgInvalidControlFileException FIXME * @throws HgInvalidFileException to indicate failure working with locally downloaded changes in a bundle file * @throws HgCallbackTargetException to re-throw exception from the handler * @throws CancelledException */ - public void executeFull(final HgChangesetHandler handler) throws HgRemoteConnectionException, HgInvalidFileException, HgCallbackTargetException, CancelledException { + public void executeFull(final HgChangesetHandler handler) throws HgRemoteConnectionException, HgInvalidControlFileException, HgInvalidFileException, HgCallbackTargetException, CancelledException { if (handler == null) { throw new IllegalArgumentException("Delegate can't be null"); } @@ -161,7 +163,7 @@ } } - private RepositoryComparator getComparator() throws CancelledException { + private RepositoryComparator getComparator() throws HgInvalidControlFileException, CancelledException { if (remoteRepo == null) { throw new IllegalArgumentException("Shall specify remote repository to compare against", null); } @@ -172,7 +174,7 @@ return comparator; } - private HgChangelog.ParentWalker getParentHelper() { + private HgChangelog.ParentWalker getParentHelper() throws HgInvalidControlFileException { if (parentHelper == null) { parentHelper = localRepo.getChangelog().new ParentWalker(); parentHelper.init(); @@ -180,14 +182,14 @@ return parentHelper; } - private List<BranchChain> getMissingBranches() throws HgRemoteConnectionException, CancelledException { + private List<BranchChain> getMissingBranches() throws HgRemoteConnectionException, HgInvalidControlFileException, CancelledException { if (missingBranches == null) { missingBranches = getComparator().calculateMissingBranches(); } return missingBranches; } - private List<Nodeid> getCommon() throws HgRemoteConnectionException, CancelledException { + private List<Nodeid> getCommon() throws HgRemoteConnectionException, HgInvalidControlFileException, CancelledException { // return getComparator(context).getCommon(); final LinkedHashSet<Nodeid> common = new LinkedHashSet<Nodeid>(); // XXX common can be obtained from repoCompare, but at the moment it would almost duplicate work of calculateMissingBranches