From: W. Trevor King Date: Sat, 20 Oct 2012 01:40:08 +0000 (-0400) Subject: vcs: use relative paths for matching author-hacks. X-Git-Tag: v0.5~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=afa81c33f834a6645ba3ee6830255a20c076f864;p=update-copyright.git vcs: use relative paths for matching author-hacks. --- diff --git a/update_copyright/vcs/__init__.py b/update_copyright/vcs/__init__.py index 7ddde68..32e5d4c 100644 --- a/update_copyright/vcs/__init__.py +++ b/update_copyright/vcs/__init__.py @@ -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)