Mercurial > public > mercurial-scm > hg-stable
diff mercurial/error.py @ 26640:b13fdcc4e700
exchange: refactor bundle specification parsing
The old code was tailored to `hg bundle` usage and not appropriate for
use as a general API, which clone bundles will require. The code has
been rewritten to make it more generally suitable.
We introduce dedicated error types to represent invalid and unsupported
bundle specifications. The reason we need dedicated error types (rather
than error.Abort) is because clone bundles will want to catch these
exception as part of filtering entries. We don't want to swallow
error.Abort on principle.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 13 Oct 2015 10:57:54 -0700 |
parents | 024644b1900b |
children | 634666c48b7d |
line wrap: on
line diff
--- a/mercurial/error.py Tue Oct 13 11:43:21 2015 -0700 +++ b/mercurial/error.py Tue Oct 13 10:57:54 2015 -0700 @@ -201,3 +201,12 @@ operation which replaces the entire base with new content. This ensures the delta may be applied by clones which have not censored the base. """ + +class InvalidBundleSpecification(Exception): + """error raised when a bundle specification is invalid. + + This is used for syntax errors as opposed to support errors. + """ + +class UnsupportedBundleSpecification(Exception): + """error raised when a bundle specification is not supported."""