Skip to content

Commit

Permalink
Bugfix in comparison of stream output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Sandve Alnæs committed Jan 28, 2016
1 parent b65b920 commit d7c11d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion nbdime/diffing/notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ def compare_output_data(x, y):
return False

if ot == "stream":
pass
if x["name"] != y["name"]:
return False
if x["text"] != y["text"]:
return False
#d = diff(x["text"], y["text"])
#return bool(d) # FIXME
else: # if ot == "display_data" or ot == "execute_result":
if set(x["data"].keys()) != set(y["data"].keys()):
return False
Expand All @@ -132,6 +137,7 @@ def compare_output_data(x, y):

def diff_source(a, b, compare="ignored"):
"Diff a pair of sources."
# FIXME: Make sure we use linebased diff of sources
# TODO: Use google-diff-patch-match library to diff the sources?
return diff(a, b)

Expand Down
2 changes: 1 addition & 1 deletion nbdime/merging/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _merge_dicts(base, local, remote, base_local_diff, base_remote_diff):
# (5) Conflict: removed one place and edited another, or edited in different ways
local_conflict_diff[key] = ld
remote_conflict_diff[key] = rd
elif lop == DELETE and rop == DELETE:
elif lop == DELETE:
# (4) Removed in both local and remote, just don't add it to merge result
pass
elif lop in (INSERT, REPLACE, PATCH) and lv == rv:
Expand Down

0 comments on commit d7c11d2

Please sign in to comment.