Mercurial > hg-stable
changeset 18486:1067a6240f86 stable
largefiles: verify all files in each revision and report errors in any revision
Verify used 'any' and would stop verifying after the first failure in each
changeset.
The exit code only reported the result from the last changeset.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 28 Jan 2013 15:19:44 +0100 |
parents | 39cecda9ff77 |
children | 7aacc114d4f8 |
files | hgext/largefiles/basestore.py tests/test-largefiles.t |
diffstat | 2 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/basestore.py Mon Jan 28 15:19:44 2013 +0100 +++ b/hgext/largefiles/basestore.py Mon Jan 28 15:19:44 2013 +0100 @@ -106,8 +106,9 @@ cctx = self.repo[rev] cset = "%d:%s" % (cctx.rev(), node.short(cctx.node())) - failed = util.any(self._verifyfile( - cctx, cset, contents, standin, verified) for standin in cctx) + for standin in cctx: + if self._verifyfile(cctx, cset, contents, standin, verified): + failed = True numrevs = len(verified) numlfiles = len(set([fname for (fname, fnode) in verified]))
--- a/tests/test-largefiles.t Mon Jan 28 15:19:44 2013 +0100 +++ b/tests/test-largefiles.t Mon Jan 28 15:19:44 2013 +0100 @@ -1204,7 +1204,7 @@ searching 1 changesets for largefiles changeset 9:598410d3eb9a: sub/large4 missing (looked for hash e166e74c7303192238d60af5a9c4ce9bef0b7928) - verified existence of 1 revisions of 1 largefiles + verified existence of 3 revisions of 3 largefiles [1] - introduce corruption and make sure that it is caught when checking content: @@ -1215,7 +1215,7 @@ ($TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928: expected hash e166e74c7303192238d60af5a9c4ce9bef0b7928, but got 1f19b76d5b3cad1472c87efb42b582c97e040060) - verified contents of 1 revisions of 1 largefiles + verified contents of 3 revisions of 3 largefiles [1] - cleanup @@ -1227,9 +1227,11 @@ searching 10 changesets for largefiles changeset 0:30d30fe6a5be: large1 missing (looked for hash 4669e532d5b2c093a78eca010077e708a071bb64) + changeset 0:30d30fe6a5be: sub/large2 missing + (looked for hash 1deebade43c8c498a3c8daddac0244dc55d1331d) changeset 1:ce8896473775: large1 missing (looked for hash 5f78770c0e77ba4287ad6ef3071c9bf9c379742f) - changeset 2:51a0ae4d5864: sub/large2: contents differ + changeset 1:ce8896473775: sub/large2: contents differ ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, but got cfef678f24d3e339944138ecdd8fd85ca21d820f) @@ -1241,7 +1243,12 @@ ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, but got cfef678f24d3e339944138ecdd8fd85ca21d820f) - verified contents of 13 revisions of 6 largefiles + changeset 4:74c02385b94c: sub/large4: contents differ + ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: + expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, + but got cfef678f24d3e339944138ecdd8fd85ca21d820f) + verified contents of 15 revisions of 6 largefiles + [1] - cleanup $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4