(
self,
ancestor: Optional[str] = None,
multiple_heads: Optional[str] = None,
start: Optional[str] = None,
end: Optional[str] = None,
resolution: Optional[str] = None,
)
| 202 | |
| 203 | @contextmanager |
| 204 | def _catch_revision_errors( |
| 205 | self, |
| 206 | ancestor: Optional[str] = None, |
| 207 | multiple_heads: Optional[str] = None, |
| 208 | start: Optional[str] = None, |
| 209 | end: Optional[str] = None, |
| 210 | resolution: Optional[str] = None, |
| 211 | ) -> Iterator[None]: |
| 212 | try: |
| 213 | yield |
| 214 | except revision.RangeNotAncestorError as rna: |
| 215 | if start is None: |
| 216 | start = cast(Any, rna.lower) |
| 217 | if end is None: |
| 218 | end = cast(Any, rna.upper) |
| 219 | if not ancestor: |
| 220 | ancestor = ( |
| 221 | "Requested range %(start)s:%(end)s does not refer to " |
| 222 | "ancestor/descendant revisions along the same branch" |
| 223 | ) |
| 224 | ancestor = ancestor % {"start": start, "end": end} |
| 225 | raise util.CommandError(ancestor) from rna |
| 226 | except revision.MultipleHeads as mh: |
| 227 | if not multiple_heads: |
| 228 | multiple_heads = ( |
| 229 | "Multiple head revisions are present for given " |
| 230 | "argument '%(head_arg)s'; please " |
| 231 | "specify a specific target revision, " |
| 232 | "'<branchname>@%(head_arg)s' to " |
| 233 | "narrow to a specific head, or 'heads' for all heads" |
| 234 | ) |
| 235 | multiple_heads = multiple_heads % { |
| 236 | "head_arg": end or mh.argument, |
| 237 | "heads": util.format_as_comma(mh.heads), |
| 238 | } |
| 239 | raise util.CommandError(multiple_heads) from mh |
| 240 | except revision.ResolutionError as re: |
| 241 | if resolution is None: |
| 242 | resolution = "Can't locate revision identified by '%s'" % ( |
| 243 | re.argument |
| 244 | ) |
| 245 | raise util.CommandError(resolution) from re |
| 246 | except revision.RevisionError as err: |
| 247 | raise util.CommandError(err.args[0]) from err |
| 248 | |
| 249 | def walk_revisions( |
| 250 | self, base: str = "base", head: str = "heads" |
no outgoing calls
no test coverage detected