mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 07:18:27 +01:00
Build fix
This commit is contained in:
+2
-4
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user