Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/RepositoryComparator.java @ 215:41a778e3fd31
Issue 5: Facilities for progress and cancellation. More specific exceptions. Exceptions from callbacks as RuntimeException
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 17 May 2011 00:56:54 +0200 |
parents | 6a2481866491 |
children | 9fb50c04f03c |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RepositoryComparator.java Mon May 16 21:10:36 2011 +0200 +++ b/src/org/tmatesoft/hg/internal/RepositoryComparator.java Tue May 17 00:56:54 2011 +0200 @@ -31,6 +31,7 @@ import org.tmatesoft.hg.core.HgBadStateException; import org.tmatesoft.hg.core.HgException; +import org.tmatesoft.hg.core.HgRemoteConnectionException; import org.tmatesoft.hg.core.Nodeid; import org.tmatesoft.hg.repo.HgChangelog; import org.tmatesoft.hg.repo.HgRemoteRepository; @@ -57,9 +58,7 @@ remoteRepo = hgRemote; } - public RepositoryComparator compare(Object context) throws HgException, CancelledException { - ProgressSupport progressSupport = ProgressSupport.Factory.get(context); - CancelSupport cancelSupport = CancelSupport.Factory.get(context); + public RepositoryComparator compare(ProgressSupport progressSupport, CancelSupport cancelSupport) throws HgRemoteConnectionException, CancelledException { cancelSupport.checkCancelled(); progressSupport.start(10); common = Collections.unmodifiableList(findCommonWithRemote()); @@ -126,7 +125,7 @@ changelog.range(earliestRevision+1, changelog.getLastRevision(), inspector); } - private List<Nodeid> findCommonWithRemote() throws HgException { + private List<Nodeid> findCommonWithRemote() throws HgRemoteConnectionException { List<Nodeid> remoteHeads = remoteRepo.heads(); LinkedList<Nodeid> resultCommon = new LinkedList<Nodeid>(); // these remotes are known in local LinkedList<Nodeid> toQuery = new LinkedList<Nodeid>(); // these need further queries to find common @@ -208,7 +207,7 @@ } // somewhat similar to Outgoing.findCommonWithRemote() - public List<BranchChain> calculateMissingBranches() throws HgException { + public List<BranchChain> calculateMissingBranches() throws HgRemoteConnectionException { List<Nodeid> remoteHeads = remoteRepo.heads(); LinkedList<Nodeid> common = new LinkedList<Nodeid>(); // these remotes are known in local LinkedList<Nodeid> toQuery = new LinkedList<Nodeid>(); // these need further queries to find common