mercurial/mergestate.py
changeset 45160 fcd0cff3400a
parent 45159 e05a488cbed0
child 45161 9abdc0bd2ab9
equal deleted inserted replaced
45159:e05a488cbed0 45160:fcd0cff3400a
    49 RECORD_FILE_VALUES = b'f'
    49 RECORD_FILE_VALUES = b'f'
    50 RECORD_LABELS = b'l'
    50 RECORD_LABELS = b'l'
    51 RECORD_OVERRIDE = b't'
    51 RECORD_OVERRIDE = b't'
    52 RECORD_UNSUPPORTED_MANDATORY = b'X'
    52 RECORD_UNSUPPORTED_MANDATORY = b'X'
    53 RECORD_UNSUPPORTED_ADVISORY = b'x'
    53 RECORD_UNSUPPORTED_ADVISORY = b'x'
    54 RECORD_RESOLVED_OTHER = b'R'
       
    55 
    54 
    56 MERGE_DRIVER_STATE_UNMARKED = b'u'
    55 MERGE_DRIVER_STATE_UNMARKED = b'u'
    57 MERGE_DRIVER_STATE_MARKED = b'm'
    56 MERGE_DRIVER_STATE_MARKED = b'm'
    58 MERGE_DRIVER_STATE_SUCCESS = b's'
    57 MERGE_DRIVER_STATE_SUCCESS = b's'
    59 
    58 
   218             elif rtype in (
   217             elif rtype in (
   219                 RECORD_MERGED,
   218                 RECORD_MERGED,
   220                 RECORD_CHANGEDELETE_CONFLICT,
   219                 RECORD_CHANGEDELETE_CONFLICT,
   221                 RECORD_PATH_CONFLICT,
   220                 RECORD_PATH_CONFLICT,
   222                 RECORD_MERGE_DRIVER_MERGE,
   221                 RECORD_MERGE_DRIVER_MERGE,
   223                 RECORD_RESOLVED_OTHER,
       
   224             ):
   222             ):
   225                 bits = record.split(b'\0')
   223                 bits = record.split(b'\0')
   226                 self._state[bits[0]] = bits[1:]
   224                 self._state[bits[0]] = bits[1:]
   227             elif rtype == RECORD_FILE_VALUES:
   225             elif rtype == RECORD_FILE_VALUES:
   228                 filename, rawextras = record.split(b'\0', 1)
   226                 filename, rawextras = record.split(b'\0', 1)
   446                 # resolution state ('pu' or 'pr') is stored within the record.
   444                 # resolution state ('pu' or 'pr') is stored within the record.
   447                 records.append(
   445                 records.append(
   448                     (RECORD_PATH_CONFLICT, b'\0'.join([filename] + v))
   446                     (RECORD_PATH_CONFLICT, b'\0'.join([filename] + v))
   449                 )
   447                 )
   450             elif v[0] == MERGE_RECORD_MERGED_OTHER:
   448             elif v[0] == MERGE_RECORD_MERGED_OTHER:
   451                 records.append(
   449                 records.append((RECORD_MERGED, b'\0'.join([filename] + v)))
   452                     (RECORD_RESOLVED_OTHER, b'\0'.join([filename] + v))
       
   453                 )
       
   454             elif v[1] == nullhex or v[6] == nullhex:
   450             elif v[1] == nullhex or v[6] == nullhex:
   455                 # Change/Delete or Delete/Change conflicts. These are stored in
   451                 # Change/Delete or Delete/Change conflicts. These are stored in
   456                 # 'C' records. v[1] is the local file, and is nullhex when the
   452                 # 'C' records. v[1] is the local file, and is nullhex when the
   457                 # file is deleted locally ('dc'). v[6] is the remote file, and
   453                 # file is deleted locally ('dc'). v[6] is the remote file, and
   458                 # is nullhex when the file is deleted remotely ('cd').
   454                 # is nullhex when the file is deleted remotely ('cd').