##// END OF EJS Templates
revlog: map rev(wdirid) to WdirUnsupported exception...
Yuya Nishihara -
r32657:7b17f9de default
parent child Browse files
Show More
@@ -26,6 +26,7 b' from .node import ('
26 hex,
26 hex,
27 nullid,
27 nullid,
28 nullrev,
28 nullrev,
29 wdirid,
29 wdirrev,
30 wdirrev,
30 )
31 )
31 from .i18n import _
32 from .i18n import _
@@ -416,6 +417,8 b' class revlog(object):'
416 raise
417 raise
417 except RevlogError:
418 except RevlogError:
418 # parsers.c radix tree lookup failed
419 # parsers.c radix tree lookup failed
420 if node == wdirid:
421 raise error.WdirUnsupported
419 raise LookupError(node, self.indexfile, _('no node'))
422 raise LookupError(node, self.indexfile, _('no node'))
420 except KeyError:
423 except KeyError:
421 # pure python cache lookup failed
424 # pure python cache lookup failed
@@ -430,6 +433,8 b' class revlog(object):'
430 if v == node:
433 if v == node:
431 self._nodepos = r - 1
434 self._nodepos = r - 1
432 return r
435 return r
436 if node == wdirid:
437 raise error.WdirUnsupported
433 raise LookupError(node, self.indexfile, _('no node'))
438 raise LookupError(node, self.indexfile, _('no node'))
434
439
435 # Accessors for index entries.
440 # Accessors for index entries.
@@ -190,6 +190,8 b' def callcatch(ui, func):'
190 if inst.hint:
190 if inst.hint:
191 ui.warn(_("(%s)\n") % inst.hint)
191 ui.warn(_("(%s)\n") % inst.hint)
192 return 1
192 return 1
193 except error.WdirUnsupported:
194 ui.warn(_("abort: working directory revision cannot be specified\n"))
193 except error.Abort as inst:
195 except error.Abort as inst:
194 ui.warn(_("abort: %s\n") % inst)
196 ui.warn(_("abort: %s\n") % inst)
195 if inst.hint:
197 if inst.hint:
@@ -110,6 +110,12 b' Test max chain len'
110 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
110 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
111 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
111 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
112
112
113 Test WdirUnsupported exception
114
115 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
116 abort: working directory revision cannot be specified
117 [255]
118
113 Test cache warming command
119 Test cache warming command
114
120
115 $ rm -rf .hg/cache/
121 $ rm -rf .hg/cache/
General Comments 0
You need to be logged in to leave comments. Login now