mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
21 lines
534 B
Python
21 lines
534 B
Python
|
# stat.py
|
||
|
#
|
||
|
# Copyright 2017 Facebook, Inc.
|
||
|
#
|
||
|
# This software may be used and distributed according to the terms of the
|
||
|
# GNU General Public License version 2 or any later version.
|
||
|
|
||
|
from mercurial import (
|
||
|
patch,
|
||
|
registrar,
|
||
|
util,
|
||
|
)
|
||
|
|
||
|
templatekeyword = registrar.templatekeyword()
|
||
|
|
||
|
@templatekeyword('stat')
|
||
|
def showdiffstat(repo, ctx, templ, **args):
|
||
|
"""String. Return diffstat-style summary of changes."""
|
||
|
width = repo.ui.termwidth()
|
||
|
return patch.diffstat(util.iterlines(ctx.diff(noprefix=False)), width=width)
|