diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3392,9 +3392,10 @@ def log(ui, repo, *pats, **opts): displayer.close() @command('manifest', - [('r', 'rev', '', _('revision to display'), _('REV'))], + [('r', 'rev', '', _('revision to display'), _('REV')), + ('', 'all', False, _("list files from all revisions"))], _('[-r REV]')) -def manifest(ui, repo, node=None, rev=None): +def manifest(ui, repo, node=None, rev=None, **opts): """output the current or given revision of the project manifest Print a list of version controlled files for the given revision. @@ -3404,8 +3405,30 @@ def manifest(ui, repo, node=None, rev=No With -v, print file permissions, symlink and executable bits. With --debug, print file revision hashes. + If option --all is specified, the list of all files from all revisions + is printed. This includes deleted and renamed files. + Returns 0 on success. """ + if opts.get('all'): + if rev or node: + raise util.Abort(_("can't specify a revision with --all")) + + res = [] + prefix = "data/" + suffix = ".i" + plen = len(prefix) + slen = len(suffix) + lock = repo.lock() + try: + for fn, b, size in repo.store.datafiles(): + if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix: + res.append(fn[plen:-slen]) + finally: + lock.release() + for f in sorted(res): + ui.write("%s\n" % f) + return if rev and node: raise util.Abort(_("please specify just one revision")) diff --git a/tests/test-debugcomplete.t b/tests/test-debugcomplete.t --- a/tests/test-debugcomplete.t +++ b/tests/test-debugcomplete.t @@ -246,7 +246,7 @@ Show all commands + options import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, insecure, subrepos locate: rev, print0, fullpath, include, exclude - manifest: rev + manifest: rev, all outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, insecure, subrepos parents: rev, style, template paths: diff --git a/tests/test-manifest.t b/tests/test-manifest.t --- a/tests/test-manifest.t +++ b/tests/test-manifest.t @@ -53,6 +53,10 @@ The next call is expected to return noth b/a l + $ hg manifest --all + a + b/a + l The next two calls are expected to abort: