Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1168)

Issue 11709044: Datastructure (usually meta rev) diff function (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by ana.balica
Modified:
10 years, 9 months ago
Reviewers:
thomas.j.waldmann
Visibility:
Public.

Description

Datastruct (or meta) diff is a useful function for displaying changes in the UI and in mail notifications. Consider having a nested datastructure with the following possible data types: dict, list, unicode, int, float, long, NoneType. The end result is represented as a list of tuples, each marking an addition or a deletion in a sorted order.

Patch Set 1 #

Total comments: 18

Patch Set 2 : Split tests and use Undefined class in diff function #

Total comments: 2

Patch Set 3 : Update diff function #

Total comments: 35

Patch Set 4 : Restructured tests #

Total comments: 1

Patch Set 5 : Change tests #

Total comments: 14

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+179 lines, -0 lines) Patch
A MoinMoin/util/_tests/test_diff_datastruct.py View 1 2 3 4 5 1 chunk +99 lines, -0 lines 0 comments Download
A MoinMoin/util/diff_datastruct.py View 1 2 3 4 5 1 chunk +80 lines, -0 lines 0 comments Download

Messages

Total messages: 13
Thomas.J.Waldmann
you didn't run that code, right? :) https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py File MoinMoin/constants/keys.py (right): https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py#newcode122 MoinMoin/constants/keys.py:122: # diff ...
10 years, 10 months ago (2013-07-24 12:41:08 UTC) #1
ana.balica
https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py File MoinMoin/constants/keys.py (right): https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py#newcode122 MoinMoin/constants/keys.py:122: # diff markers maybe move to misc.py? https://codereview.appspot.com/11709044/diff/1/MoinMoin/util/_tests/test_diff_datastruct.py File ...
10 years, 10 months ago (2013-07-24 15:44:44 UTC) #2
Thomas.J.Waldmann
https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py File MoinMoin/constants/keys.py (right): https://codereview.appspot.com/11709044/diff/1/MoinMoin/constants/keys.py#newcode122 MoinMoin/constants/keys.py:122: # diff markers On 2013/07/24 15:44:44, ana.balica wrote: > ...
10 years, 10 months ago (2013-07-24 17:23:07 UTC) #3
ana.balica
https://codereview.appspot.com/11709044/diff/2/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/2/MoinMoin/util/_tests/test_diff_datastruct.py#newcode22 MoinMoin/util/_tests/test_diff_datastruct.py:22: def test_diff_none(self): The samples with other types like (bool, ...
10 years, 10 months ago (2013-07-24 17:25:34 UTC) #4
ana.balica
https://codereview.appspot.com/11709044/diff/1/MoinMoin/util/diff_datastruct.py File MoinMoin/util/diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/1/MoinMoin/util/diff_datastruct.py#newcode89 MoinMoin/util/diff_datastruct.py:89: raise TypeError("Unsupported data type {0}".format(type(d))) On 2013/07/24 17:23:07, Thomas.J.Waldmann ...
10 years, 10 months ago (2013-07-24 17:31:58 UTC) #5
Thomas.J.Waldmann
https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode13 MoinMoin/util/_tests/test_diff_datastruct.py:13: DELETE = u"delete" btw, as this is only used ...
10 years, 10 months ago (2013-07-24 22:39:57 UTC) #6
ana.balica
https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode13 MoinMoin/util/_tests/test_diff_datastruct.py:13: DELETE = u"delete" On 2013/07/24 22:39:57, Thomas.J.Waldmann wrote: > ...
10 years, 10 months ago (2013-07-25 07:47:11 UTC) #7
Thomas.J.Waldmann
https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode13 MoinMoin/util/_tests/test_diff_datastruct.py:13: DELETE = u"delete" > why mark INSERT as 0 ...
10 years, 10 months ago (2013-07-25 08:42:04 UTC) #8
Thomas.J.Waldmann
https://codereview.appspot.com/11709044/diff/21001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/21001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode25 MoinMoin/util/_tests/test_diff_datastruct.py:25: assert diff(v1, v2) == expected that's correct, but why ...
10 years, 10 months ago (2013-07-25 08:49:59 UTC) #9
ana.balica
https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/16001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode13 MoinMoin/util/_tests/test_diff_datastruct.py:13: DELETE = u"delete" On 2013/07/25 08:42:05, Thomas.J.Waldmann wrote: > ...
10 years, 10 months ago (2013-07-25 19:19:02 UTC) #10
Thomas.J.Waldmann
https://codereview.appspot.com/11709044/diff/32001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/32001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode22 MoinMoin/util/_tests/test_diff_datastruct.py:22: (None, Undefined, [(DELETE, [], None)])] if you have 1 ...
10 years, 9 months ago (2013-07-26 11:57:11 UTC) #11
ana.balica
https://codereview.appspot.com/11709044/diff/32001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11709044/diff/32001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode59 MoinMoin/util/_tests/test_diff_datastruct.py:59: (u"diff1", u"diff2", [(DELETE, [], u"1"), (INSERT, [], u"2")])] On ...
10 years, 9 months ago (2013-07-26 12:59:47 UTC) #12
Thomas.J.Waldmann
10 years, 9 months ago (2013-07-26 14:02:40 UTC) #13
ok!
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b