mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-31 11:16:54 +00:00
mercurial hook: skip duplicates
If a push contains several commits affecting many times the same file, we only need to check once for the changed file.
This commit is contained in:
parent
13d0efd6d7
commit
06d30763b3
1 changed files with 4 additions and 0 deletions
|
|
@ -55,8 +55,12 @@ def main():
|
|||
|
||||
|
||||
def _get_files(repo, **kwargs):
|
||||
seen = set()
|
||||
for rev in xrange(repo[kwargs['node']], len(repo)):
|
||||
for file_ in repo[rev].files():
|
||||
if file_ in seen:
|
||||
continue
|
||||
seen.add(file_)
|
||||
if not file_.endswith('.py'):
|
||||
continue
|
||||
if skip_file(file_):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue