# HG changeset patch # User mpm@selenic.com # Date 1119955701 28800 # Node ID 98a2935c3d6c71b5b5478876b6bba3aa7b28372a # Parent 42a660abaf754c91b70d2e40e955c0193c4cff93 [PATCH] replace history with log -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] replace history with log From: Radoslaw Szkodzinski Merge hg history into hg log leaving the first as an alias (tweaked by mpm: update docs, tests, use existing alias mechanism) manifest hash: f85001a4373b8b823a6221ba5c506628059d6779 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCwSr1ywK+sNU5EO8RAmbAAJ9HlFkf8/qLOAQUtj8CWxGRPEyzVgCgtXwP SdnAg1a2q4693+TBiOjrimY= =w9rf -----END PGP SIGNATURE----- diff -r 42a660abaf75 -r 98a2935c3d6c doc/hg.1.txt --- a/doc/hg.1.txt Tue Jun 28 02:38:33 2005 -0800 +++ b/doc/hg.1.txt Tue Jun 28 02:48:21 2005 -0800 @@ -146,16 +146,6 @@ changesets. They are where development generally takes place and are the usual targets for update and merge operations. -history:: - Print a log of the revision history of the repository. - - By default this command outputs: changeset id and hash, tags, - parents, user, date and time, and a summary for each commit. The - -v switch adds some more detail, such as changed files, manifest - hashes or message signatures. - - To display the history of a given file, see the log command. - identify:: Print a short summary of the current state of the repo. @@ -178,11 +168,15 @@ init:: Initialize a new repository in the current directory. -log :: - Print the revision history of the specified file. +log [file]:: + Print the revision history of the specified file or the entire project. - To display the revision history for the whole repository, use the history - command. + By default this command outputs: changeset id and hash, tags, + parents, user, date and time, and a summary for each commit. The + -v switch adds some more detail, such as changed files, manifest + hashes or message signatures. + + aliases: history manifest [revision]:: Print a list of version controlled files for the given revision. diff -r 42a660abaf75 -r 98a2935c3d6c mercurial/commands.py --- a/mercurial/commands.py Tue Jun 28 02:38:33 2005 -0800 +++ b/mercurial/commands.py Tue Jun 28 02:48:21 2005 -0800 @@ -434,11 +434,6 @@ for n in repo.changelog.heads(): show_changeset(ui, repo, changenode=n) -def history(ui, repo): - """show the changelog history""" - for i in range(repo.changelog.count() - 1, -1, -1): - show_changeset(ui, repo, rev=i) - def identify(ui, repo): """print information about the working copy""" parents = [p for p in repo.dirstate.parents() if p != hg.nullid] @@ -511,13 +506,16 @@ sys.exit(1) repo = hg.repository(ui, ".", create=1) -def log(ui, repo, f): - """show the revision history of a single file""" - f = relpath(repo, [f])[0] - - r = repo.file(f) - for i in range(r.count() - 1, -1, -1): - show_changeset(ui, repo, filelog=r, rev=i) +def log(ui, repo, f = None): + """show the revision history of the repository or a single file""" + if f: + f = relpath(repo, [f])[0] + r = repo.file(f) + for i in range(r.count() - 1, -1, -1): + show_changeset(ui, repo, filelog=r, rev=i) + else: + for i in range(repo.changelog.count() - 1, -1, -1): + show_changeset(ui, repo, rev=i) def manifest(ui, repo, rev = []): """output the latest or given revision of the project manifest""" @@ -745,7 +743,6 @@ "export": (export, [], "hg export "), "forget": (forget, [], "hg forget [files]"), "heads": (heads, [], 'hg heads'), - "history": (history, [], 'hg history'), "help": (help, [], 'hg help [command]'), "identify|id": (identify, [], 'hg identify'), "import|patch": (import_, @@ -753,7 +750,7 @@ ('b', 'base', "", 'base path')], "hg import [options] "), "init": (init, [], 'hg init'), - "log": (log, [], 'hg log '), + "log|history": (log, [], 'hg log [file]'), "manifest": (manifest, [], 'hg manifest [rev]'), "parents": (parents, [], 'hg parents [node]'), "pull": (pull, diff -r 42a660abaf75 -r 98a2935c3d6c tests/test-help.out --- a/tests/test-help.out Tue Jun 28 02:38:33 2005 -0800 +++ b/tests/test-help.out Tue Jun 28 02:48:21 2005 -0800 @@ -13,11 +13,10 @@ forget don't add the specified files on the next commit heads show current repository heads help show help for a given command or all commands - history show the changelog history identify print information about the working copy import import an ordered set of patches init create a new repository in the current directory - log show the revision history of a single file + log show the revision history of the repository or a single file manifest output the latest or given revision of the project manifest parents show the parents of the current working dir pull pull changes from the specified source @@ -65,11 +64,10 @@ forget don't add the specified files on the next commit heads show current repository heads help show help for a given command or all commands - history show the changelog history identify print information about the working copy import import an ordered set of patches init create a new repository in the current directory - log show the revision history of a single file + log show the revision history of the repository or a single file manifest output the latest or given revision of the project manifest parents show the parents of the current working dir pull pull changes from the specified source