예제 #1
0
 def version(self, paths):
     repo = git.Repo(storage.path(paths[0]))
     kwargs = {'max_count': 1}
     commit_revs = []
     for f in paths:
         f = storage.path(f)
         commit = [i for i in repo.iter_commits(paths=f, **kwargs)][0]
         commit_revs.append(commit.name_rev)
     return self.hexdigest(', '.join(commit_revs))[0:16]
예제 #2
0
 def compile(self, paths):
     for index, path in enumerate(paths):
         for compiler in self.compilers:
             compiler = compiler(self.verbose)
             if compiler.match_file(path):
                 new_path = self.output_path(path, compiler.output_extension)
                 content = self.read_file(path)
                 try:
                     compiled_content = compiler.compile_file(content, storage.path(path))
                     self.save_file(new_path, compiled_content)
                 except CompilerError:
                     if not storage.exists(new_path) or not settings.PIPELINE:
                         raise
                 paths[index] = new_path
     return paths
예제 #3
0
 def version(self, paths):
     repo = git.Repo(storage.path(paths[0]))
     return self.hexdigest(repo.head.commit.name_rev)[0:16]