##// END OF EJS Templates
manifest: mark addlistdelta and checkforbidden as module-private
Augie Fackler -
r22415:65ec6c5c default
parent child Browse files
Show More
@@ -41,7 +41,7 b' class manifestdict(dict):'
41 return dicthelpers.diff(self._flags, d2._flags, "")
41 return dicthelpers.diff(self._flags, d2._flags, "")
42
42
43
43
44 def checkforbidden(l):
44 def _checkforbidden(l):
45 """Check filenames for illegal characters."""
45 """Check filenames for illegal characters."""
46 for f in l:
46 for f in l:
47 if '\n' in f or '\r' in f:
47 if '\n' in f or '\r' in f:
@@ -51,7 +51,7 b' def checkforbidden(l):'
51
51
52 # apply the changes collected during the bisect loop to our addlist
52 # apply the changes collected during the bisect loop to our addlist
53 # return a delta suitable for addrevision
53 # return a delta suitable for addrevision
54 def addlistdelta(addlist, x):
54 def _addlistdelta(addlist, x):
55 # for large addlist arrays, building a new array is cheaper
55 # for large addlist arrays, building a new array is cheaper
56 # than repeatedly modifying the existing one
56 # than repeatedly modifying the existing one
57 currentposition = 0
57 currentposition = 0
@@ -166,7 +166,7 b' class manifest(revlog.revlog):'
166 # parented by the same node we're diffing against
166 # parented by the same node we're diffing against
167 if not (changed and p1 and (p1 in self._mancache)):
167 if not (changed and p1 and (p1 in self._mancache)):
168 files = sorted(map)
168 files = sorted(map)
169 checkforbidden(files)
169 _checkforbidden(files)
170
170
171 # if this is changed to support newlines in filenames,
171 # if this is changed to support newlines in filenames,
172 # be sure to check the templates/ dir again (especially *-raw.tmpl)
172 # be sure to check the templates/ dir again (especially *-raw.tmpl)
@@ -179,7 +179,7 b' class manifest(revlog.revlog):'
179 added, removed = changed
179 added, removed = changed
180 addlist = self._mancache[p1][1]
180 addlist = self._mancache[p1][1]
181
181
182 checkforbidden(added)
182 _checkforbidden(added)
183 # combine the changed lists into one list for sorting
183 # combine the changed lists into one list for sorting
184 work = [(x, False) for x in added]
184 work = [(x, False) for x in added]
185 work.extend((x, True) for x in removed)
185 work.extend((x, True) for x in removed)
@@ -223,7 +223,7 b' class manifest(revlog.revlog):'
223 if dstart is not None:
223 if dstart is not None:
224 delta.append([dstart, dend, "".join(dline)])
224 delta.append([dstart, dend, "".join(dline)])
225 # apply the delta to the addlist, and get a delta for addrevision
225 # apply the delta to the addlist, and get a delta for addrevision
226 deltatext, addlist = addlistdelta(addlist, delta)
226 deltatext, addlist = _addlistdelta(addlist, delta)
227 cachedelta = (self.rev(p1), deltatext)
227 cachedelta = (self.rev(p1), deltatext)
228 arraytext = addlist
228 arraytext = addlist
229 text = util.buffer(arraytext)
229 text = util.buffer(arraytext)
General Comments 0
You need to be logged in to leave comments. Login now