Mercurial > hg4j
diff src/org/tmatesoft/hg/repo/HgLookup.java @ 172:87f40938c9b2
Configuration handling out of HgLookup (bad idea to use URL to pass keys)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 25 Mar 2011 00:13:37 +0100 |
parents | 2c3e96674e2a |
children | cd3371670f0b |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgLookup.java Fri Mar 25 00:05:52 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgLookup.java Fri Mar 25 00:13:37 2011 +0100 @@ -18,13 +18,10 @@ import java.io.File; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URL; import org.tmatesoft.hg.core.HgException; -import org.tmatesoft.hg.internal.ConfigFile; import org.tmatesoft.hg.internal.DataAccessProvider; -import org.tmatesoft.hg.internal.Internals; /** * Utility methods to find Mercurial repository at a given location @@ -81,21 +78,6 @@ if (Boolean.FALSE.booleanValue()) { throw HgRepository.notImplemented(); } - if (url.getProtocol() == null) { - // try configuration keys - String key = url.getHost(); - ConfigFile cfg = new Internals().newConfigFile(); - cfg.addLocation(new File(System.getProperty("user.home"), ".hgrc")); - String server = cfg.getSection("paths").get(key); - if (server == null) { - throw new HgException(String.format("Can't find server %s specification in the config", key)); - } - try { - url = new URL(server); - } catch (MalformedURLException ex) { - throw new HgException(ex); - } - } return new HgRemoteRepository(url); } }