##// END OF EJS Templates
make LookupError more detailed
Bryan O'Sullivan -
r5558:7c1a9a21 default
parent child Browse files
Show More
@@ -48,7 +48,7 b' class bundlerevlog(revlog.revlog):'
48 48 continue
49 49 for p in (p1, p2):
50 50 if not p in self.nodemap:
51 raise revlog.LookupError(_("unknown parent %s") % short(p1))
51 raise revlog.LookupError(hex(p1), _("unknown parent %s") % short(p1))
52 52 if linkmapper is None:
53 53 link = n
54 54 else:
@@ -100,13 +100,13 b' class changectx(object):'
100 100 try:
101 101 return self._manifest[path], self._manifest.flags(path)
102 102 except KeyError:
103 raise revlog.LookupError(_("'%s' not found in manifest") % path)
103 raise revlog.LookupError(path, _("'%s' not found in manifest") % path)
104 104 if '_manifestdelta' in self.__dict__ or path in self.files():
105 105 if path in self._manifestdelta:
106 106 return self._manifestdelta[path], self._manifestdelta.flags(path)
107 107 node, flag = self._repo.manifest.find(self._changeset[0], path)
108 108 if not node:
109 raise revlog.LookupError(_("'%s' not found in manifest") % path)
109 raise revlog.LookupError(path, _("'%s' not found in manifest") % path)
110 110
111 111 return node, flag
112 112
@@ -31,8 +31,13 b' REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_'
31 31
32 32 class RevlogError(Exception):
33 33 pass
34
34 35 class LookupError(RevlogError):
35 pass
36 def __init__(self, name, message=None):
37 if message is None:
38 message = _('not found: %s') % name
39 RevlogError.__init__(self, message)
40 self.name = name
36 41
37 42 def getoffset(q):
38 43 return int(q >> 16)
@@ -516,7 +521,7 b' class revlog(object):'
516 521 try:
517 522 return self.nodemap[node]
518 523 except KeyError:
519 raise LookupError(_('%s: no node %s') % (self.indexfile, hex(node)))
524 raise LookupError(hex(node), _('%s: no node %s') % (self.indexfile, hex(node)))
520 525 def node(self, rev):
521 526 return self.index[rev][7]
522 527 def linkrev(self, node):
@@ -836,7 +841,8 b' class revlog(object):'
836 841 for n in self.nodemap:
837 842 if n.startswith(bin_id) and hex(n).startswith(id):
838 843 if node is not None:
839 raise LookupError(_("Ambiguous identifier"))
844 raise LookupError(hex(node),
845 _("Ambiguous identifier"))
840 846 node = n
841 847 if node is not None:
842 848 return node
@@ -855,7 +861,7 b' class revlog(object):'
855 861 if n:
856 862 return n
857 863
858 raise LookupError(_("No match found"))
864 raise LookupError(id, _("No match found"))
859 865
860 866 def cmp(self, node, text):
861 867 """compare text with a given file revision"""
@@ -1166,13 +1172,13 b' class revlog(object):'
1166 1172
1167 1173 for p in (p1, p2):
1168 1174 if not p in self.nodemap:
1169 raise LookupError(_("unknown parent %s") % short(p))
1175 raise LookupError(hex(p), _("unknown parent %s") % short(p))
1170 1176
1171 1177 if not chain:
1172 1178 # retrieve the parent revision of the delta chain
1173 1179 chain = p1
1174 1180 if not chain in self.nodemap:
1175 raise LookupError(_("unknown base %s") % short(chain[:4]))
1181 raise LookupError(hex(chain), _("unknown base %s") % short(chain[:4]))
1176 1182
1177 1183 # full versions are inserted when the needed deltas become
1178 1184 # comparable to the uncompressed text or when the previous
General Comments 0
You need to be logged in to leave comments. Login now