This strips the complete 20 bytes node which was not found. Having the the full
node in error message is important as it makes debugging easier.
If a short node is to be displayed, that should be done by callers.
( )
durin42 | |
Alphare | |
marmoute |
hg-reviewers |
This strips the complete 20 bytes node which was not found. Having the the full
node in error message is important as it makes debugging easier.
If a short node is to be displayed, that should be done by callers.
No Linters Available |
No Unit Test Coverage |
+1 on this, such error don't happens on "normal" operation, they are mostly the result of store or cache corruption, or user error when using advanced debug command. So having as much information as possible available is a big plus.
Path | Packages | |||
---|---|---|---|---|
M | mercurial/error.py (4 lines) | |||
M | tests/test-bundle-r.t (2 lines) | |||
M | tests/test-bundle.t (2 lines) | |||
M | tests/test-convert-filemap.t (6 lines) | |||
M | tests/test-convert-hg-source.t (2 lines) | |||
M | tests/test-hgweb-filelog.t (2 lines) | |||
M | tests/test-hgweb.t (6 lines) | |||
M | tests/test-hgwebdir.t (2 lines) | |||
M | tests/test-narrow-exchange.t (6 lines) | |||
M | tests/test-pull-bundle.t (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
b30ac5670fe9 | b4c2a2af25e2 | Pulkit Goyal | Feb 10 2021, 6:54 AM |
class LookupError(RevlogError, KeyError): | class LookupError(RevlogError, KeyError): | ||||
def __init__(self, name, index, message): | def __init__(self, name, index, message): | ||||
self.name = name | self.name = name | ||||
self.index = index | self.index = index | ||||
# this can't be called 'message' because at least some installs of | # this can't be called 'message' because at least some installs of | ||||
# Python 2.6+ complain about the 'message' property being deprecated | # Python 2.6+ complain about the 'message' property being deprecated | ||||
self.lookupmessage = message | self.lookupmessage = message | ||||
if isinstance(name, bytes) and len(name) == 20: | if isinstance(name, bytes) and len(name) == 20: | ||||
from .node import short | from .node import hex | ||||
name = short(name) | name = hex(name) | ||||
# if name is a binary node, it can be None | # if name is a binary node, it can be None | ||||
RevlogError.__init__( | RevlogError.__init__( | ||||
self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message) | self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message) | ||||
) | ) | ||||
def __bytes__(self): | def __bytes__(self): | ||||
return RevlogError.__bytes__(self) | return RevlogError.__bytes__(self) | ||||
revision 2 | revision 2 | ||||
$ hg tip -q | $ hg tip -q | ||||
2:4ce51a113780 | 2:4ce51a113780 | ||||
$ hg unbundle ../test-bundle-should-fail.hg | $ hg unbundle ../test-bundle-should-fail.hg | ||||
adding changesets | adding changesets | ||||
transaction abort! | transaction abort! | ||||
rollback completed | rollback completed | ||||
abort: 00changelog.i@93ee6ab32777: unknown parent | abort: 00changelog.i@93ee6ab32777cd430e07da694794fb6a4f917712: unknown parent | ||||
[50] | [50] | ||||
revision 2 | revision 2 | ||||
$ hg tip -q | $ hg tip -q | ||||
2:4ce51a113780 | 2:4ce51a113780 | ||||
$ hg unbundle ../test-bundle-all.hg | $ hg unbundle ../test-bundle-all.hg | ||||
adding changesets | adding changesets |
test for https://bz.mercurial-scm.org/1144 | test for https://bz.mercurial-scm.org/1144 | ||||
test that verify bundle does not traceback | test that verify bundle does not traceback | ||||
partial history bundle, fails w/ unknown parent | partial history bundle, fails w/ unknown parent | ||||
$ hg -R bundle.hg verify | $ hg -R bundle.hg verify | ||||
abort: 00changelog.i@bbd179dfa0a7: unknown parent | abort: 00changelog.i@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent | ||||
[50] | [50] | ||||
full history bundle, refuses to verify non-local repo | full history bundle, refuses to verify non-local repo | ||||
#if repobundlerepo | #if repobundlerepo | ||||
$ hg -R all.hg verify | $ hg -R all.hg verify | ||||
abort: cannot verify bundle or remote repos | abort: cannot verify bundle or remote repos | ||||
[255] | [255] |
$ rm source/.hg/store/data/dir/file3.i | $ rm source/.hg/store/data/dir/file3.i | ||||
$ rm source/.hg/store/data/dir/file4.i | $ rm source/.hg/store/data/dir/file4.i | ||||
#endif | #endif | ||||
#if reposimplestore | #if reposimplestore | ||||
$ rm -rf source/.hg/store/data/dir/file3 | $ rm -rf source/.hg/store/data/dir/file3 | ||||
$ rm -rf source/.hg/store/data/dir/file4 | $ rm -rf source/.hg/store/data/dir/file4 | ||||
#endif | #endif | ||||
$ hg -q convert --filemap renames.fmap --datesort source dummydest | $ hg -q convert --filemap renames.fmap --datesort source dummydest | ||||
abort: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !) | abort: data/dir/file3.i@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !) | ||||
abort: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) | abort: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) | ||||
[50] | [50] | ||||
$ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo | $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo | ||||
ignoring: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !) | ignoring: data/dir/file3.i@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !) | ||||
ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !) | ignoring: data/dir/file4.i@6edd55f559cdce67132b12ca09e09cee08b60442: no match found (reporevlogstore !) | ||||
ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) | ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) | ||||
ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !) | ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !) | ||||
$ hg up -q -R renames.repo | $ hg up -q -R renames.repo | ||||
$ glog -R renames.repo | $ glog -R renames.repo | ||||
@ 4 "8: change foo" files: foo2 | @ 4 "8: change foo" files: foo2 | ||||
| | | | ||||
o 3 "6: change foo baz" files: foo2 | o 3 "6: change foo baz" files: foo2 | ||||
| | | |
#endif | #endif | ||||
$ cd .. | $ cd .. | ||||
$ hg --config convert.hg.ignoreerrors=True convert broken fixed | $ hg --config convert.hg.ignoreerrors=True convert broken fixed | ||||
initializing destination fixed repository | initializing destination fixed repository | ||||
scanning source... | scanning source... | ||||
sorting... | sorting... | ||||
converting... | converting... | ||||
4 init | 4 init | ||||
ignoring: data/b.i@1e88685f5dde: no match found (reporevlogstore !) | ignoring: data/b.i@1e88685f5ddec574a34c70af492f95b6debc8741: no match found (reporevlogstore !) | ||||
ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !) | ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !) | ||||
3 changeall | 3 changeall | ||||
2 changebagain | 2 changebagain | ||||
1 merge | 1 merge | ||||
0 moveb | 0 moveb | ||||
$ hg -R fixed verify | $ hg -R fixed verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests |
number or hash, or <a href="/help/revsets">revset expression</a>.</div> | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | ||||
</form> | </form> | ||||
<div class="description"> | <div class="description"> | ||||
<p> | <p> | ||||
An error occurred while processing your request: | An error occurred while processing your request: | ||||
</p> | </p> | ||||
<p> | <p> | ||||
a@6563da9dcf87: not found in manifest | a@6563da9dcf87b1949716e38ff3e3dfaa3198eb06: not found in manifest | ||||
</p> | </p> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</body> | </body> |
[1] | [1] | ||||
should give a 404 - file does not exist | should give a 404 - file does not exist | ||||
$ get-with-headers.py localhost:$HGPORT 'file/tip/bork?style=raw' | $ get-with-headers.py localhost:$HGPORT 'file/tip/bork?style=raw' | ||||
404 Not Found | 404 Not Found | ||||
error: bork@2ef0ac749a14: not found in manifest | error: bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest | ||||
[1] | [1] | ||||
$ get-with-headers.py localhost:$HGPORT 'file/tip/bork' | $ get-with-headers.py localhost:$HGPORT 'file/tip/bork' | ||||
404 Not Found | 404 Not Found | ||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | ||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> | ||||
<head> | <head> | ||||
<link rel="icon" href="/static/hgicon.png" type="image/png" /> | <link rel="icon" href="/static/hgicon.png" type="image/png" /> | ||||
number or hash, or <a href="/help/revsets">revset expression</a>.</div> | number or hash, or <a href="/help/revsets">revset expression</a>.</div> | ||||
</form> | </form> | ||||
<div class="description"> | <div class="description"> | ||||
<p> | <p> | ||||
An error occurred while processing your request: | An error occurred while processing your request: | ||||
</p> | </p> | ||||
<p> | <p> | ||||
bork@2ef0ac749a14: not found in manifest | bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest | ||||
</p> | </p> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</body> | </body> | ||||
</html> | </html> | ||||
[1] | [1] | ||||
$ get-with-headers.py localhost:$HGPORT 'diff/tip/bork?style=raw' | $ get-with-headers.py localhost:$HGPORT 'diff/tip/bork?style=raw' | ||||
404 Not Found | 404 Not Found | ||||
error: bork@2ef0ac749a14: not found in manifest | error: bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest | ||||
[1] | [1] | ||||
try bad style | try bad style | ||||
$ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=foobar') | $ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=foobar') | ||||
200 Script output follows | 200 Script output follows | ||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
$ cat hg.pid >> $DAEMON_PIDS | $ cat hg.pid >> $DAEMON_PIDS | ||||
should give a 404 - file does not exist | should give a 404 - file does not exist | ||||
$ get-with-headers.py localhost:$HGPORT 'a/file/tip/bork?style=raw' | $ get-with-headers.py localhost:$HGPORT 'a/file/tip/bork?style=raw' | ||||
404 Not Found | 404 Not Found | ||||
error: bork@8580ff50825a: not found in manifest | error: bork@8580ff50825a50c8f716709acdf8de0deddcd6ab: not found in manifest | ||||
[1] | [1] | ||||
should succeed | should succeed | ||||
$ get-with-headers.py localhost:$HGPORT '?style=raw' | $ get-with-headers.py localhost:$HGPORT '?style=raw' | ||||
200 Script output follows | 200 Script output follows | ||||
$ hg push ssh://user@dummy/narrow | $ hg push ssh://user@dummy/narrow | ||||
pushing to ssh://user@dummy/narrow | pushing to ssh://user@dummy/narrow | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: transaction abort! | remote: transaction abort! | ||||
remote: rollback completed | remote: rollback completed | ||||
remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent (reporevlogstore !) | remote: abort: data/inside2/f.i@4a1aa07735e673e20c00fae80f40dc301ee30616: unknown parent (reporevlogstore !) | ||||
remote: abort: data/inside2/f/index@4a1aa07735e6: no node (reposimplestore !) | remote: abort: data/inside2/f/index@4a1aa07735e6: no node (reposimplestore !) | ||||
abort: stream ended unexpectedly (got 0 bytes, expected 4) | abort: stream ended unexpectedly (got 0 bytes, expected 4) | ||||
[255] | [255] | ||||
Can pull from wider repo if change affects only paths outside remote's | Can pull from wider repo if change affects only paths outside remote's | ||||
narrow spec | narrow spec | ||||
$ echo 4 > inside2/f | $ echo 4 > inside2/f | ||||
$ hg ci -m 'inside2 4' | $ hg ci -m 'inside2 4' | ||||
TODO: lfs shouldn't abort like this | TODO: lfs shouldn't abort like this | ||||
$ hg push ssh://user@dummy/narrow2 || true | $ hg push ssh://user@dummy/narrow2 || true | ||||
pushing to ssh://user@dummy/narrow2 | pushing to ssh://user@dummy/narrow2 | ||||
searching for changes | searching for changes | ||||
remote: adding changesets | remote: adding changesets | ||||
remote: adding manifests | remote: adding manifests | ||||
remote: adding file changes | remote: adding file changes | ||||
remote: added 1 changesets with 0 changes to 0 files (no-lfs-on !) | remote: added 1 changesets with 0 changes to 0 files (no-lfs-on !) | ||||
remote: error: pretxnchangegroup.lfs hook raised an exception: data/inside2/f.i@f59b4e021835: no match found (lfs-on !) | remote: error: pretxnchangegroup.lfs hook raised an exception: data/inside2/f.i@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !) | ||||
remote: transaction abort! (lfs-on !) | remote: transaction abort! (lfs-on !) | ||||
remote: rollback completed (lfs-on !) | remote: rollback completed (lfs-on !) | ||||
remote: abort: data/inside2/f.i@f59b4e021835: no match found (lfs-on !) | remote: abort: data/inside2/f.i@f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !) | ||||
abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !) | abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !) |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ cd repo.pullbundle3 | $ cd repo.pullbundle3 | ||||
$ hg pull -r 1 | $ hg pull -r 1 | ||||
pulling from http://localhost:$HGPORT2/ | pulling from http://localhost:$HGPORT2/ | ||||
searching for changes | searching for changes | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests | ||||
adding file changes | adding file changes | ||||
abort: 00changelog.i@66f7d451a68b: no node | abort: 00changelog.i@66f7d451a68b85ed82ff5fcc254daf50c74144bd: no node | ||||
[50] | [50] | ||||
$ cd .. | $ cd .. | ||||
$ killdaemons.py | $ killdaemons.py | ||||
$ grep 'sending pullbundle ' repo/.hg/blackbox.log | $ grep 'sending pullbundle ' repo/.hg/blackbox.log | ||||
* sending pullbundle "0.hg" (glob) | * sending pullbundle "0.hg" (glob) | ||||
* sending pullbundle "0.hg" (glob) | * sending pullbundle "0.hg" (glob) | ||||
$ rm repo/.hg/blackbox.log | $ rm repo/.hg/blackbox.log | ||||