##// END OF EJS Templates
revlog: detect pseudo file nodeids to raise WdirUnsupported exception...
Yuya Nishihara -
r37467:a0d71618 default
parent child Browse files
Show More
@@ -29,6 +29,7 b' from .node import ('
29 29 hex,
30 30 nullid,
31 31 nullrev,
32 wdirfilenodeids,
32 33 wdirhex,
33 34 wdirid,
34 35 wdirrev,
@@ -807,7 +808,7 b' class revlog(object):'
807 808 raise
808 809 except RevlogError:
809 810 # parsers.c radix tree lookup failed
810 if node == wdirid:
811 if node == wdirid or node in wdirfilenodeids:
811 812 raise error.WdirUnsupported
812 813 raise LookupError(node, self.indexfile, _('no node'))
813 814 except KeyError:
@@ -823,7 +824,7 b' class revlog(object):'
823 824 if v == node:
824 825 self._nodepos = r - 1
825 826 return r
826 if node == wdirid:
827 if node == wdirid or node in wdirfilenodeids:
827 828 raise error.WdirUnsupported
828 829 raise LookupError(node, self.indexfile, _('no node'))
829 830
@@ -1436,6 +1437,7 b' class revlog(object):'
1436 1437 pass
1437 1438
1438 1439 def _partialmatch(self, id):
1440 # we don't care wdirfilenodeids as they should be always full hash
1439 1441 maybewdir = wdirhex.startswith(id)
1440 1442 try:
1441 1443 partial = self.index.partialmatch(id)
@@ -2114,7 +2116,7 b' class revlog(object):'
2114 2116 if node == nullid:
2115 2117 raise RevlogError(_("%s: attempt to add null revision") %
2116 2118 (self.indexfile))
2117 if node == wdirid:
2119 if node == wdirid or node in wdirfilenodeids:
2118 2120 raise RevlogError(_("%s: attempt to add wdir revision") %
2119 2121 (self.indexfile))
2120 2122
@@ -245,7 +245,7 b' Test wdir'
245 245 $ hg stat
246 246 M port2
247 247 $ hg grep -r 'wdir()' port
248 abort: data/port2.i@303030303030: no node!
248 abort: working directory revision cannot be specified
249 249 [255]
250 250
251 251 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now