def __init__(self, repo): self._opener = repo.opener self._ui = repo.ui self._rootdir = pathutil.normasprefix(repo.root) self._lastclock = None self.mode = self._ui.config('fsmonitor', 'mode', default='on') self.walk_on_invalidate = self._ui.configbool( 'fsmonitor', 'walk_on_invalidate', False) self.timeout = float(self._ui.config( 'fsmonitor', 'timeout', default='2'))
def __init__(self, repo): self._vfs = repo.vfs self._ui = repo.ui self._rootdir = pathutil.normasprefix(repo.root) self._lastclock = None self._identity = util.filestat(None) self.mode = self._ui.config('fsmonitor', 'mode') self.walk_on_invalidate = self._ui.configbool('fsmonitor', 'walk_on_invalidate') self.timeout = float(self._ui.config('fsmonitor', 'timeout'))
def __init__(self, repo, ui, root): self._repo = repo self.eden_client = EdenThriftClient(repo) self._ui = ui self._root = root self._rootdir = pathutil.normasprefix(root) self._current_node_id = None # Store a vanilla dirstate object, so we can re-use some of its # functionality in a handful of cases. Primarily this is just for cwd # and path computation. self._normaldirstate = dirstatemod.dirstate(opener=None, ui=self._ui, root=self._root, validate=None) self._parentwriters = 0
def walk(self, path=None, onerror=None): """Yield (dirpath, [], oids) tuple for blobs under path Oids only exist in the root of this vfs, so dirpath is always ''. """ root = os.path.normpath(self.base) # when dirpath == root, dirpath[prefixlen:] becomes empty # because len(dirpath) < prefixlen. prefixlen = len(pathutil.normasprefix(root)) oids = [] for dirpath, dirs, files in os.walk(self.reljoin(self.base, path or ''), onerror=onerror): dirpath = dirpath[prefixlen:] # Silently skip unexpected files and directories if len(dirpath) == 2: oids.extend([dirpath + f for f in files if _lfsre.match(dirpath + f)]) yield ('', [], oids)