diff mercurial/commands.py @ 509:98a2935c3d6c

[PATCH] replace history with log -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] replace history with log From: Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> 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-----
author mpm@selenic.com
date Tue, 28 Jun 2005 02:48:21 -0800
parents 42a660abaf75
children 78896f572a22
line wrap: on
line diff
--- 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,