Mercurial > hg4j
diff 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 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgLookup.java Tue Mar 22 21:18:40 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgLookup.java Wed Mar 23 14:13:11 2011 +0100 @@ -20,6 +20,7 @@ import java.io.IOException; import org.tmatesoft.hg.core.HgException; +import org.tmatesoft.hg.internal.DataAccessProvider; /** * Utility methods to find Mercurial repository at a given location @@ -61,4 +62,11 @@ throw new HgException(location.toString(), ex); } } + + public HgBundle loadBundle(File location) throws HgException { + if (location == null || !location.canRead()) { + throw new IllegalArgumentException(); + } + return new HgBundle(new DataAccessProvider(), location); + } }