Exemplo n.º 1
0
        public HgStore CreateInstance(string storeBasePath, HgRequirements hgRequirements, HgFileSystem hgFileSystem, HgEncoder hgEncoder)
        {
            var hgStore = CreateInstanceInternal(storeBasePath, hgRequirements, hgFileSystem, hgEncoder);
            
            if(hgRequirements.Requires(HgRequirements.Largefiles))
                hgStore = new HgLargefileEnabledStore(hgStore);

            return hgStore;
        }
Exemplo n.º 2
0
        private HgStore CreateInstanceInternal(string storeBasePath, HgRequirements hgRequirements, HgFileSystem hgFileSystem, HgEncoder hgEncoder)
        {
            log.Trace("creating HgStore with requirements '{0}' for repository at '{1}'", string.Join("', '", hgRequirements.Requirements), storeBasePath);

            if(hgRequirements.Requires(HgRequirements.Store))
            {
                if(hgRequirements.Requires(HgRequirements.FnCache))
                {
                    log.Trace("creating HgFnCacheStore");

                    var encodings = HgPathEncodings.FnCache;
                    if(hgRequirements.Requires(HgRequirements.DotEncode))
                        encodings |= HgPathEncodings.DotEncode;

                    return new HgFnCacheStore(encodings, hgEncoder, storeBasePath, hgFileSystem);
                } // if

                log.Trace("creating HgEncodedStore");
                return new HgEncodedStore(hgEncoder, storeBasePath, hgFileSystem);
            }
            
            log.Trace("creating HgBasicStore");
            return new HgBasicStore(hgEncoder, storeBasePath, hgFileSystem);
        }