278
278
verbose=verbose, full=full, show_ids=show_ids, branch=branch)
279
279
self.assertAnnotateEqualDiff(to_file.getvalue(), expected)
281
def assertRepoAnnotate(self, expected, repo, file_id, revision_id):
281
def assertRepoAnnotate(self, expected, repo, path, revision_id):
282
282
"""Assert that the revision is properly annotated."""
283
actual = list(repo.revision_tree(revision_id).annotate_iter(file_id))
283
actual = list(repo.revision_tree(revision_id).annotate_iter(path))
284
284
self.assertAnnotateEqualDiff(actual, expected)
286
286
def test_annotate_duplicate_lines(self):
289
289
repo = builder.get_branch().repository
291
291
self.addCleanup(repo.unlock)
292
self.assertRepoAnnotate(duplicate_base, repo, 'file-id', 'rev-base')
293
self.assertRepoAnnotate(duplicate_A, repo, 'file-id', 'rev-A')
294
self.assertRepoAnnotate(duplicate_B, repo, 'file-id', 'rev-B')
295
self.assertRepoAnnotate(duplicate_C, repo, 'file-id', 'rev-C')
296
self.assertRepoAnnotate(duplicate_D, repo, 'file-id', 'rev-D')
297
self.assertRepoAnnotate(duplicate_E, repo, 'file-id', 'rev-E')
292
self.assertRepoAnnotate(duplicate_base, repo, 'file', 'rev-base')
293
self.assertRepoAnnotate(duplicate_A, repo, 'file', 'rev-A')
294
self.assertRepoAnnotate(duplicate_B, repo, 'file', 'rev-B')
295
self.assertRepoAnnotate(duplicate_C, repo, 'file', 'rev-C')
296
self.assertRepoAnnotate(duplicate_D, repo, 'file', 'rev-D')
297
self.assertRepoAnnotate(duplicate_E, repo, 'file', 'rev-E')
299
299
def test_annotate_shows_dotted_revnos(self):
300
300
builder = self.create_merged_trees()