def makeunionstores(self): """Union stores iterate the other stores and return the first result.""" repo = self.repo self.shareddatastores = [] self.sharedhistorystores = [] self.localdatastores = [] self.localhistorystores = [] cachecontent = [] cachemetadata = [] localcontent = [] localmetadata = [] spackcontent, spackmetadata, lpackcontent, lpackmetadata = self.makepackstores() cachecontent += [spackcontent] cachemetadata += [spackmetadata] localcontent += [lpackcontent] localmetadata += [lpackmetadata] mutablelocalstore = mutablestores.mutabledatahistorystore( lambda: self._mutablelocalpacks ) mutablesharedstore = mutablestores.mutabledatahistorystore( lambda: self._mutablesharedpacks ) sharedcontentstores = [spackcontent, mutablesharedstore] sharedmetadatastores = [spackmetadata, mutablesharedstore] if self.ui.configbool("remotefilelog", "indexedlogdatastore"): path = shallowutil.getindexedlogdatastorepath(repo) mask = os.umask(0o002) try: store = revisionstore.indexedlogdatastore(path) sharedcontentstores.append(store) self.shareddatastores.append(store) finally: os.umask(mask) if self.ui.configbool("remotefilelog", "indexedloghistorystore"): path = shallowutil.getindexedloghistorystorepath(repo) mask = os.umask(0o002) try: store = revisionstore.indexedloghistorystore(path) sharedmetadatastores.append(store) self.sharedhistorystores.append(store) finally: os.umask(mask) sunioncontentstore = unioncontentstore(*sharedcontentstores) sunionmetadatastore = unionmetadatastore(*sharedmetadatastores) remotecontent, remotemetadata = self.makeremotestores( sunioncontentstore, sunionmetadatastore ) contentstores = ( sharedcontentstores + cachecontent + localcontent + [mutablelocalstore, remotecontent] ) metadatastores = ( sharedmetadatastores + cachemetadata + localmetadata + [mutablelocalstore, remotemetadata] ) # Instantiate union stores self.contentstore = unioncontentstore(*contentstores) self.metadatastore = unionmetadatastore(*metadatastores) repo.fileservice.setstore(self.contentstore, self.metadatastore) shallowutil.reportpackmetrics( repo.ui, "filestore", spackcontent, spackmetadata, lpackcontent, lpackmetadata, )
def debugindexedloghistorystore(ui, paths, **opts): for path in paths: store = revisionstore.indexedloghistorystore(path) debughistorystore(ui, store, **opts)
def debugindexedloghistorystore(ui, paths, **opts): for path in paths: store = revisionstore.indexedloghistorystore(path, ui._uiconfig._rcfg._rcfg) debughistorystore(ui, store, **opts)