mercurial/manifest.py
changeset 14632 4819241ec1ad
parent 14208 d62d597b8974
child 15657 d976b1ef6760
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)