Merge pull request #877 from efiop/master

dvc: sort dir cache by relpath
This commit is contained in:
Ruslan Kuprieiev
2018-07-11 16:36:13 +03:00
committed by GitHub
+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)