dvc: sort dir cache by relpath

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-11 14:01:49 +03:00
parent 3e08cd503c
commit 5b674c910d
+4
View File
@@ -2,6 +2,7 @@ import os
import json
import nanotime
import threading
from operator import itemgetter
from dvc.lock import Lock
from dvc.system import System
@@ -80,6 +81,9 @@ class State(object):
md5 = file_md5(path)[0]
dir_info.append({self.PARAM_RELPATH: relpath, self.PARAM_MD5: md5})
# NOTE: sorting the list by path to ensure reproducibility
dir_info = sorted(dir_info, key=itemgetter(self.PARAM_RELPATH))
md5 = dict_md5(dir_info) + self.MD5_DIR_SUFFIX
if self.project.cache.local.changed(md5):
self.project.cache.local.dump_dir_cache(md5, dir_info)