vcs: adjust .original_year() relative path calculation to match .authors().
authorW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 01:43:08 +0000 (21:43 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 01:49:40 +0000 (21:49 -0400)
I should have fixed .authors() back when I fixed .original_year().
Now the filename handling is identical, which should make it easier
for people to keep future updates in sync.

update_copyright/vcs/__init__.py

index 32e5d4c217f0a108fdba996d902884e2cc6c5e63..e62cf261c324a5a22dd8dc74e7624d24031a8cad 100644 (file)
@@ -47,8 +47,9 @@ class VCSBackend (object):
             years.update(self._year_hacks.values())
         else:
             filename = _os_path.relpath(filename, self._root)
-            if _utils.splitpath(filename) in self._year_hacks:
-                years.add(self._year_hacks[_utils.splitpath(filename)])
+            splitpath = _utils.splitpath(filename)
+            if splitpath in self._year_hacks:
+                years.add(self._year_hacks[splitpath])
         years = sorted(years)
         return years[0]