Comments
Patch
@@ -26,6 +26,7 @@ from .node import (
hex,
nullid,
nullrev,
+ wdirid,
wdirrev,
)
from .i18n import _
@@ -416,6 +417,8 @@ class revlog(object):
raise
except RevlogError:
# parsers.c radix tree lookup failed
+ if node == wdirid:
+ raise error.WdirUnsupported
raise LookupError(node, self.indexfile, _('no node'))
except KeyError:
# pure python cache lookup failed
@@ -430,6 +433,8 @@ class revlog(object):
if v == node:
self._nodepos = r - 1
return r
+ if node == wdirid:
+ raise error.WdirUnsupported
raise LookupError(node, self.indexfile, _('no node'))
# Accessors for index entries.
@@ -190,6 +190,8 @@ def callcatch(ui, func):
if inst.hint:
ui.warn(_("(%s)\n") % inst.hint)
return 1
+ except error.WdirUnsupported:
+ ui.warn(_("abort: working directory revision cannot be specified\n"))
except error.Abort as inst:
ui.warn(_("abort: %s\n") % inst)
if inst.hint:
@@ -110,6 +110,12 @@ Test max chain len
7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
+Test WdirUnsupported exception
+
+ $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
+ abort: working directory revision cannot be specified
+ [255]
+
Test cache warming command
$ rm -rf .hg/cache/