equal
deleted
inserted
replaced
7 |
7 |
8 import abc |
8 import abc |
9 import os |
9 import os |
10 import subprocess |
10 import subprocess |
11 |
11 |
|
12 from mercurial.node import hex |
12 from mercurial.pycompat import open |
13 from mercurial.pycompat import open |
13 from mercurial import ( |
14 from mercurial import pycompat |
14 node, |
|
15 pycompat, |
|
16 ) |
|
17 from mercurial.utils import ( |
15 from mercurial.utils import ( |
18 hashutil, |
16 hashutil, |
19 procutil, |
17 procutil, |
20 ) |
18 ) |
21 |
19 |
84 |
82 |
85 def _filepath(self, filename): |
83 def _filepath(self, filename): |
86 return os.path.join(self._dirpath(filename), filename) |
84 return os.path.join(self._dirpath(filename), filename) |
87 |
85 |
88 def write(self, data): |
86 def write(self, data): |
89 filename = node.hex(hashutil.sha1(data).digest()) |
87 filename = hex(hashutil.sha1(data).digest()) |
90 dirpath = self._dirpath(filename) |
88 dirpath = self._dirpath(filename) |
91 |
89 |
92 if not os.path.exists(dirpath): |
90 if not os.path.exists(dirpath): |
93 os.makedirs(dirpath) |
91 os.makedirs(dirpath) |
94 |
92 |