| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a848569 commit 6e86f8a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -701,6 +701,9 @@ def blame(self, rev, file): | |||
| 701 | 701 | if len(digits) == 3: | |
| 702 | 702 | info = {'id': firstpart} | |
| 703 | 703 | blames.append([None, []]) | |
| 704 | + elif info['id'] != firstpart: | ||
| 705 | + info = {'id': firstpart} | ||
| 706 | + blames.append([commits.get(firstpart), []]) | ||
| 704 | 707 | # END blame data initialization | |
| 705 | 708 | else: | |
| 706 | 709 | m = self.re_author_committer_start.search(firstpart) | |
@@ -747,8 +750,8 @@ def blame(self, rev, file): | |||
| 747 | 750 | m = self.re_tab_full_line.search(line) | |
| 748 | 751 | text, = m.groups() | |
| 749 | 752 | blames[-1][0] = c | |
| 750 | - blames[-1][1].append( text ) | ||
| 751 | - info = None | ||
| 753 | + blames[-1][1].append(text) | ||
| 754 | + info = { 'id' : sha } | ||
| 752 | 755 | # END if we collected commit info | |
| 753 | 756 | # END distinguish filename,summary,rest | |
| 754 | 757 | # END distinguish author|committer vs filename,summary,rest | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -283,6 +283,15 @@ def test_should_display_blame_information(self, git): | |||
| 283 | 283 | assert_true( isinstance( tlist[0], basestring ) ) | |
| 284 | 284 | assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug | |
| 285 | 285 | ||
| 286 | + def test_blame_real(self): | ||
| 287 | + c = 0 | ||
| 288 | + for item in self.rorepo.head.commit.tree.traverse( | ||
| 289 | + predicate=lambda i, d: i.type == 'blob' and i.path.endswith('.py')): | ||
| 290 | + c += 1 | ||
| 291 | + b = self.rorepo.blame(self.rorepo.head, item.path) | ||
| 292 | + #END for each item to traverse | ||
| 293 | + assert c | ||
| 294 | + | ||
| 286 | 295 | def test_untracked_files(self): | |
| 287 | 296 | base = self.rorepo.working_tree_dir | |
| 288 | 297 | files = ( join_path_native(base, "__test_myfile"), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments