--- 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 <file>::
- 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.
--- 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 <changeset>"),
"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] <patches>"),
"init": (init, [], 'hg init'),
- "log": (log, [], 'hg log <file>'),
+ "log|history": (log, [], 'hg log [file]'),
"manifest": (manifest, [], 'hg manifest [rev]'),
"parents": (parents, [], 'hg parents [node]'),
"pull": (pull,