Build fix

This commit is contained in:
Dmitry
2017-09-18 23:19:47 -07:00
parent 68c392b8cf
commit 7bcae81153
2 changed files with 6 additions and 4 deletions
+2 -4
View File
@@ -61,9 +61,7 @@ class Commit(object):
return comment[:Commit.TEXT_LIMIT-3] + '...'
def _comments_text(self, max_commits=100):
res = []
if not self.is_repro:
res.append(self._text_comment(self))
res = [self._text_comment(self)]
for commit in self._collapsed_commits:
if not commit.is_repro:
@@ -73,7 +71,7 @@ class Commit(object):
was_collapsed = len(res) > max_commits
res = res[:max_commits]
max_len = max(map(lambda x: len(x), res))
max_len = max(map(lambda x: len(x), res + [""]))
res_extended_len = map(lambda x: x.ljust(max_len), res)
if was_collapsed:
+4
View File
@@ -69,6 +69,10 @@ class TestWorkflow(TestCase):
wf.collapse_commits(CollapseDvcReproCommitsStrategy(wf))
self.assertEqual(len(wf._commits), 2)
self.assertTrue('1' in wf._commits)
self.assertTrue('3' in wf._commits)
self.assertFalse('2' in wf._commits)
self.assertEqual(wf._commits[self._commit1.hash].text(), self._showed_text1)
self.assertEqual(wf._commits[self._commit3.hash].text(), self._showed_text3)
self.assertTrue('2' not in wf._commits)