File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 3
3
import json
4
4
import shutil
5
5
import schema
6
+ import posixpath
7
+ import ntpath
6
8
from checksumdir import dirhash
7
9
8
10
from dvc .system import System
@@ -97,15 +99,22 @@ def save(self):
97
99
98
100
self .md5 = self .project .state .update (self .path )
99
101
102
+ @staticmethod
103
+ def unixpath (path ):
104
+ assert not ntpath .isabs (path )
105
+ assert not posixpath .isabs (path )
106
+ return path .replace ('\\ ' , '/' )
107
+
100
108
def dumpd (self , cwd ):
101
109
return {
102
- Output .PARAM_PATH : os .path .relpath (self .path , cwd ),
110
+ Output .PARAM_PATH : self . unixpath ( os .path .relpath (self .path , cwd ) ),
103
111
Output .PARAM_MD5 : self .md5 ,
104
112
}
105
113
106
114
@classmethod
107
115
def loadd (cls , project , d , cwd = os .curdir ):
108
- path = os .path .join (cwd , d [Output .PARAM_PATH ])
116
+ relpath = os .path .normpath (Output .unixpath (d [Output .PARAM_PATH ]))
117
+ path = os .path .join (cwd , relpath )
109
118
md5 = d .get (Output .PARAM_MD5 , None )
110
119
return cls (project , path , md5 = md5 )
111
120
You can’t perform that action at this time.
0 commit comments