##// END OF EJS Templates
subrepo: prefetch ctx.repo() for efficiency and centralization...
FUJIWARA Katsunori -
r25768:7a9ef860 default
parent child Browse files
Show More
@@ -62,6 +62,7 b' def state(ctx, ui):'
62 62 (key in types dict))
63 63 """
64 64 p = config.config()
65 repo = ctx.repo()
65 66 def read(f, sections=None, remap=None):
66 67 if f in ctx:
67 68 try:
@@ -71,11 +72,10 b' def state(ctx, ui):'
71 72 raise
72 73 # handle missing subrepo spec files as removed
73 74 ui.warn(_("warning: subrepo spec file \'%s\' not found\n") %
74 util.pathto(ctx.repo().root, ctx.repo().getcwd(), f))
75 util.pathto(repo.root, repo.getcwd(), f))
75 76 return
76 77 p.parse(f, data, sections, remap, read)
77 78 else:
78 repo = ctx.repo()
79 79 raise util.Abort(_("subrepo spec file \'%s\' not found") %
80 80 util.pathto(repo.root, repo.getcwd(), f))
81 81
@@ -95,7 +95,6 b' def state(ctx, ui):'
95 95 try:
96 96 revision, path = l.split(" ", 1)
97 97 except ValueError:
98 repo = ctx.repo()
99 98 raise util.Abort(_("invalid subrepository revision "
100 99 "specifier in \'%s\' line %d")
101 100 % (util.pathto(repo.root, repo.getcwd(),
@@ -132,7 +131,7 b' def state(ctx, ui):'
132 131 src = src.lstrip() # strip any extra whitespace after ']'
133 132
134 133 if not util.url(src).isabs():
135 parent = _abssource(ctx.repo(), abort=False)
134 parent = _abssource(repo, abort=False)
136 135 if parent:
137 136 parent = util.url(parent)
138 137 parent.path = posixpath.join(parent.path or '', src)
General Comments 0
You need to be logged in to leave comments. Login now