From afa81c33f834a6645ba3ee6830255a20c076f864 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 19 Oct 2012 21:40:08 -0400 Subject: [PATCH] vcs: use relative paths for matching author-hacks. --- update_copyright/vcs/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.26.2