Skip to content

Commit

Permalink
Fix solving conflicts where ancestor is a V1 dump
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Jul 11, 2017
1 parent c0b4686 commit 2e69cfe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion yokadi/sync/conflictingobject.py
Expand Up @@ -26,10 +26,17 @@ def __init__(self, path, domain, ancestor, local, remote):
@staticmethod
def fromVcsConflict(conflict):
domain = os.path.dirname(conflict.path)

def _normalized_key(key):
# Turn V1 dump keys into V2 dump keys
return key.replace("Date", "_date")

def _load_json(json_or_none):
if json_or_none is None:
return None
return json.loads(json_or_none.decode('utf-8'))
dct = json.loads(json_or_none.decode('utf-8'))
return dict((_normalized_key(k), v) for k, v in dct.items())

ancestor = _load_json(conflict.ancestor)
local = _load_json(conflict.local)
remote = _load_json(conflict.remote)
Expand Down

0 comments on commit 2e69cfe

Please sign in to comment.