comparison src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 425:48f993aa2f41

FIXMEs: exceptions, javadoc
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 28 Mar 2012 18:39:29 +0200
parents 9c9c442b5f2e
children ead6c67f3319
comparison
equal deleted inserted replaced
424:6437d261048a 425:48f993aa2f41
46 import javax.net.ssl.TrustManager; 46 import javax.net.ssl.TrustManager;
47 import javax.net.ssl.X509TrustManager; 47 import javax.net.ssl.X509TrustManager;
48 48
49 import org.tmatesoft.hg.core.HgBadArgumentException; 49 import org.tmatesoft.hg.core.HgBadArgumentException;
50 import org.tmatesoft.hg.core.HgRemoteConnectionException; 50 import org.tmatesoft.hg.core.HgRemoteConnectionException;
51 import org.tmatesoft.hg.core.HgRepositoryNotFoundException;
51 import org.tmatesoft.hg.core.Nodeid; 52 import org.tmatesoft.hg.core.Nodeid;
52 import org.tmatesoft.hg.core.SessionContext; 53 import org.tmatesoft.hg.core.SessionContext;
53 54
54 /** 55 /**
55 * WORK IN PROGRESS, DO NOT USE 56 * WORK IN PROGRESS, DO NOT USE
324 * 325 *
325 * according to latter, bundleformat data is sent through zlib 326 * according to latter, bundleformat data is sent through zlib
326 * (there's no header like HG10?? with the server output, though, 327 * (there's no header like HG10?? with the server output, though,
327 * as one may expect according to http://mercurial.selenic.com/wiki/BundleFormat) 328 * as one may expect according to http://mercurial.selenic.com/wiki/BundleFormat)
328 */ 329 */
329 public HgBundle getChanges(List<Nodeid> roots) throws HgRemoteConnectionException, HgInvalidFileException { 330 public HgBundle getChanges(List<Nodeid> roots) throws HgRemoteConnectionException, HgRuntimeException {
330 List<Nodeid> _roots = roots.isEmpty() ? Collections.singletonList(Nodeid.NULL) : roots; 331 List<Nodeid> _roots = roots.isEmpty() ? Collections.singletonList(Nodeid.NULL) : roots;
331 StringBuilder sb = new StringBuilder(20 + _roots.size() * 41); 332 StringBuilder sb = new StringBuilder(20 + _roots.size() * 41);
332 sb.append("roots="); 333 sb.append("roots=");
333 for (Nodeid n : _roots) { 334 for (Nodeid n : _roots) {
334 sb.append(n.toString()); 335 sb.append(n.toString());
352 return getLookupHelper().loadBundle(tf); 353 return getLookupHelper().loadBundle(tf);
353 } catch (MalformedURLException ex) { // XXX in fact, this exception might be better to be re-thrown as RuntimeEx, 354 } catch (MalformedURLException ex) { // XXX in fact, this exception might be better to be re-thrown as RuntimeEx,
354 // as there's little user can do about this issue (URLs are constructed by our code) 355 // as there's little user can do about this issue (URLs are constructed by our code)
355 throw new HgRemoteConnectionException("Bad URL", ex).setRemoteCommand("changegroup").setServerInfo(getLocation()); 356 throw new HgRemoteConnectionException("Bad URL", ex).setRemoteCommand("changegroup").setServerInfo(getLocation());
356 } catch (IOException ex) { 357 } catch (IOException ex) {
358 throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("changegroup").setServerInfo(getLocation());
359 } catch (HgRepositoryNotFoundException ex) {
357 throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("changegroup").setServerInfo(getLocation()); 360 throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("changegroup").setServerInfo(getLocation());
358 } 361 }
359 } 362 }
360 363
361 @Override 364 @Override