##// END OF EJS Templates
narrow: extract helper for parsing narrowspec file...
Martin von Zweigbergk -
r40726:efd0f792 default
parent child Browse files
Show More
@@ -127,6 +127,18 def match(root, include=None, exclude=No
127 return matchmod.match(root, '', [], include=include or [],
127 return matchmod.match(root, '', [], include=include or [],
128 exclude=exclude or [])
128 exclude=exclude or [])
129
129
130 def parseconfig(ui, spec):
131 # maybe we should care about the profiles returned too
132 includepats, excludepats, profiles = sparse.parseconfig(ui, spec, 'narrow')
133 if profiles:
134 raise error.Abort(_("including other spec files using '%include' is not"
135 " supported in narrowspec"))
136
137 validatepatterns(includepats)
138 validatepatterns(excludepats)
139
140 return includepats, excludepats
141
130 def load(repo):
142 def load(repo):
131 try:
143 try:
132 spec = repo.svfs.read(FILENAME)
144 spec = repo.svfs.read(FILENAME)
@@ -136,17 +148,8 def load(repo):
136 if e.errno == errno.ENOENT:
148 if e.errno == errno.ENOENT:
137 return set(), set()
149 return set(), set()
138 raise
150 raise
139 # maybe we should care about the profiles returned too
140 includepats, excludepats, profiles = sparse.parseconfig(repo.ui, spec,
141 'narrow')
142 if profiles:
143 raise error.Abort(_("including other spec files using '%include' is not"
144 " supported in narrowspec"))
145
151
146 validatepatterns(includepats)
152 return parseconfig(repo.ui, spec)
147 validatepatterns(excludepats)
148
149 return includepats, excludepats
150
153
151 def save(repo, includepats, excludepats):
154 def save(repo, includepats, excludepats):
152 validatepatterns(includepats)
155 validatepatterns(includepats)
General Comments 0
You need to be logged in to leave comments. Login now