Commits

Anonymous 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.

Comments (0)

Files changed (1)

 
 
 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_):