##// END OF EJS Templates
subrepo: replace 'ctx._repo' with 'ctx.repo()'
Matt Harbison -
r24302:6e092ea2 default
parent child Browse files
Show More
@@ -127,7 +127,7 b' def state(ctx, ui):'
127 127 src = src.lstrip() # strip any extra whitespace after ']'
128 128
129 129 if not util.url(src).isabs():
130 parent = _abssource(ctx._repo, abort=False)
130 parent = _abssource(ctx.repo(), abort=False)
131 131 if parent:
132 132 parent = util.url(parent)
133 133 parent.path = posixpath.join(parent.path or '', src)
@@ -332,7 +332,7 b' def subrepo(ctx, path):'
332 332 import hg as h
333 333 hg = h
334 334
335 pathutil.pathauditor(ctx._repo.root)(path)
335 pathutil.pathauditor(ctx.repo().root)(path)
336 336 state = ctx.substate[path]
337 337 if state[2] not in types:
338 338 raise util.Abort(_('unknown subrepo type %s') % state[2])
@@ -516,10 +516,10 b' class abstractsubrepo(object):'
516 516
517 517 class hgsubrepo(abstractsubrepo):
518 518 def __init__(self, ctx, path, state):
519 super(hgsubrepo, self).__init__(ctx._repo.ui)
519 super(hgsubrepo, self).__init__(ctx.repo().ui)
520 520 self._path = path
521 521 self._state = state
522 r = ctx._repo
522 r = ctx.repo()
523 523 root = r.wjoin(path)
524 524 create = not r.wvfs.exists('%s/.hg' % path)
525 525 self._repo = hg.repository(r.baseui, root, create=create)
@@ -898,7 +898,7 b' class hgsubrepo(abstractsubrepo):'
898 898
899 899 class svnsubrepo(abstractsubrepo):
900 900 def __init__(self, ctx, path, state):
901 super(svnsubrepo, self).__init__(ctx._repo.ui)
901 super(svnsubrepo, self).__init__(ctx.repo().ui)
902 902 self._path = path
903 903 self._state = state
904 904 self._ctx = ctx
@@ -922,7 +922,7 b' class svnsubrepo(abstractsubrepo):'
922 922 cmd.append('--non-interactive')
923 923 cmd.extend(commands)
924 924 if filename is not None:
925 path = os.path.join(self._ctx._repo.origroot, self._path, filename)
925 path = os.path.join(self._ctx.repo().origroot, self._path, filename)
926 926 cmd.append(path)
927 927 env = dict(os.environ)
928 928 # Avoid localized output, preserve current locale for everything else.
@@ -1064,7 +1064,7 b' class svnsubrepo(abstractsubrepo):'
1064 1064 os.chmod(path, stat.S_IMODE(s.st_mode) | stat.S_IWRITE)
1065 1065 os.remove(path)
1066 1066
1067 path = self._ctx._repo.wjoin(self._path)
1067 path = self._ctx.repo().wjoin(self._path)
1068 1068 shutil.rmtree(path, onerror=onerror)
1069 1069 try:
1070 1070 os.removedirs(os.path.dirname(path))
@@ -1082,7 +1082,7 b' class svnsubrepo(abstractsubrepo):'
1082 1082 # update to a directory which has since been deleted and recreated.
1083 1083 args.append('%s@%s' % (state[0], state[1]))
1084 1084 status, err = self._svncommand(args, failok=True)
1085 _sanitize(self.ui, self._ctx._repo.wjoin(self._path), '.svn')
1085 _sanitize(self.ui, self._ctx.repo().wjoin(self._path), '.svn')
1086 1086 if not re.search('Checked out revision [0-9]+.', status):
1087 1087 if ('is already a working copy for a different URL' in err
1088 1088 and (self._wcchanged()[:2] == (False, False))):
@@ -1128,13 +1128,13 b' class svnsubrepo(abstractsubrepo):'
1128 1128
1129 1129 class gitsubrepo(abstractsubrepo):
1130 1130 def __init__(self, ctx, path, state):
1131 super(gitsubrepo, self).__init__(ctx._repo.ui)
1131 super(gitsubrepo, self).__init__(ctx.repo().ui)
1132 1132 self._state = state
1133 1133 self._ctx = ctx
1134 1134 self._path = path
1135 self._relpath = os.path.join(reporelpath(ctx._repo), path)
1136 self._abspath = ctx._repo.wjoin(path)
1137 self._subparent = ctx._repo
1135 self._relpath = os.path.join(reporelpath(ctx.repo()), path)
1136 self._abspath = ctx.repo().wjoin(path)
1137 self._subparent = ctx.repo()
1138 1138 self._ensuregit()
1139 1139
1140 1140 def _ensuregit(self):
General Comments 0
You need to be logged in to leave comments. Login now