# HG changeset patch # User Matt Mackall # Date 1214612820 18000 # Node ID be142cb994ff7ffbae2e5757997cb51fd60587b8 # Parent 8db64464d136a5a540158261cc8b871663013f0c manifest: make checkforbidden take a list diff -r 8db64464d136 -r be142cb994ff mercurial/manifest.py --- a/mercurial/manifest.py Fri Jun 27 19:25:48 2008 -0500 +++ b/mercurial/manifest.py Fri Jun 27 19:27:00 2008 -0500 @@ -119,16 +119,16 @@ return "".join([struct.pack(">lll", d[0], d[1], len(d[2])) + d[2] for d in x ]) - def checkforbidden(f): - if '\n' in f or '\r' in f: - raise RevlogError(_("'\\n' and '\\r' disallowed in filenames")) + def checkforbidden(l): + for f in l: + if '\n' in f or '\r' in f: + raise RevlogError(_("'\\n' and '\\r' disallowed in filenames")) # if we're using the listcache, make sure it is valid and # parented by the same node we're diffing against if not (changed and self.listcache and p1 and self.mapcache[0] == p1): files = util.sort(map) - for f in files: - checkforbidden(f) + checkforbidden(files) # if this is changed to support newlines in filenames, # be sure to check the templates/ dir again (especially *-raw.tmpl) @@ -139,8 +139,7 @@ else: addlist = self.listcache - for f in changed[0]: - checkforbidden(f) + checkforbidden(changed[0]) # combine the changed lists into one list for sorting work = [[x, 0] for x in changed[0]] work[len(work):] = [[x, 1] for x in changed[1]]