equal
deleted
inserted
replaced
253 repositories that are using it. This is useful later when doing garbage |
253 repositories that are using it. This is useful later when doing garbage |
254 collection, since it allows us to insecpt the repos to see what nodes |
254 collection, since it allows us to insecpt the repos to see what nodes |
255 they want to be kept alive in the store. |
255 they want to be kept alive in the store. |
256 """ |
256 """ |
257 repospath = os.path.join(self._path, "repos") |
257 repospath = os.path.join(self._path, "repos") |
258 with open(repospath, 'a') as reposfile: |
258 with open(repospath, 'ab') as reposfile: |
259 reposfile.write(os.path.dirname(path) + "\n") |
259 reposfile.write(os.path.dirname(path) + "\n") |
260 |
260 |
261 repospathstat = os.stat(repospath) |
261 repospathstat = os.stat(repospath) |
262 if repospathstat.st_uid == self._uid: |
262 if repospathstat.st_uid == self._uid: |
263 os.chmod(repospath, 0o0664) |
263 os.chmod(repospath, 0o0664) |
268 |
268 |
269 if self._validatedata(data, path): |
269 if self._validatedata(data, path): |
270 return True |
270 return True |
271 |
271 |
272 if self._validatecachelog: |
272 if self._validatecachelog: |
273 with open(self._validatecachelog, 'a+') as f: |
273 with open(self._validatecachelog, 'ab+') as f: |
274 f.write("corrupt %s during %s\n" % (path, action)) |
274 f.write("corrupt %s during %s\n" % (path, action)) |
275 |
275 |
276 os.rename(path, path + ".corrupt") |
276 os.rename(path, path + ".corrupt") |
277 return False |
277 return False |
278 |
278 |