Mercurial > hg-stable
changeset 18481:ed647c59753b stable
largefiles: let wirestore._stat return stats as expected by remotestore verify
- preparing for fixing verify crash.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 28 Jan 2013 15:19:44 +0100 |
parents | 5ef3c7081008 |
children | 6f219eb83435 |
files | hgext/largefiles/remotestore.py hgext/largefiles/wirestore.py |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py Sun Jan 27 11:39:51 2013 -0600 +++ b/hgext/largefiles/remotestore.py Mon Jan 28 15:19:44 2013 +0100 @@ -74,7 +74,7 @@ return lfutil.copyandhash(lfutil.blockstream(infile), tmpfile) def _verify(self, hashes): - return self._stat(hashes) + return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems()) def _verifyfile(self, cctx, cset, contents, standin, verified): filename = lfutil.splitstandin(standin)
--- a/hgext/largefiles/wirestore.py Sun Jan 27 11:39:51 2013 -0600 +++ b/hgext/largefiles/wirestore.py Mon Jan 28 15:19:44 2013 +0100 @@ -26,6 +26,8 @@ return self.remote.getlfile(hash) def _stat(self, hashes): + '''For each hash, return 2 if the largefile is missing, 1 if it has a + mismatched checksum, or 0 if it is in good condition''' batch = self.remote.batch() futures = {} for hash in hashes: @@ -33,5 +35,5 @@ batch.submit() retval = {} for hash in hashes: - retval[hash] = not futures[hash].value + retval[hash] = futures[hash].value return retval