900
900
hashfile = self._transport.get('merge-hashes')
901
901
except errors.NoSuchFile:
905
if hashfile.next() != MERGE_MODIFIED_HEADER_1 + '\n':
906
if hashfile.next() != MERGE_MODIFIED_HEADER_1 + '\n':
907
raise errors.MergeModifiedFormatError()
908
except StopIteration:
906
909
raise errors.MergeModifiedFormatError()
907
except StopIteration:
908
raise errors.MergeModifiedFormatError()
909
for s in RioReader(hashfile):
910
# RioReader reads in Unicode, so convert file_ids back to utf8
911
file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
912
if file_id not in self.inventory:
914
text_hash = s.get("hash")
915
if text_hash == self.get_file_sha1(file_id):
916
merge_hashes[file_id] = text_hash
910
for s in RioReader(hashfile):
911
# RioReader reads in Unicode, so convert file_ids back to utf8
912
file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
913
if file_id not in self.inventory:
915
text_hash = s.get("hash")
916
if text_hash == self.get_file_sha1(file_id):
917
merge_hashes[file_id] = text_hash
919
922
@needs_write_lock
920
923
def mkdir(self, path, file_id=None):
2596
2599
except errors.NoSuchFile:
2597
2600
return _mod_conflicts.ConflictList()
2599
if confile.next() != CONFLICT_HEADER_1 + '\n':
2603
if confile.next() != CONFLICT_HEADER_1 + '\n':
2604
raise errors.ConflictFormatError()
2605
except StopIteration:
2600
2606
raise errors.ConflictFormatError()
2601
except StopIteration:
2602
raise errors.ConflictFormatError()
2603
return _mod_conflicts.ConflictList.from_stanzas(RioReader(confile))
2607
return _mod_conflicts.ConflictList.from_stanzas(RioReader(confile))
2605
2611
def unlock(self):
2606
2612
# do non-implementation specific cleanup