comparison src/org/tmatesoft/hg/core/HgOutgoingCommand.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 2f9ed6bcefa2
children 629a7370554c
comparison
equal deleted inserted replaced
627:5153eb73b18d 628:6526d8adbc0f
1 /* 1 /*
2 * Copyright (c) 2011-2012 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 *
21 import java.util.TreeSet; 21 import java.util.TreeSet;
22 22
23 import org.tmatesoft.hg.internal.Internals; 23 import org.tmatesoft.hg.internal.Internals;
24 import org.tmatesoft.hg.internal.RepositoryComparator; 24 import org.tmatesoft.hg.internal.RepositoryComparator;
25 import org.tmatesoft.hg.repo.HgChangelog; 25 import org.tmatesoft.hg.repo.HgChangelog;
26 import org.tmatesoft.hg.repo.HgInvalidControlFileException; 26 import org.tmatesoft.hg.repo.HgParentChildMap;
27 import org.tmatesoft.hg.repo.HgRemoteRepository; 27 import org.tmatesoft.hg.repo.HgRemoteRepository;
28 import org.tmatesoft.hg.repo.HgRepository; 28 import org.tmatesoft.hg.repo.HgRepository;
29 import org.tmatesoft.hg.repo.HgRuntimeException; 29 import org.tmatesoft.hg.repo.HgRuntimeException;
30 import org.tmatesoft.hg.repo.HgParentChildMap;
31 import org.tmatesoft.hg.util.CancelSupport; 30 import org.tmatesoft.hg.util.CancelSupport;
32 import org.tmatesoft.hg.util.CancelledException; 31 import org.tmatesoft.hg.util.CancelledException;
33 import org.tmatesoft.hg.util.ProgressSupport; 32 import org.tmatesoft.hg.util.ProgressSupport;
34 33
35 /** 34 /**
139 } finally { 138 } finally {
140 ps.done(); 139 ps.done();
141 } 140 }
142 } 141 }
143 142
144 private RepositoryComparator getComparator(ProgressSupport ps, CancelSupport cs) throws HgRemoteConnectionException, HgInvalidControlFileException, CancelledException { 143 private RepositoryComparator getComparator(ProgressSupport ps, CancelSupport cs) throws HgRemoteConnectionException, CancelledException, HgRuntimeException {
145 if (remoteRepo == null) { 144 if (remoteRepo == null) {
146 throw new IllegalArgumentException("Shall specify remote repository to compare against"); 145 throw new IllegalArgumentException("Shall specify remote repository to compare against");
147 } 146 }
148 if (comparator == null) { 147 if (comparator == null) {
149 comparator = new RepositoryComparator(getParentHelper(), remoteRepo); 148 comparator = new RepositoryComparator(getParentHelper(), remoteRepo);
150 comparator.compare(ps, cs); 149 comparator.compare(ps, cs);
151 } 150 }
152 return comparator; 151 return comparator;
153 } 152 }
154 153
155 private HgParentChildMap<HgChangelog> getParentHelper() throws HgInvalidControlFileException { 154 private HgParentChildMap<HgChangelog> getParentHelper() throws HgRuntimeException {
156 if (parentHelper == null) { 155 if (parentHelper == null) {
157 parentHelper = new HgParentChildMap<HgChangelog>(localRepo.getChangelog()); 156 parentHelper = new HgParentChildMap<HgChangelog>(localRepo.getChangelog());
158 parentHelper.init(); 157 parentHelper.init();
159 } 158 }
160 return parentHelper; 159 return parentHelper;