Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/urlutil.py @ 50894:6ca865080479
remotefilelog: use sysstr to access for attributes
We do not need bytes here.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 30 Aug 2023 14:07:02 +0200 |
parents | 0ab3956540a6 |
children | 9f3e4b60bfe6 |
comparison
equal
deleted
inserted
replaced
50893:b2b8c25f9462 | 50894:6ca865080479 |
---|---|
255 | 255 |
256 @encoding.strmethod | 256 @encoding.strmethod |
257 def __repr__(self): | 257 def __repr__(self): |
258 attrs = [] | 258 attrs = [] |
259 for a in ( | 259 for a in ( |
260 b'scheme', | 260 'scheme', |
261 b'user', | 261 'user', |
262 b'passwd', | 262 'passwd', |
263 b'host', | 263 'host', |
264 b'port', | 264 'port', |
265 b'path', | 265 'path', |
266 b'query', | 266 'query', |
267 b'fragment', | 267 'fragment', |
268 ): | 268 ): |
269 v = getattr(self, a) | 269 v = getattr(self, a) |
270 if v is not None: | 270 if v is not None: |
271 attrs.append(b'%s: %r' % (a, pycompat.bytestr(v))) | 271 line = b'%s: %r' |
272 line %= (pycompat.bytestr(a), pycompat.bytestr(v)) | |
273 attrs.append(line) | |
272 return b'<url %s>' % b', '.join(attrs) | 274 return b'<url %s>' % b', '.join(attrs) |
273 | 275 |
274 def __bytes__(self): | 276 def __bytes__(self): |
275 r"""Join the URL's components back into a URL string. | 277 r"""Join the URL's components back into a URL string. |
276 | 278 |