mercurial/merge.py
changeset 34560 1248aa48cac9
parent 34555 989e884d1be9
child 34680 c0a524f77e8a
equal deleted inserted replaced
34559:eddeedbde866 34560:1248aa48cac9
   359         records.append(('L', hex(self._local)))
   359         records.append(('L', hex(self._local)))
   360         records.append(('O', hex(self._other)))
   360         records.append(('O', hex(self._other)))
   361         if self.mergedriver:
   361         if self.mergedriver:
   362             records.append(('m', '\0'.join([
   362             records.append(('m', '\0'.join([
   363                 self.mergedriver, self._mdstate])))
   363                 self.mergedriver, self._mdstate])))
   364         for d, v in self._state.iteritems():
   364         # Write out state items. In all cases, the value of the state map entry
       
   365         # is written as the contents of the record. The record type depends on
       
   366         # the type of state that is stored, and capital-letter records are used
       
   367         # to prevent older versions of Mercurial that do not support the feature
       
   368         # from loading them.
       
   369         for filename, v in self._state.iteritems():
   365             if v[0] == 'd':
   370             if v[0] == 'd':
   366                 records.append(('D', '\0'.join([d] + v)))
   371                 # Driver-resolved merge. These are stored in 'D' records.
       
   372                 records.append(('D', '\0'.join([filename] + v)))
   367             elif v[0] in ('pu', 'pr'):
   373             elif v[0] in ('pu', 'pr'):
   368                 records.append(('P', '\0'.join([d] + v)))
   374                 # Path conflicts. These are stored in 'P' records.  The current
   369             # v[1] == local ('cd'), v[6] == other ('dc') -- not supported by
   375                 # resolution state ('pu' or 'pr') is stored within the record.
   370             # older versions of Mercurial
   376                 records.append(('P', '\0'.join([filename] + v)))
   371             elif v[1] == nullhex or v[6] == nullhex:
   377             elif v[1] == nullhex or v[6] == nullhex:
   372                 records.append(('C', '\0'.join([d] + v)))
   378                 # Change/Delete or Delete/Change conflicts. These are stored in
       
   379                 # 'C' records. v[1] is the local file, and is nullhex when the
       
   380                 # file is deleted locally ('dc'). v[6] is the remote file, and
       
   381                 # is nullhex when the file is deleted remotely ('cd').
       
   382                 records.append(('C', '\0'.join([filename] + v)))
   373             else:
   383             else:
   374                 records.append(('F', '\0'.join([d] + v)))
   384                 # Normal files.  These are stored in 'F' records.
       
   385                 records.append(('F', '\0'.join([filename] + v)))
   375         for filename, extras in sorted(self._stateextras.iteritems()):
   386         for filename, extras in sorted(self._stateextras.iteritems()):
   376             rawextras = '\0'.join('%s\0%s' % (k, v) for k, v in
   387             rawextras = '\0'.join('%s\0%s' % (k, v) for k, v in
   377                                   extras.iteritems())
   388                                   extras.iteritems())
   378             records.append(('f', '%s\0%s' % (filename, rawextras)))
   389             records.append(('f', '%s\0%s' % (filename, rawextras)))
   379         if self._labels is not None:
   390         if self._labels is not None: