• dtu's avatar
    Fix per-file owners check for deleted files. · 944b6053
    dtu authored
    Previously if you deleted a file that you had per-file owners on, it would fail
    the owners check. This fixes that.
    
    Originally, owners.Database used glob to enumerate the directory and added all
    the matching files in the directory to some dicts holding the owners
    information. If a CL deleted a file, it'd no longer be on the filesystem, so it
    wouldn't be in these dicts. There'd be no per-file owners information for it.
    
    With this patch, the Database no longer enumerates individual files. It instead
    keeps track of the glob patterns and checks the CL's files against the patterns
    at lookup time.
    
    BUG=622381
    TEST=tests/owners_unittest.py && tests/owners_finder_test.py  # Unit test included.
    
    Review-Url: https://codereview.chromium.org/2148153002
    944b6053
owners.py 13.3 KB