diff mercurial/error.py @ 27280: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 (2015-10-13)
parents 024644b1900b
children 634666c48b7d
line wrap: on
line diff
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -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."""