comparison mercurial/manifest.py @ 14632:4819241ec1ad

manifest: use "\0" instead of "\000" Though both give the same result (a NUL byte), I found that I tend to read "\000" as "\0" + "00", which is something completely different. I did not change the occurance of "\000" in archival.py since there are other octal constants in that file.
author Martin Geisler <mg@aragost.com>
date Thu, 16 Jun 2011 08:49:26 +0200
parents d62d597b8974
children d976b1ef6760
comparison
equal deleted inserted replaced
14631:234b9795d74e 14632:4819241ec1ad
140 checkforbidden(files) 140 checkforbidden(files)
141 141
142 # if this is changed to support newlines in filenames, 142 # if this is changed to support newlines in filenames,
143 # be sure to check the templates/ dir again (especially *-raw.tmpl) 143 # be sure to check the templates/ dir again (especially *-raw.tmpl)
144 hex, flags = revlog.hex, map.flags 144 hex, flags = revlog.hex, map.flags
145 text = ''.join("%s\000%s%s\n" % (f, hex(map[f]), flags(f)) 145 text = ''.join("%s\0%s%s\n" % (f, hex(map[f]), flags(f))
146 for f in files) 146 for f in files)
147 arraytext = array.array('c', text) 147 arraytext = array.array('c', text)
148 cachedelta = None 148 cachedelta = None
149 else: 149 else:
150 added, removed = changed 150 added, removed = changed
170 # each line and creates the deltas 170 # each line and creates the deltas
171 for f, todelete in work: 171 for f, todelete in work:
172 # bs will either be the index of the item or the insert point 172 # bs will either be the index of the item or the insert point
173 start, end = self._search(addbuf, f, start) 173 start, end = self._search(addbuf, f, start)
174 if not todelete: 174 if not todelete:
175 l = "%s\000%s%s\n" % (f, revlog.hex(map[f]), map.flags(f)) 175 l = "%s\0%s%s\n" % (f, revlog.hex(map[f]), map.flags(f))
176 else: 176 else:
177 if start == end: 177 if start == end:
178 # item we want to delete was not found, error out 178 # item we want to delete was not found, error out
179 raise AssertionError( 179 raise AssertionError(
180 _("failed to remove %s from manifest") % f) 180 _("failed to remove %s from manifest") % f)