Show More
@@ -105,9 +105,6 b" parsers = policy.importmod(r'parsers')" | |||
|
105 | 105 | _chunksize = 1048576 |
|
106 | 106 | |
|
107 | 107 | LookupError = error.LookupError |
|
108 | AmbiguousPrefixLookupError = error.AmbiguousPrefixLookupError | |
|
109 | CensoredNodeError = error.CensoredNodeError | |
|
110 | ProgrammingError = error.ProgrammingError | |
|
111 | 108 | |
|
112 | 109 | # Store flag processors (cf. 'addflagprocessor()' to register) |
|
113 | 110 | _flagprocessors = { |
@@ -180,10 +177,10 b' def addflagprocessor(flag, processor):' | |||
|
180 | 177 | """ |
|
181 | 178 | if not flag & REVIDX_KNOWN_FLAGS: |
|
182 | 179 | msg = _("cannot register processor on unknown flag '%#x'.") % (flag) |
|
183 | raise ProgrammingError(msg) | |
|
180 | raise error.ProgrammingError(msg) | |
|
184 | 181 | if flag not in REVIDX_FLAGS_ORDER: |
|
185 | 182 | msg = _("flag '%#x' undefined in REVIDX_FLAGS_ORDER.") % (flag) |
|
186 | raise ProgrammingError(msg) | |
|
183 | raise error.ProgrammingError(msg) | |
|
187 | 184 | if flag in _flagprocessors: |
|
188 | 185 | msg = _("cannot register multiple processors on flag '%#x'.") % (flag) |
|
189 | 186 | raise error.Abort(msg) |
@@ -1279,8 +1276,8 b' class revlog(object):' | |||
|
1279 | 1276 | # parsers.c radix tree lookup gave multiple matches |
|
1280 | 1277 | # fast path: for unfiltered changelog, radix tree is accurate |
|
1281 | 1278 | if not getattr(self, 'filteredrevs', None): |
|
1282 |
raise AmbiguousPrefixLookupError( |
|
|
1283 |
|
|
|
1279 | raise error.AmbiguousPrefixLookupError( | |
|
1280 | id, self.indexfile, _('ambiguous identifier')) | |
|
1284 | 1281 | # fall through to slow path that filters hidden revisions |
|
1285 | 1282 | except (AttributeError, ValueError): |
|
1286 | 1283 | # we are pure python, or key was too short to search radix tree |
@@ -1303,8 +1300,8 b' class revlog(object):' | |||
|
1303 | 1300 | if len(nl) == 1 and not maybewdir: |
|
1304 | 1301 | self._pcache[id] = nl[0] |
|
1305 | 1302 | return nl[0] |
|
1306 |
raise AmbiguousPrefixLookupError( |
|
|
1307 |
|
|
|
1303 | raise error.AmbiguousPrefixLookupError( | |
|
1304 | id, self.indexfile, _('ambiguous identifier')) | |
|
1308 | 1305 | if maybewdir: |
|
1309 | 1306 | raise error.WdirUnsupported |
|
1310 | 1307 | return None |
@@ -1572,7 +1569,7 b' class revlog(object):' | |||
|
1572 | 1569 | def snapshotdepth(self, rev): |
|
1573 | 1570 | """number of snapshot in the chain before this one""" |
|
1574 | 1571 | if not self.issnapshot(rev): |
|
1575 | raise ProgrammingError('revision %d not a snapshot') | |
|
1572 | raise error.ProgrammingError('revision %d not a snapshot') | |
|
1576 | 1573 | return len(self._deltachain(rev)[0]) - 1 |
|
1577 | 1574 | |
|
1578 | 1575 | def revdiff(self, rev1, rev2): |
@@ -1696,7 +1693,8 b' class revlog(object):' | |||
|
1696 | 1693 | if flags == 0: |
|
1697 | 1694 | return text, True |
|
1698 | 1695 | if not operation in ('read', 'write'): |
|
1699 |
raise ProgrammingError(_("invalid '%s' operation |
|
|
1696 | raise error.ProgrammingError(_("invalid '%s' operation") % | |
|
1697 | operation) | |
|
1700 | 1698 | # Check all flags are known. |
|
1701 | 1699 | if flags & ~REVIDX_KNOWN_FLAGS: |
|
1702 | 1700 | raise error.RevlogError(_("incompatible revision flag '%#x'") % |
@@ -33,8 +33,6 b' from .. import (' | |||
|
33 | 33 | mdiff, |
|
34 | 34 | ) |
|
35 | 35 | |
|
36 | CensoredNodeError = error.CensoredNodeError | |
|
37 | ||
|
38 | 36 | # maximum <delta-chain-data>/<revision-text-length> ratio |
|
39 | 37 | LIMIT_DELTA2TEXT = 2 |
|
40 | 38 | |
@@ -460,7 +458,7 b' def _textfromdelta(fh, revlog, baserev, ' | |||
|
460 | 458 | revlog.checkhash(fulltext, expectednode, p1=p1, p2=p2) |
|
461 | 459 | if flags & REVIDX_ISCENSORED: |
|
462 | 460 | raise error.RevlogError(_('node %s is not censored') % expectednode) |
|
463 | except CensoredNodeError: | |
|
461 | except error.CensoredNodeError: | |
|
464 | 462 | # must pass the censored index flag to add censored revisions |
|
465 | 463 | if not flags & REVIDX_ISCENSORED: |
|
466 | 464 | raise |
General Comments 0
You need to be logged in to leave comments.
Login now