Esempio n. 1
0
 def __init__(self, root, url_base, cache_path, manifest_path=None, rebuild=False):
     from gitignore import gitignore
     self.root = os.path.abspath(root)
     self.url_base = url_base
     self.ignore_cache = None
     self.mtime_cache = None
     if cache_path is not None:
         if manifest_path is not None:
             self.mtime_cache = MtimeCache(cache_path, root, manifest_path, rebuild)
         if gitignore.has_ignore(root):
             self.ignore_cache = GitIgnoreCache(cache_path, root, rebuild)
     self.path_filter = gitignore.PathFilter(self.root,
                                             extras=[".git/"],
                                             cache=self.ignore_cache)
Esempio n. 2
0
 def __init__(self, root, url_base, cache_path, manifest_path=None, rebuild=False):
     from gitignore import gitignore
     self.root = os.path.abspath(root)
     self.url_base = url_base
     self.ignore_cache = None
     self.mtime_cache = None
     if cache_path is not None:
         if manifest_path is not None:
             self.mtime_cache = MtimeCache(cache_path, root, manifest_path, rebuild)
         if gitignore.has_ignore(root):
             self.ignore_cache = GitIgnoreCache(cache_path, root, rebuild)
     self.path_filter = gitignore.PathFilter(self.root,
                                             extras=[".git/"],
                                             cache=self.ignore_cache)
Esempio n. 3
0
 def __init__(self, root, url_base, cache_path, manifest_path=None, rebuild=False):
     # type: (bytes, Text, Optional[bytes], Optional[bytes], bool) -> None
     self.root = os.path.abspath(root)
     self.url_base = url_base
     self.ignore_cache = None
     self.mtime_cache = None
     if cache_path is not None:
         if manifest_path is not None:
             self.mtime_cache = MtimeCache(cache_path, root, manifest_path, rebuild)
         if gitignore.has_ignore(root):
             self.ignore_cache = GitIgnoreCache(cache_path, root, rebuild)
     self.path_filter = gitignore.PathFilter(self.root,
                                             extras=[".git/"],
                                             cache=self.ignore_cache)
     git = GitHasher(root)
     if git is not None:
         self.hash_cache = git.hash_cache()
     else:
         self.hash_cache = {}
Esempio n. 4
0
 def __init__(self, root, url_base, cache_path, manifest_path=None, rebuild=False):
     # type: (bytes, Text, Optional[bytes], Optional[bytes], bool) -> None
     self.root = os.path.abspath(root)
     self.url_base = url_base
     self.ignore_cache = None
     self.mtime_cache = None
     if cache_path is not None:
         if manifest_path is not None:
             self.mtime_cache = MtimeCache(cache_path, root, manifest_path, rebuild)
         if gitignore.has_ignore(root):
             self.ignore_cache = GitIgnoreCache(cache_path, root, rebuild)
     self.path_filter = gitignore.PathFilter(self.root,
                                             extras=[".git/"],
                                             cache=self.ignore_cache)
     git = GitHasher(root)
     if git is not None:
         self.hash_cache = git.hash_cache()
     else:
         self.hash_cache = {}
Esempio n. 5
0
 def __init__(self, tests_root, url_base, cache_path, manifest_path=None, rebuild=False):
     # type: (Text, Text, Optional[Text], Optional[Text], bool) -> None
     self.tests_root = tests_root
     self.url_base = url_base
     self.ignore_cache = None
     self.mtime_cache = None
     tests_root_bytes = tests_root.encode("utf8")
     if cache_path is not None:
         if manifest_path is not None:
             self.mtime_cache = MtimeCache(cache_path, tests_root, manifest_path, rebuild)
         if gitignore.has_ignore(tests_root_bytes):
             self.ignore_cache = GitIgnoreCache(cache_path, tests_root, rebuild)
     self.path_filter = gitignore.PathFilter(tests_root_bytes,
                                             extras=[b".git/"],
                                             cache=self.ignore_cache)
     git = GitHasher(tests_root)
     if git is not None:
         self.hash_cache = git.hash_cache()
     else:
         self.hash_cache = {}