Nicolas Dumazet  committed 4a68384

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.

  • Participants
  • Parent commits 3353c04
  • Branches default

Comments (0)

Files changed (1)

File flake8/

 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'):
             if skip_file(file_):