D9994: error: remove shortening of node in error message
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Mon Feb 15 12:20:26 UTC 2021
pulkit created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
This makes it difficult to figure what exactly was node on which LookupError was
called if we only have the error message.
I was debugging an error message which contained a short node and I tried to
find out which callers raise LookupError with a short node. This turned out to
be wrong because we short-ed the node before printing.
If a short node is to be displayed, that should be done by callers.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D9994
AFFECTED FILES
mercurial/error.py
tests/test-bundle-r.t
tests/test-bundle.t
tests/test-convert-filemap.t
tests/test-convert-hg-source.t
tests/test-hgweb-filelog.t
tests/test-hgweb.t
tests/test-hgwebdir.t
tests/test-narrow-exchange.t
tests/test-pull-bundle.t
CHANGE DETAILS
diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t
--- a/tests/test-pull-bundle.t
+++ b/tests/test-pull-bundle.t
@@ -185,7 +185,7 @@
adding changesets
adding manifests
adding file changes
- abort: 00changelog.i at 66f7d451a68b: no node
+ abort: 00changelog.i at 66f7d451a68b85ed82ff5fcc254daf50c74144bd: no node
[50]
$ cd ..
$ killdaemons.py
diff --git a/tests/test-narrow-exchange.t b/tests/test-narrow-exchange.t
--- a/tests/test-narrow-exchange.t
+++ b/tests/test-narrow-exchange.t
@@ -105,7 +105,7 @@
remote: adding file changes
remote: transaction abort!
remote: rollback completed
- remote: abort: data/inside2/f.i at 4a1aa07735e6: unknown parent (reporevlogstore !)
+ remote: abort: data/inside2/f.i at 4a1aa07735e673e20c00fae80f40dc301ee30616: unknown parent (reporevlogstore !)
remote: abort: data/inside2/f/index at 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 at f59b4e021835: no match found (lfs-on !)
+ remote: error: pretxnchangegroup.lfs hook raised an exception: data/inside2/f.i at f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
remote: transaction abort! (lfs-on !)
remote: rollback completed (lfs-on !)
- remote: abort: data/inside2/f.i at f59b4e021835: no match found (lfs-on !)
+ remote: abort: data/inside2/f.i at f59b4e0218355383d2789196f1092abcf2262b0c: no match found (lfs-on !)
abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !)
diff --git a/tests/test-hgwebdir.t b/tests/test-hgwebdir.t
--- a/tests/test-hgwebdir.t
+++ b/tests/test-hgwebdir.t
@@ -103,7 +103,7 @@
404 Not Found
- error: bork at 8580ff50825a: not found in manifest
+ error: bork at 8580ff50825a50c8f716709acdf8de0deddcd6ab: not found in manifest
[1]
should succeed
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -149,7 +149,7 @@
404 Not Found
- error: bork at 2ef0ac749a14: not found in manifest
+ error: bork at 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 at 2ef0ac749a14: not found in manifest
+ bork at 2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest
</p>
</div>
</div>
@@ -218,7 +218,7 @@
404 Not Found
- error: bork at 2ef0ac749a14: not found in manifest
+ error: bork at 2ef0ac749a14e4f57a5a822464a0902c6f7f448f: not found in manifest
[1]
try bad style
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -656,7 +656,7 @@
An error occurred while processing your request:
</p>
<p>
- a at 6563da9dcf87: not found in manifest
+ a at 6563da9dcf87b1949716e38ff3e3dfaa3198eb06: not found in manifest
</p>
</div>
</div>
diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t
--- a/tests/test-convert-hg-source.t
+++ b/tests/test-convert-hg-source.t
@@ -182,7 +182,7 @@
sorting...
converting...
4 init
- ignoring: data/b.i at 1e88685f5dde: no match found (reporevlogstore !)
+ ignoring: data/b.i at 1e88685f5ddec574a34c70af492f95b6debc8741: no match found (reporevlogstore !)
ignoring: data/b/index at 1e88685f5dde: no node (reposimplestore !)
3 changeall
2 changebagain
diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t
--- a/tests/test-convert-filemap.t
+++ b/tests/test-convert-filemap.t
@@ -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 at e96dce0bc6a2: no match found (reporevlogstore !)
+ abort: data/dir/file3.i at e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
abort: data/dir/file3/index at 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 at e96dce0bc6a2: no match found (reporevlogstore !)
- ignoring: data/dir/file4.i at 6edd55f559cd: no match found (reporevlogstore !)
+ ignoring: data/dir/file3.i at e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c: no match found (reporevlogstore !)
+ ignoring: data/dir/file4.i at 6edd55f559cdce67132b12ca09e09cee08b60442: no match found (reporevlogstore !)
ignoring: data/dir/file3/index at e96dce0bc6a2: no node (reposimplestore !)
ignoring: data/dir/file4/index at 6edd55f559cd: no node (reposimplestore !)
$ hg up -q -R renames.repo
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -733,7 +733,7 @@
partial history bundle, fails w/ unknown parent
$ hg -R bundle.hg verify
- abort: 00changelog.i at bbd179dfa0a7: unknown parent
+ abort: 00changelog.i at bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
[50]
full history bundle, refuses to verify non-local repo
diff --git a/tests/test-bundle-r.t b/tests/test-bundle-r.t
--- a/tests/test-bundle-r.t
+++ b/tests/test-bundle-r.t
@@ -223,7 +223,7 @@
adding changesets
transaction abort!
rollback completed
- abort: 00changelog.i at 93ee6ab32777: unknown parent
+ abort: 00changelog.i at 93ee6ab32777cd430e07da694794fb6a4f917712: unknown parent
[50]
revision 2
diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -72,9 +72,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)
To: pulkit, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list