Changeset View
Changeset View
Standalone View
Standalone View
mercurial/httpconnection.py
Show All 12 Lines | |||||
import os | import os | ||||
from .i18n import _ | from .i18n import _ | ||||
from .pycompat import open | from .pycompat import open | ||||
from . import ( | from . import ( | ||||
pycompat, | pycompat, | ||||
util, | util, | ||||
) | ) | ||||
from .utils import ( | |||||
urlutil, | |||||
) | |||||
urlerr = util.urlerr | urlerr = util.urlerr | ||||
urlreq = util.urlreq | urlreq = util.urlreq | ||||
# moved here from url.py to avoid a cycle | # moved here from url.py to avoid a cycle | ||||
class httpsendfile(object): | class httpsendfile(object): | ||||
"""This is a wrapper around the objects returned by python's "open". | """This is a wrapper around the objects returned by python's "open". | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | for group, auth in pycompat.iteritems(groups): | ||||
if user and user != auth.get(b'username', user): | if user and user != auth.get(b'username', user): | ||||
# If a username was set in the URI, the entry username | # If a username was set in the URI, the entry username | ||||
# must either match it or be unset | # must either match it or be unset | ||||
continue | continue | ||||
prefix = auth.get(b'prefix') | prefix = auth.get(b'prefix') | ||||
if not prefix: | if not prefix: | ||||
continue | continue | ||||
prefixurl = util.url(prefix) | prefixurl = urlutil.url(prefix) | ||||
if prefixurl.user and prefixurl.user != user: | if prefixurl.user and prefixurl.user != user: | ||||
# If a username was set in the prefix, it must match the username in | # If a username was set in the prefix, it must match the username in | ||||
# the URI. | # the URI. | ||||
continue | continue | ||||
# The URI passed in has been stripped of credentials, so erase the user | # The URI passed in has been stripped of credentials, so erase the user | ||||
# here to allow simpler matching. | # here to allow simpler matching. | ||||
prefixurl.user = None | prefixurl.user = None | ||||
Show All 25 Lines |