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:
Nicolas Dumazet 2011-02-18 12:23:15 +09:00
parent 13d0efd6d7
commit 06d30763b3

View file

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