comparison src/org/tmatesoft/hg/repo/HgLookup.java @ 151:305ee74c0aa6

[2] do not rely clients supplied us absolute path
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 24 Feb 2011 20:14:11 +0100
parents 1a7a9a20e1f9
children 8c8e3f372fa1
comparison
equal deleted inserted replaced
150:6b55f10ef54b 151:305ee74c0aa6
37 return detect(new File(location)); 37 return detect(new File(location));
38 } 38 }
39 39
40 // look up in specified location and above 40 // look up in specified location and above
41 public HgRepository detect(File location) throws HgException { 41 public HgRepository detect(File location) throws HgException {
42 File dir = location; 42 File dir = location.getAbsoluteFile();
43 File repository; 43 File repository;
44 do { 44 do {
45 repository = new File(dir, ".hg"); 45 repository = new File(dir, ".hg");
46 if (repository.exists() && repository.isDirectory()) { 46 if (repository.exists() && repository.isDirectory()) {
47 break; 47 break;