activate tags field

remotes/origin/release/3.1.1
Miguel Gonzalez 2018-02-06 14:17:31 +01:00
parent 3180dfeda0
commit 9337f04621
2 changed files with 18 additions and 1 deletions

View File

@ -29,7 +29,6 @@ EXCLUDED_FIELDS = (
NON_SQUASHABLE_FIELDS = (
'points',
'attachments',
'tags',
'watchers',
'description_diff',
'content_diff',
@ -49,9 +48,14 @@ def summary(field, entries):
if len(entries) <= 1:
return entries
# Apply squashing algorithm. In this case, get first `from` and last `to`.
initial = entries[0].values_diff[field]
final = entries[-1].values_diff[field]
from_, to = initial[0], final[1]
# If the resulting squashed `from` and `to` are equal we can skip
# this entry completely
return [] if from_ == to else [HistoryEntry('', {field: [from_, to]})]

View File

@ -84,3 +84,16 @@ def test_squash_values_diff_with_multiple_fields():
squashed = squashing.squash_history_entries(history_entries)
assert_(expected, squashed, ordered=False)
def test_squash_arrays():
history_entries = [
squashing.HistoryEntry(comment='', values_diff={'tags': [['A', 'B'], ['A']]}),
squashing.HistoryEntry(comment='', values_diff={'tags': [['A'], ['A', 'C']]}),
]
expected = [
squashing.HistoryEntry(comment='', values_diff={'tags': [['A', 'B'], ['A', 'C']]}),
]
squashed = squashing.squash_history_entries(history_entries)
assert_(expected, squashed, ordered=False)