error: remove shortening of node in error message
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.
Differential Revision: https://phab.mercurial-scm.org/D9994
--- a/mercurial/error.py Thu Mar 04 08:20:19 2021 -0800
+++ b/mercurial/error.py Wed Feb 10 17:24:54 2021 +0530
@@ -73,9 +73,9 @@
# Python 2.6+ complain about the 'message' property being deprecated
self.lookupmessage = message
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
RevlogError.__init__(
self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message)
--- a/tests/test-bundle-r.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-bundle-r.t Wed Feb 10 17:24:54 2021 +0530
@@ -223,7 +223,7 @@
adding changesets
transaction abort!
rollback completed
- abort: 00changelog.i@93ee6ab32777: unknown parent
+ abort: 00changelog.i@93ee6ab32777cd430e07da694794fb6a4f917712: unknown parent
[50]
revision 2
--- a/tests/test-bundle.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-bundle.t Wed Feb 10 17:24:54 2021 +0530
@@ -733,7 +733,7 @@
partial history bundle, fails w/ unknown parent
$ hg -R bundle.hg verify
- abort: 00changelog.i@bbd179dfa0a7: unknown parent
+ abort: 00changelog.i@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
[50]
full history bundle, refuses to verify non-local repo
--- a/tests/test-convert-filemap.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-convert-filemap.t Wed Feb 10 17:24:54 2021 +0530
@@ -292,12 +292,12 @@
$ rm -rf source/.hg/store/data/dir/file4
#endif
$ 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 !)
[50]
$ 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/file4.i@6edd55f559cd: no match found (reporevlogstore !)
+ ignoring: data/dir/file3.i@e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: 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/file4/index@6edd55f559cd: no node (reposimplestore !)
$ hg up -q -R renames.repo
--- a/tests/test-convert-hg-source.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-convert-hg-source.t Wed Feb 10 17:24:54 2021 +0530
@@ -182,7 +182,7 @@
sorting...
converting...
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 !)
3 changeall
2 changebagain
--- a/tests/test-hgweb-filelog.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-hgweb-filelog.t Wed Feb 10 17:24:54 2021 +0530
@@ -656,7 +656,7 @@
An error occurred while processing your request:
</p>
<p>
- a@6563da9dcf87: not found in manifest
+ a@6563da9dcf87b1949716e38ff3e3dfaa3198eb06: not found in manifest
</p>
</div>
</div>
--- a/tests/test-hgweb.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-hgweb.t Wed Feb 10 17:24:54 2021 +0530
@@ -149,7 +149,7 @@
404 Not Found
- error: bork@2ef0ac749a14: not found in manifest
+ error: bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest
[1]
$ get-with-headers.py localhost:$HGPORT 'file/tip/bork'
404 Not Found
@@ -202,7 +202,7 @@
An error occurred while processing your request:
</p>
<p>
- bork@2ef0ac749a14: not found in manifest
+ bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest
</p>
</div>
</div>
@@ -218,7 +218,7 @@
404 Not Found
- error: bork@2ef0ac749a14: not found in manifest
+ error: bork@2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest
[1]
try bad style
--- a/tests/test-hgwebdir.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-hgwebdir.t Wed Feb 10 17:24:54 2021 +0530
@@ -103,7 +103,7 @@
404 Not Found
- error: bork@8580ff50825a: not found in manifest
+ error: bork@8580ff50825a50c8f716709acdf8de0deddcd6ab: not found in manifest
[1]
should succeed
--- a/tests/test-narrow-exchange.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-narrow-exchange.t Wed Feb 10 17:24:54 2021 +0530
@@ -105,7 +105,7 @@
remote: adding file changes
remote: transaction abort!
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 !)
abort: stream ended unexpectedly (got 0 bytes, expected 4)
[255]
@@ -218,8 +218,8 @@
remote: adding manifests
remote: adding file changes
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: 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 !)
--- a/tests/test-pull-bundle.t Thu Mar 04 08:20:19 2021 -0800
+++ b/tests/test-pull-bundle.t Wed Feb 10 17:24:54 2021 +0530
@@ -185,7 +185,7 @@
adding changesets
adding manifests
adding file changes
- abort: 00changelog.i@66f7d451a68b: no node
+ abort: 00changelog.i@66f7d451a68b85ed82ff5fcc254daf50c74144bd: no node
[50]
$ cd ..
$ killdaemons.py