Make unified diffs group changed lines
Make unified diffs group changed lines

The current version of view/unified_diff.py simply zips the lines
together. Meaning when you look at the the diff it's hard to sometimes
see exactly what has changed.

This change changes the unified make_lines logic to group together
differences and then append them in chunks, which more closely matches
a unified diff. For example:

  177  179         def fake_sleep(amount):
  178  180             sleep_calls.append(amount)
  179  181
  180              def fake_audit_location_generator(*args, **kwargs):
  181                  audit_location_generator_calls[0] += 1
  182                  # Makes .container_sync() short-circuit
  183                  yield 'container.db', 'device', 'partition'
  184                  return
       182         class FakeSyncedContainersStore(object):
       183             def synced_containers_generator(self):
       184                 synced_containers_calls[0] += 1
       185                 # Makes .container_sync() short-circuit
       186                 yield 'container.db'
       187                 return
  185  188
  186  189         orig_time = sync.time
  187  190         orig_sleep = sync.sleep
  188  191         orig_ContainerBroker = sync.ContainerBroker

Change-Id: I8cb09bec11fa1746f6b5ebacff51acf1ec6ea376

openstack/gertty,stackforge/gertty