# HG changeset patch # User Steve Losh # Date 1286936618 14400 # Node ID 6506376b04a191d96599b252b1e0aa00c4be24b9 # Parent ef0fbc6e5e6230e847e4368749678df3150aceb6 Add timestamps to the diff previews. diff -r ef0fbc6e5e62 -r 6506376b04a1 plugin/gundo.vim --- a/plugin/gundo.vim Tue Oct 12 20:20:37 2010 -0400 +++ b/plugin/gundo.vim Tue Oct 12 22:23:38 2010 -0400 @@ -653,8 +653,12 @@ _goto_window_for_buffer_name('__Gundo_Preview__') vim.command('setlocal modifiable') - # TODO: Make some nice dates from Node.time to give to difflib. - diff = list(difflib.unified_diff(before, after, node_before.n, node_after.n)) + def _fmt_time(t): + return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t))) + + diff = list(difflib.unified_diff(before, after, node_before.n, node_after.n, + _fmt_time(node_before.time) if node_before.n else 'n/a', + _fmt_time(node_after.time))) vim.current.buffer[:] = diff vim.command('setlocal nomodifiable')