vcs: use relative paths for matching author-hacks.
authorW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 01:40:08 +0000 (21:40 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 01:49:40 +0000 (21:49 -0400)
update_copyright/vcs/__init__.py

index 7ddde68c32fba441a35b76100a1f2c469ad02ba5..32e5d4c217f0a108fdba996d902884e2cc6c5e63 100644 (file)
@@ -60,8 +60,11 @@ class VCSBackend (object):
         if filename is None:
             for path,_authors in self._author_hacks.items():
                 authors.update(_authors)
-        elif _utils.splitpath(filename) in self._author_hacks:
-            authors.update(self._author_hacks[_utils.splitpath(filename)])
+        else:
+            filename = _os_path.relpath(filename, self._root)
+            splitpath = _utils.splitpath(filename)
+            if splitpath in self._author_hacks:
+                authors.update(self._author_hacks[splitpath])
         return _utils.replace_aliases(
             authors, with_email=with_emails, aliases=self._aliases)