diff --git a/treemanifest/__init__.py b/treemanifest/__init__.py --- a/treemanifest/__init__.py +++ b/treemanifest/__init__.py @@ -277,8 +277,8 @@ except OSError: pass -def setuptreestores(repo, mfl): - if repo.ui.configbool("treemanifest", "server"): +def setuptreestores(ui, repo, mfl): + if ui.configbool('treemanifest', 'server'): packpath = repo.vfs.join('cache/packs/%s' % PACK_CATEGORY) # Data store @@ -287,7 +287,7 @@ mfl.datastore = unioncontentstore(datastore, revlogstore) # History store - historystore = historypackstore(repo.ui, packpath) + historystore = historypackstore(ui, packpath) mfl.historystore = unionmetadatastore( historystore, revlogstore, @@ -295,10 +295,10 @@ _prunesharedpacks(repo, packpath) return - usecdatapack = repo.ui.configbool('remotefilelog', 'fastdatapack') + usecdatapack = ui.configbool('remotefilelog', 'fastdatapack') if not util.safehasattr(repo, 'name'): - repo.name = repo.ui.config('remotefilelog', 'reponame') + repo.name = ui.config('remotefilelog', 'reponame') packpath = shallowutil.getcachepackpath(repo, PACK_CATEGORY) _prunesharedpacks(repo, packpath) @@ -306,19 +306,19 @@ PACK_CATEGORY) # Data store - if repo.ui.configbool("treemanifest", "usecunionstore"): + if ui.configbool('treemanifest', 'usecunionstore'): datastore = cstore.datapackstore(packpath) localdatastore = cstore.datapackstore(localpackpath) # TODO: can't use remotedatastore with cunionstore yet # TODO make reportmetrics work with cstore mfl.datastore = cstore.uniondatapackstore([localdatastore, datastore]) else: - datastore = datapackstore(repo.ui, packpath, usecdatapack=usecdatapack) - localdatastore = datapackstore(repo.ui, localpackpath, + datastore = datapackstore(ui, packpath, usecdatapack=usecdatapack) + localdatastore = datapackstore(ui, localpackpath, usecdatapack=usecdatapack) stores = [datastore, localdatastore] remotedatastore = remotetreedatastore(repo) - if repo.ui.configbool("treemanifest", "demanddownload", True): + if ui.configbool('treemanifest', 'demanddownload', True): stores.append(remotedatastore) mfl.datastore = unioncontentstore(*stores, @@ -327,11 +327,11 @@ mfl.shareddatastores = [datastore] mfl.localdatastores = [localdatastore] - mfl.ui = repo.ui + mfl.ui = ui # History store - sharedhistorystore = historypackstore(repo.ui, packpath) - localhistorystore = historypackstore(repo.ui, localpackpath) + sharedhistorystore = historypackstore(ui, packpath) + localhistorystore = historypackstore(ui, localpackpath) mfl.sharedhistorystores = [ sharedhistorystore ] @@ -343,7 +343,7 @@ localhistorystore, writestore=localhistorystore, ) - shallowutil.reportpackmetrics(repo.ui, 'treestore', mfl.datastore, + shallowutil.reportpackmetrics(ui, 'treestore', mfl.datastore, mfl.historystore) class treemanifestlog(manifest.manifestlog): @@ -588,11 +588,11 @@ if self.ui.configbool('treemanifest', 'treeonly'): mfl = treeonlymanifestlog(self.svfs) - setuptreestores(self, mfl) + setuptreestores(self.ui, self, mfl) else: mfl = orig(self) mfl.treemanifestlog = treemanifestlog(self.svfs) - setuptreestores(self, mfl.treemanifestlog) + setuptreestores(self.ui, self, mfl.treemanifestlog) mfl.datastore = mfl.treemanifestlog.datastore mfl.historystore = mfl.treemanifestlog.historystore