Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 52643:5cc8deb96b48
pyupgrade: modernize calls to superclass methods
This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of
`yield` statements commented out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 05 Jan 2025 22:23:31 -0500 |
parents | 35cc15fbc523 |
children | 5c48fd4c0e68 |
comparison
equal
deleted
inserted
replaced
52642:73ab542565e0 | 52643:5cc8deb96b48 |
---|---|
452 return self.wvfs.reljoin(reporelpath(self._ctx.repo()), self._path) | 452 return self.wvfs.reljoin(reporelpath(self._ctx.repo()), self._path) |
453 | 453 |
454 | 454 |
455 class hgsubrepo(abstractsubrepo): | 455 class hgsubrepo(abstractsubrepo): |
456 def __init__(self, ctx, path, state, allowcreate): | 456 def __init__(self, ctx, path, state, allowcreate): |
457 super(hgsubrepo, self).__init__(ctx, path) | 457 super().__init__(ctx, path) |
458 self._state = state | 458 self._state = state |
459 r = ctx.repo() | 459 r = ctx.repo() |
460 root = r.wjoin(util.localpath(path)) | 460 root = r.wjoin(util.localpath(path)) |
461 create = allowcreate and not r.wvfs.exists(b'%s/.hg' % path) | 461 create = allowcreate and not r.wvfs.exists(b'%s/.hg' % path) |
462 # repository constructor does expand variables in path, which is | 462 # repository constructor does expand variables in path, which is |
1115 return reporelpath(self._repo) | 1115 return reporelpath(self._repo) |
1116 | 1116 |
1117 | 1117 |
1118 class svnsubrepo(abstractsubrepo): | 1118 class svnsubrepo(abstractsubrepo): |
1119 def __init__(self, ctx, path, state, allowcreate): | 1119 def __init__(self, ctx, path, state, allowcreate): |
1120 super(svnsubrepo, self).__init__(ctx, path) | 1120 super().__init__(ctx, path) |
1121 self._state = state | 1121 self._state = state |
1122 self._exe = procutil.findexe(b'svn') | 1122 self._exe = procutil.findexe(b'svn') |
1123 if not self._exe: | 1123 if not self._exe: |
1124 raise error.Abort( | 1124 raise error.Abort( |
1125 _(b"'svn' executable not found for subrepo '%s'") % self._path | 1125 _(b"'svn' executable not found for subrepo '%s'") % self._path |
1376 return self._svncommand([b'cat'], name)[0] | 1376 return self._svncommand([b'cat'], name)[0] |
1377 | 1377 |
1378 | 1378 |
1379 class gitsubrepo(abstractsubrepo): | 1379 class gitsubrepo(abstractsubrepo): |
1380 def __init__(self, ctx, path, state, allowcreate): | 1380 def __init__(self, ctx, path, state, allowcreate): |
1381 super(gitsubrepo, self).__init__(ctx, path) | 1381 super().__init__(ctx, path) |
1382 self._state = state | 1382 self._state = state |
1383 self._abspath = ctx.repo().wjoin(path) | 1383 self._abspath = ctx.repo().wjoin(path) |
1384 self._subparent = ctx.repo() | 1384 self._subparent = ctx.repo() |
1385 self._ensuregit() | 1385 self._ensuregit() |
1386 | 1386 |