Mercurial > hg
comparison mercurial/utils/urlutil.py @ 46928:93c224dc099b
urlutil: use bytes for Abort messages
Caught by pytype. Also fix a minor grammar issue in the second message.
Differential Revision: https://phab.mercurial-scm.org/D10433
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 14 Apr 2021 22:50:41 -0400 |
parents | efadec3ea8e2 |
children | ebb13f9a9ba8 |
comparison
equal
deleted
inserted
replaced
46927:cdbef062c6c8 | 46928:93c224dc099b |
---|---|
641 if self.url.scheme == b'path': | 641 if self.url.scheme == b'path': |
642 assert self.url.path is None | 642 assert self.url.path is None |
643 try: | 643 try: |
644 subpath = paths[self.url.host] | 644 subpath = paths[self.url.host] |
645 except KeyError: | 645 except KeyError: |
646 m = _('cannot use `%s`, "%s" is not a known path') | 646 m = _(b'cannot use `%s`, "%s" is not a known path') |
647 m %= (self.rawloc, self.url.host) | 647 m %= (self.rawloc, self.url.host) |
648 raise error.Abort(m) | 648 raise error.Abort(m) |
649 if subpath.raw_url.scheme == b'path': | 649 if subpath.raw_url.scheme == b'path': |
650 m = _('cannot use `%s`, "%s" is also define as a `path://`') | 650 m = _(b'cannot use `%s`, "%s" is also defined as a `path://`') |
651 m %= (self.rawloc, self.url.host) | 651 m %= (self.rawloc, self.url.host) |
652 raise error.Abort(m) | 652 raise error.Abort(m) |
653 self.url = subpath.url | 653 self.url = subpath.url |
654 self.rawloc = subpath.rawloc | 654 self.rawloc = subpath.rawloc |
655 self.loc = subpath.loc | 655 self.loc = subpath.loc |