Mercurial > hg4j
comparison src/org/tmatesoft/hg/core/HgUpdateConfigCommand.java @ 493:ba36f66c32b4
Refactor to keep knowledge about repository control files and their location in respect to .hg/ in a single place (facilitate future adoption of shared repositories)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 18 Oct 2012 18:36:13 +0200 |
parents | b3c16d1aede0 |
children | 0205a5c4566b |
comparison
equal
deleted
inserted
replaced
492:e4eaa23e3442 | 493:ba36f66c32b4 |
---|---|
50 configFile = configurationFile; | 50 configFile = configurationFile; |
51 } | 51 } |
52 | 52 |
53 public static HgUpdateConfigCommand forRepository(HgRepository hgRepo) { | 53 public static HgUpdateConfigCommand forRepository(HgRepository hgRepo) { |
54 // XXX HgRepository to implement SessionContext.Provider (with getContext())? | 54 // XXX HgRepository to implement SessionContext.Provider (with getContext())? |
55 return new HgUpdateConfigCommand(hgRepo.getSessionContext(), new File(HgInternals.getRepositoryDir(hgRepo), "hgrc")); | 55 return new HgUpdateConfigCommand(hgRepo.getSessionContext(), HgInternals.getImplementationRepo(hgRepo).getFileFromRepoDir("hgrc")); |
56 } | 56 } |
57 | 57 |
58 public static HgUpdateConfigCommand forUser(SessionContext ctx) { | 58 public static HgUpdateConfigCommand forUser(SessionContext ctx) { |
59 return new HgUpdateConfigCommand(ctx, Internals.getUserConfigurationFileToWrite(ctx)); | 59 return new HgUpdateConfigCommand(ctx, Internals.getUserConfigurationFileToWrite(ctx)); |
60 } | 60 } |