Cope better with hirerarchical branch names.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 30 May 2014 14:26:21 +0000 (10:26 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 30 May 2014 14:26:21 +0000 (10:26 -0400)
From an idea by tasn.

irkerhook.py

index 5f15032c4e96ccf7c4e0261745aa4c54a324a370..e5983309e5487f1314306ad39a9b4ba6c1773fd0 100755 (executable)
@@ -259,7 +259,7 @@ class GitExtractor(GenericExtractor):
     def commit_factory(self, commit_id):
         "Make a Commit object holding data for a specified commit ID."
         commit = Commit(self, commit_id)
-        commit.branch = os.path.basename(self.refname)
+        commit.branch = re.sub(r"^refs/[^/]*/", "", self.refname)
         # Compute a description for the revision
         if self.revformat == 'raw':
             commit.rev = commit.commit