Mercurial > hg
changeset 18545:a49b7c9fc246
largefiles: report localstore errors with single line warnings messages
The actual hash is also not relevant to report.
This makes verify output with multiple failures easier to process.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 04 Feb 2013 02:46:53 +0100 |
parents | d0a8f09a22eb |
children | fb0e8966a4be |
files | hgext/largefiles/localstore.py tests/test-largefiles.t tests/test-lfconvert.t |
diffstat | 3 files changed, 20 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/localstore.py Mon Feb 04 02:46:53 2013 +0100 +++ b/hgext/largefiles/localstore.py Mon Feb 04 02:46:53 2013 +0100 @@ -63,23 +63,19 @@ return False expecthash = fctx.data()[0:40] + storepath = lfutil.storepath(self.remote, expecthash) verified.add(key) if not lfutil.instore(self.remote, expecthash): self.ui.warn( - _('changeset %s: %s missing\n' - ' (looked for hash %s)\n') - % (cset, filename, expecthash)) + _('changeset %s: %s references missing %s\n') + % (cset, filename, storepath)) return True # failed if contents: - storepath = lfutil.storepath(self.remote, expecthash) actualhash = lfutil.hashfile(storepath) if actualhash != expecthash: self.ui.warn( - _('changeset %s: %s: contents differ\n' - ' (%s:\n' - ' expected hash %s,\n' - ' but got %s)\n') - % (cset, filename, storepath, expecthash, actualhash)) + _('changeset %s: %s references corrupted %s\n') + % (cset, filename, storepath)) return True # failed return False
--- a/tests/test-largefiles.t Mon Feb 04 02:46:53 2013 +0100 +++ b/tests/test-largefiles.t Mon Feb 04 02:46:53 2013 +0100 @@ -1202,8 +1202,7 @@ checking files 10 files, 10 changesets, 28 total revisions searching 1 changesets for largefiles - changeset 9:598410d3eb9a: sub/large4 missing - (looked for hash e166e74c7303192238d60af5a9c4ce9bef0b7928) + changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 verified existence of 3 revisions of 3 largefiles [1] @@ -1211,10 +1210,7 @@ $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 $ hg verify -q --large --lfc searching 1 changesets for largefiles - changeset 9:598410d3eb9a: sub/large4: contents differ - ($TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928: (glob) - expected hash e166e74c7303192238d60af5a9c4ce9bef0b7928, - but got 1f19b76d5b3cad1472c87efb42b582c97e040060) + changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 verified contents of 3 revisions of 3 largefiles [1] @@ -1225,28 +1221,13 @@ $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 $ hg verify -q --large --lfa --lfc 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 1:ce8896473775: sub/large2: contents differ - ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob) - expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, - but got cfef678f24d3e339944138ecdd8fd85ca21d820f) - changeset 3:9e8fbc4bce62: large1: contents differ - ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob) - expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, - but got cfef678f24d3e339944138ecdd8fd85ca21d820f) - changeset 4:74c02385b94c: large3: contents differ - ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob) - expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, - but got cfef678f24d3e339944138ecdd8fd85ca21d820f) - changeset 4:74c02385b94c: sub/large4: contents differ - ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob) - expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4, - but got cfef678f24d3e339944138ecdd8fd85ca21d820f) + changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 + changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d + changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f + changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 + changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 + changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 + changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 verified contents of 15 revisions of 6 largefiles [1]
--- a/tests/test-lfconvert.t Mon Feb 04 02:46:53 2013 +0100 +++ b/tests/test-lfconvert.t Mon Feb 04 02:46:53 2013 +0100 @@ -317,18 +317,12 @@ checking files 8 files, 7 changesets, 12 total revisions searching 7 changesets for largefiles - changeset 0:d4892ec57ce2: large missing - (looked for hash 2e000fa7e85759c7f4c254d4d9c33ef481e459a7) - changeset 1:334e5237836d: sub/maybelarge.dat missing - (looked for hash 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c) - changeset 2:261ad3f3f037: stuff/maybelarge.dat missing - (looked for hash 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c) - changeset 3:55759520c76f: sub/maybelarge.dat missing - (looked for hash 76236b6a2c6102826c61af4297dd738fb3b1de38) - changeset 5:9cc5aa7204f0: stuff/maybelarge.dat missing - (looked for hash 76236b6a2c6102826c61af4297dd738fb3b1de38) - changeset 6:17126745edfd: anotherlarge missing - (looked for hash 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3) + changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 + changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c + changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c + changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 + changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 + changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 verified existence of 6 revisions of 4 largefiles [1] $ hg -R largefiles-repo-hg showconfig paths