Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgLookup.java @ 169:8c8e3f372fa1
Towards initial clone: refactor HgBundle to provide slightly higher-level structure of the bundle
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 23 Mar 2011 14:13:11 +0100 |
parents | 305ee74c0aa6 |
children | 71ddbf8603e8 |
comparison
equal
deleted
inserted
replaced
168:dd525ca65de8 | 169:8c8e3f372fa1 |
---|---|
18 | 18 |
19 import java.io.File; | 19 import java.io.File; |
20 import java.io.IOException; | 20 import java.io.IOException; |
21 | 21 |
22 import org.tmatesoft.hg.core.HgException; | 22 import org.tmatesoft.hg.core.HgException; |
23 import org.tmatesoft.hg.internal.DataAccessProvider; | |
23 | 24 |
24 /** | 25 /** |
25 * Utility methods to find Mercurial repository at a given location | 26 * Utility methods to find Mercurial repository at a given location |
26 * | 27 * |
27 * @author Artem Tikhomirov | 28 * @author Artem Tikhomirov |
59 return new HgRepository(repoPath, repository); | 60 return new HgRepository(repoPath, repository); |
60 } catch (IOException ex) { | 61 } catch (IOException ex) { |
61 throw new HgException(location.toString(), ex); | 62 throw new HgException(location.toString(), ex); |
62 } | 63 } |
63 } | 64 } |
65 | |
66 public HgBundle loadBundle(File location) throws HgException { | |
67 if (location == null || !location.canRead()) { | |
68 throw new IllegalArgumentException(); | |
69 } | |
70 return new HgBundle(new DataAccessProvider(), location); | |
71 } | |
64 } | 72 } |