cache: use checksums instead of commit_id

From now on, we identify our cache files by their md5sum,
so that we can avoid cache collission in branching scenario
and also dedup same data at the same time.

Fixes #250, #251

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2017-10-17 14:06:43 +03:00
parent b0e1d3374f
commit 8bb51f5efc
8 changed files with 56 additions and 58 deletions
+6 -3
View File
@@ -179,10 +179,13 @@ class GitWrapper(GitWrapperI):
Executor.exec_cmd_only_success(['git', 'add', '--all'])
out_status = Executor.exec_cmd_only_success(['git', 'status', '--porcelain'])
Executor.exec_cmd_only_success(['git', 'commit', '-m', message])
Logger.debug('[dvc-git] Commit all changes. Success.')
changes = GitWrapper.parse_porcelain_files(out_status)
if len(changes) == 0:
return []
return GitWrapper.parse_porcelain_files(out_status)
Executor.exec_cmd_only_success(['git', 'commit', '-m', '\'{}\''.format(message)])
Logger.debug('[dvc-git] Commit all changes. Success.')
return changes
def commit_all_changes_and_log_status(self, message):
statuses = self.commit_all_changes(message)