Patchwork [1,of,4] annotate: format local tables in less-dense form

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 24, 2018, 12:34 p.m.
Message ID <4c5309a4bd4028c260fc.1543062855@mimosa>
Download mbox | patch
Permalink /patch/36762/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 24, 2018, 12:34 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1543052204 -32400
#      Sat Nov 24 18:36:44 2018 +0900
# Node ID 4c5309a4bd4028c260fcc6ceda1ba48167e8733e
# Parent  50a64c321c1e74b98ec1fa959bdc92efdc6f4ee7
annotate: format local tables in less-dense form

I'll move these to a class, where one-extra indent will be needed.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -358,15 +358,20 @@  def annotate(ui, repo, *pats, **opts):
         formatrev = b'%d'.__mod__
         formathex = shorthex
 
-    opmap = [('user', ' ', lambda x: x.fctx.user(), ui.shortuser),
-             ('rev', ' ', lambda x: scmutil.intrev(x.fctx), formatrev),
-             ('node', ' ', lambda x: hex(scmutil.binnode(x.fctx)), formathex),
-             ('date', ' ', lambda x: x.fctx.date(), util.cachefunc(datefunc)),
-             ('path', ' ', lambda x: x.fctx.path(), pycompat.bytestr),
-             ('lineno', ':', lambda x: x.lineno, pycompat.bytestr),
-            ]
-    opnamemap = {'rev': 'number', 'node': 'changeset', 'path': 'file',
-                 'lineno': 'line_number'}
+    opmap = [
+        ('user', ' ', lambda x: x.fctx.user(), ui.shortuser),
+        ('rev', ' ', lambda x: scmutil.intrev(x.fctx), formatrev),
+        ('node', ' ', lambda x: hex(scmutil.binnode(x.fctx)), formathex),
+        ('date', ' ', lambda x: x.fctx.date(), util.cachefunc(datefunc)),
+        ('path', ' ', lambda x: x.fctx.path(), pycompat.bytestr),
+        ('lineno', ':', lambda x: x.lineno, pycompat.bytestr),
+    ]
+    opnamemap = {
+        'rev': 'number',
+        'node': 'changeset',
+        'path': 'file',
+        'lineno': 'line_number',
+    }
 
     if (not opts.get('user') and not opts.get('changeset')
         and not opts.get('date') and not opts.get('file')):