diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -101,6 +101,12 @@ commitopts2 = [ _('record the specified user as committer'), _('USER')), ] +# hidden for now +formatteropts = [ + ('T', 'template', '', + _('display with template (DEPRECATED)'), _('TEMPLATE')), +] + templateopts = [ ('', 'style', '', _('display using template map file (DEPRECATED)'), _('STYLE')), @@ -3064,7 +3070,7 @@ def export(ui, repo, *changesets, **opts @command('files', [('r', 'rev', '', _('search the repository as it is in REV'), _('REV')), ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), - ] + walkopts, + ] + walkopts + formatteropts, _('[OPTION]... [PATTERN]...')) def files(ui, repo, *pats, **opts): """list tracked files @@ -4343,7 +4349,8 @@ def log(ui, repo, *pats, **opts): @command('manifest', [('r', 'rev', '', _('revision to display'), _('REV')), - ('', 'all', False, _("list files from all revisions"))], + ('', 'all', False, _("list files from all revisions"))] + + formatteropts, _('[-r REV]')) def manifest(ui, repo, node=None, rev=None, **opts): """output the current or given revision of the project manifest @@ -5502,7 +5509,7 @@ class httpservice(object): ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), ('', 'rev', [], _('show difference from revision'), _('REV')), ('', 'change', '', _('list the changed files of a revision'), _('REV')), - ] + walkopts + subrepoopts, + ] + walkopts + subrepoopts + formatteropts, _('[OPTION]... [FILE]...'), inferrepo=True) def status(ui, repo, *pats, **opts): @@ -5957,7 +5964,7 @@ def tag(ui, repo, name1, *names, **opts) finally: release(lock, wlock) -@command('tags', [], '') +@command('tags', formatteropts, '') def tags(ui, repo, **opts): """list repository tags diff --git a/tests/test-completion.t b/tests/test-completion.t --- a/tests/test-completion.t +++ b/tests/test-completion.t @@ -211,7 +211,7 @@ Show all commands + options push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure remove: after, force, include, exclude serve: accesslog, daemon, daemon-pipefds, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate - status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos + status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos, template summary: remote update: clean, check, date, rev, tool addremove: similarity, include, exclude, dry-run @@ -258,7 +258,7 @@ Show all commands + options debugsuccessorssets: debugwalk: include, exclude debugwireargs: three, four, five, ssh, remotecmd, insecure - files: rev, print0, include, exclude + files: rev, print0, include, exclude, template graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, include, exclude heads: rev, topo, active, closed, style, template @@ -267,7 +267,7 @@ Show all commands + options import: strip, base, edit, force, no-commit, bypass, partial, exact, import-branch, message, logfile, date, user, similarity incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos locate: rev, print0, fullpath, include, exclude - manifest: rev, all + manifest: rev, all, template outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos parents: rev, style, template paths: @@ -279,7 +279,7 @@ Show all commands + options rollback: dry-run, force root: tag: force, local, rev, remove, edit, message, date, user - tags: + tags: template tip: patch, git, style, template unbundle: update verify: diff --git a/tests/test-encoding.t b/tests/test-encoding.t --- a/tests/test-encoding.t +++ b/tests/test-encoding.t @@ -179,6 +179,24 @@ hg tags (utf-8) tip 5:a52c0692f24a \xc3\xa9 3:ca661e7520de (esc) +hg tags (JSON) + + $ hg tags -Tjson + [ + { + "id": "a52c0692f24a", + "rev": 5, + "tag": "tip", + "type": "" + }, + { + "id": "ca661e7520de", + "rev": 3, + "tag": "\xc3\xa9", (esc) + "type": "" + } + ] + hg branches (ascii) $ HGENCODING=ascii hg branches diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -165,6 +165,42 @@ hg status -A: C .hgignore C modified + $ hg status -A -Tjson + [ + { + "path": "added", + "status": "A" + }, + { + "copy": "modified", + "path": "copied", + "status": "A" + }, + { + "path": "removed", + "status": "R" + }, + { + "path": "deleted", + "status": "!" + }, + { + "path": "unknown", + "status": "?" + }, + { + "path": "ignored", + "status": "I" + }, + { + "path": ".hgignore", + "status": "C" + }, + { + "path": "modified", + "status": "C" + } + ] $ echo "^ignoreddir$" > .hgignore $ mkdir ignoreddir