folder conflicting

This commit is contained in:
Amber 2024-11-02 08:22:36 +01:00
parent 2dc1c8e9d1
commit d37d577289

View File

@ -248,7 +248,9 @@ class Manager():
for node in nodes: for node in nodes:
if node['cur_type'] == 'f': if node['cur_type'] == 'f':
n = self.store_fdiff(node) n = self.store_fdiff(node)
todump.append(n) todump.append(n)
continue
todump.append(node)
_dump.dump_snapshot(todump, path=unmerged_path, dump_file_name='.unmerged.json.gz') _dump.dump_snapshot(todump, path=unmerged_path, dump_file_name='.unmerged.json.gz')
@ -351,7 +353,7 @@ class Manager():
absolute_local_path = colors.CYAN(self.get_absolute_local_path(unode)) absolute_local_path = colors.CYAN(self.get_absolute_local_path(unode))
name = unode['name'] name = unode['name']
remote_hash = unode['remote_hash'] remote_hash = unode['remote_hash']
last_type = unode['last_type'] last_type = unode.get('last_type')
local_hash = unode['cur_hash'] local_hash = unode['cur_hash']
cur_type = unode['cur_type'] cur_type = unode['cur_type']
last_hash = unode['last_hash'] last_hash = unode['last_hash']
@ -418,7 +420,10 @@ class Manager():
remote_hash = node.get('remote_hash') remote_hash = node.get('remote_hash')
if remote_hash is None and rexists: if remote_hash is None and rexists:
# if node is added in local tree `remote_hash` don't exists # if node is added in local tree,
# but a copy appears in remote tree
#`we don't know before, remote_hash` don't exists
conflicting = True
unode = node.copy() unode = node.copy()
unode['last_hash'] = None unode['last_hash'] = None
unode['remote_hash'] = rhash unode['remote_hash'] = rhash
@ -502,6 +507,9 @@ class Manager():
## mark node as synched with remote, ## mark node as synched with remote,
dones.append(node) dones.append(node)
if unmerged:
self.store_unmerged_diff(unmerged)
return dones return dones