Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/Internals.java @ 608:e1b29756f901
Clean, organize and resolve some TODOs and FIXMEs: minor refactorings and comments
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 07 May 2013 21:27:51 +0200 |
parents | e447384f3771 |
children | 5c68567b3645 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/Internals.java Tue May 07 16:52:46 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/Internals.java Tue May 07 21:27:51 2013 +0200 @@ -125,6 +125,7 @@ private final PathRewrite dataPathHelper; // access to file storage area (usually under .hg/store/data/), with filenames mangled private final PathRewrite repoPathHelper; // access to system files (under .hg/store if requires has 'store' flag) + private final boolean shallMergePatches; private final RevlogStreamFactory streamProvider; public Internals(HgRepository hgRepo, File hgDir, ImplAccess implementationAccess) throws HgRuntimeException { @@ -138,8 +139,10 @@ requiresFlags = repoInit.getRequires(); dataPathHelper = repoInit.buildDataFilesHelper(getSessionContext()); repoPathHelper = repoInit.buildStoreFilesHelper(); - boolean shallCacheRevlogsInRepo = new PropertyMarshal(ctx).getBoolean(CFG_PROPERTY_REVLOG_STREAM_CACHE, true); + final PropertyMarshal pm = new PropertyMarshal(ctx); + boolean shallCacheRevlogsInRepo = pm.getBoolean(CFG_PROPERTY_REVLOG_STREAM_CACHE, true); streamProvider = new RevlogStreamFactory(this, shallCacheRevlogsInRepo); + shallMergePatches = pm.getBoolean(Internals.CFG_PROPERTY_PATCH_MERGE, false); } public boolean isInvalid() { @@ -266,6 +269,16 @@ return requiresFlags; } + boolean shallMergePatches() { + return shallMergePatches; + } + + RevlogChangeMonitor getRevlogTracker(File f) { + // TODO decide whether to use one monitor per multiple files or + // an instance per file; and let SessionContext pass alternative implementation) + return new RevlogChangeMonitor(f); + } + public static boolean runningOnWindows() { return System.getProperty("os.name").indexOf("Windows") != -1; } @@ -390,7 +403,7 @@ if (f.canRead() && f.isDirectory()) { return listConfigFiles(f); } - // TODO post-1.0 query registry, e.g. with + // TODO [post-1.1] query registry, e.g. with // Runtime.exec("reg query HKLM\Software\Mercurial") // f = new File("C:\\Mercurial\\Mercurial.ini");