Formatting.
This commit is contained in:
parent
52c65f2eb4
commit
63ca27fa2a
@ -14,7 +14,8 @@ import sys
|
|||||||
import time
|
import time
|
||||||
import vim
|
import vim
|
||||||
|
|
||||||
# Mercurial's graphlog code
|
|
||||||
|
# Mercurial's graphlog code --------------------------------------------------------
|
||||||
def asciiedges(seen, rev, parents):
|
def asciiedges(seen, rev, parents):
|
||||||
"""adds edge info to changelog DAG walk suitable for ascii()"""
|
"""adds edge info to changelog DAG walk suitable for ascii()"""
|
||||||
if rev not in seen:
|
if rev not in seen:
|
||||||
@ -193,8 +194,8 @@ def generate(dag, edgefn, current):
|
|||||||
ascii(buf, state, 'C', char, [line], edgefn(seen, node, parents))
|
ascii(buf, state, 'C', char, [line], edgefn(seen, node, parents))
|
||||||
return buf.b
|
return buf.b
|
||||||
|
|
||||||
# Mercurial age function
|
|
||||||
|
|
||||||
|
# Mercurial age function -----------------------------------------------------------
|
||||||
agescales = [("year", 3600 * 24 * 365),
|
agescales = [("year", 3600 * 24 * 365),
|
||||||
("month", 3600 * 24 * 30),
|
("month", 3600 * 24 * 30),
|
||||||
("week", 3600 * 24 * 7),
|
("week", 3600 * 24 * 7),
|
||||||
@ -227,8 +228,8 @@ def age(ts):
|
|||||||
if n >= 2 or s == 1:
|
if n >= 2 or s == 1:
|
||||||
return '%s ago' % fmt(t, n)
|
return '%s ago' % fmt(t, n)
|
||||||
|
|
||||||
# Python Vim utility functions
|
|
||||||
|
|
||||||
|
# Python Vim utility functions -----------------------------------------------------
|
||||||
normal = lambda s: vim.command('normal %s' % s)
|
normal = lambda s: vim.command('normal %s' % s)
|
||||||
|
|
||||||
MISSING_BUFFER = "Cannot find Gundo's target buffer (%s)"
|
MISSING_BUFFER = "Cannot find Gundo's target buffer (%s)"
|
||||||
@ -278,8 +279,8 @@ INLINE_HELP = '''\
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# Python undo tree data structures and functions
|
|
||||||
|
|
||||||
|
# Python undo tree data structures and functions -----------------------------------
|
||||||
class Buffer(object):
|
class Buffer(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.b = ''
|
self.b = ''
|
||||||
@ -325,10 +326,10 @@ def changenr(nodes):
|
|||||||
current = int(vim.eval('changenr()'))
|
current = int(vim.eval('changenr()'))
|
||||||
return current
|
return current
|
||||||
|
|
||||||
# Gundo rendering
|
|
||||||
|
# Gundo rendering ------------------------------------------------------------------
|
||||||
|
|
||||||
# Rendering utility functions
|
# Rendering utility functions
|
||||||
|
|
||||||
def _fmt_time(t):
|
def _fmt_time(t):
|
||||||
return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t)))
|
return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t)))
|
||||||
|
|
||||||
@ -499,8 +500,8 @@ def GundoRenderChangePreview():
|
|||||||
|
|
||||||
_goto_window_for_buffer_name('__Gundo__')
|
_goto_window_for_buffer_name('__Gundo__')
|
||||||
|
|
||||||
# Gundo undo/redo
|
|
||||||
|
|
||||||
|
# Gundo undo/redo
|
||||||
def GundoRevert():
|
def GundoRevert():
|
||||||
if not _check_sanity():
|
if not _check_sanity():
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user