diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4809,6 +4809,8 @@ service = server.createservice(ui, repo, opts) return server.runservice(opts, initfn=service.init, runfn=service.run) +_NOTTERSE = 'nothing' + @command('^status|st', [('A', 'all', None, _('show status of all files')), ('m', 'modified', None, _('show only modified files')), @@ -4819,7 +4821,7 @@ ('u', 'unknown', None, _('show only unknown (not tracked) files')), ('i', 'ignored', None, _('show only ignored files')), ('n', 'no-status', None, _('hide status prefix')), - ('t', 'terse', '', _('show the terse output (EXPERIMENTAL)')), + ('t', 'terse', _NOTTERSE, _('show the terse output (EXPERIMENTAL)')), ('C', 'copies', None, _('show source of copied files')), ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), ('', 'rev', [], _('show difference from revision'), _('REV')), @@ -4917,6 +4919,11 @@ revs = opts.get('rev') change = opts.get('change') terse = opts.get('terse') + if terse is _NOTTERSE: + if revs: + terse = '' + else: + terse = ui.config('commands', 'status.terse') if revs and change: msg = _('cannot specify --rev and --change at the same time') diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -193,6 +193,9 @@ coreconfigitem('commands', 'status.skipstates', default=[], ) +coreconfigitem('commands', 'status.terse', + default='', +) coreconfigitem('commands', 'status.verbose', default=False, ) diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -442,6 +442,10 @@ Make paths in :hg:`status` output relative to the current directory. (default: False) +``status.terse`` + Default value for the --terse flag, which condenes status output. + (default: empty) + ``update.check`` Determines what level of checking :hg:`update` will perform before moving to a destination revision. Valid values are ``abort``, ``none``, diff --git a/tests/test-status-terse.t b/tests/test-status-terse.t --- a/tests/test-status-terse.t +++ b/tests/test-status-terse.t @@ -183,3 +183,55 @@ $ hg status --terse marduic --rev 0 --rev 1 abort: cannot use --terse with --rev [255] + +Config item to set the default terseness + $ cat <> $HGRCPATH + > [commands] + > status.terse = u + > EOF + $ hg status -mu + M x/aa + M x/bb + ? a + ? b + ? x/l/ + ? x/m/ + ? x/n/ + ? y/ + +Command line flag overrides the default + $ hg status --terse= + M x/aa + M x/bb + ? a + ? b + ? x/l/aa + ? x/l/u/a/bb + ? x/l/u/bb + ? x/m/aa + ? x/n/aa + ? y/l + ? y/m + $ hg status --terse=mardu + M x/aa + M x/bb + ? a + ? b + ? x/l/ + ? x/m/ + ? x/n/ + ? y/ + +Specifying --rev should still work, with the terseness disabled. + $ hg status --rev 0 + M x/aa + M x/bb + ? a + ? b + ? x/l/aa + ? x/l/u/a/bb + ? x/l/u/bb + ? x/m/aa + ? x/n/aa + ? y/l + ? y/m