Mercurial > jhg
diff src/org/tmatesoft/hg/internal/Internals.java @ 647:c75297c17867
Location of repository files as enumeration, use file constants instead of plain names
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 25 Jun 2013 18:53:18 +0200 |
parents | a8ce405da1f5 |
children | 46b56864b483 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java Fri Jun 21 18:30:35 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/Internals.java Tue Jun 25 18:53:18 2013 +0200 @@ -150,12 +150,16 @@ } public File getRepositoryFile(HgRepositoryFiles f) { - return f.residesUnderRepositoryRoot() ? getFileFromRepoDir(f.getName()) : new File(repo.getWorkingDir(), f.getName()); + switch (f.getHome()) { + case Store : return getFileFromStoreDir(f.getName()); + case Repo : return getFileFromRepoDir(f.getName()); + default : return new File(repo.getWorkingDir(), f.getName()); + } } /** * Access files under ".hg/". - * File not necessarily exists, this method is merely a factory for Files at specific, configuration-dependent location. + * File not necessarily exists, this method is merely a factory for {@link File files} at specific, configuration-dependent location. * * @param name shall be normalized path */