Skip to content

Commit

Permalink
dvc: print msg about changed dependency
Browse files Browse the repository at this point in the history
Fixes iterative#618

Signed-off-by: Ruslan Kuprieiev <[email protected]>
  • Loading branch information
efiop committed Apr 5, 2018
1 parent d5abd79 commit 5dbbe57
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions dvc/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,19 @@ def _changed_md5(self):

return self.project.state.changed(self.path, self.md5)

@staticmethod
def _changed_msg(changed):
if changed:
return 'changed'
return "didn't change"

def changed(self):
return self._changed_md5()
ret = self._changed_md5()

msg = u'Dependency \'{}\' {}'.format(self.rel_path, self._changed_msg(ret))
self.project.logger.debug(msg)

return ret

def status(self):
if self.changed():
Expand Down Expand Up @@ -231,12 +242,8 @@ def changed(self):
else:
ret = self._changed_file(self.path, self.cache)

msg = u'Data file or dir \'{}\' with cache \'{}\' '
if ret:
msg += 'changed'
else:
msg += 'didn\'t change'
self.project.logger.debug(msg.format(self.rel_path, self.rel_cache))
msg = u'Data file or dir \'{}\' with cache \'{}\' {}'
self.project.logger.debug(msg.format(self.rel_path, self.rel_cache, self._changed_msg(ret)))

return ret

Expand Down

0 comments on commit 5dbbe57

Please sign in to comment.