Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 43841:fb4a6d584756
status: split morestatus data loading from display
This is a small refactoring in preparation for adding more morestatus
functionality (notably for templated/JSON output) - the goal is to
use the data inside the status display loop, as well as output the
overall state in a templatable/structured way.
Differential Revision: https://phab.mercurial-scm.org/D7593
author | Rodrigo Damazio Bovendorp <rdamazio@google.com> |
---|---|
date | Mon, 09 Dec 2019 18:15:38 -0800 |
parents | a6483107a07a |
children | 7315464f0613 |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Nov 21 16:54:00 2019 +0100 +++ b/mercurial/commands.py Mon Dec 09 18:15:38 2019 -0800 @@ -6867,6 +6867,12 @@ ) and not opts.get(b'no_status'): copy = copies.pathcopies(ctx1, ctx2, m) + morestatus = None + if ( + ui.verbose or ui.configbool(b'commands', b'status.verbose') + ) and not ui.plain(): + morestatus = cmdutil.readmorestatus(repo) + ui.pager(b'status') fm = ui.formatter(b'status', opts) fmt = b'%s' + end @@ -6888,10 +6894,8 @@ label=b'status.copied', ) - if ( - ui.verbose or ui.configbool(b'commands', b'status.verbose') - ) and not ui.plain(): - cmdutil.morestatus(repo, fm) + if morestatus: + morestatus.formatfooter(fm) fm.end()