432 def heads(ui, repo): |
432 def heads(ui, repo): |
433 """show current repository heads""" |
433 """show current repository heads""" |
434 for n in repo.changelog.heads(): |
434 for n in repo.changelog.heads(): |
435 show_changeset(ui, repo, changenode=n) |
435 show_changeset(ui, repo, changenode=n) |
436 |
436 |
437 def history(ui, repo): |
|
438 """show the changelog history""" |
|
439 for i in range(repo.changelog.count() - 1, -1, -1): |
|
440 show_changeset(ui, repo, rev=i) |
|
441 |
|
442 def identify(ui, repo): |
437 def identify(ui, repo): |
443 """print information about the working copy""" |
438 """print information about the working copy""" |
444 parents = [p for p in repo.dirstate.parents() if p != hg.nullid] |
439 parents = [p for p in repo.dirstate.parents() if p != hg.nullid] |
445 if not parents: |
440 if not parents: |
446 ui.write("unknown\n") |
441 ui.write("unknown\n") |
509 if source: |
504 if source: |
510 ui.warn("no longer supported: use \"hg clone\" instead\n") |
505 ui.warn("no longer supported: use \"hg clone\" instead\n") |
511 sys.exit(1) |
506 sys.exit(1) |
512 repo = hg.repository(ui, ".", create=1) |
507 repo = hg.repository(ui, ".", create=1) |
513 |
508 |
514 def log(ui, repo, f): |
509 def log(ui, repo, f = None): |
515 """show the revision history of a single file""" |
510 """show the revision history of the repository or a single file""" |
516 f = relpath(repo, [f])[0] |
511 if f: |
517 |
512 f = relpath(repo, [f])[0] |
518 r = repo.file(f) |
513 r = repo.file(f) |
519 for i in range(r.count() - 1, -1, -1): |
514 for i in range(r.count() - 1, -1, -1): |
520 show_changeset(ui, repo, filelog=r, rev=i) |
515 show_changeset(ui, repo, filelog=r, rev=i) |
|
516 else: |
|
517 for i in range(repo.changelog.count() - 1, -1, -1): |
|
518 show_changeset(ui, repo, rev=i) |
521 |
519 |
522 def manifest(ui, repo, rev = []): |
520 def manifest(ui, repo, rev = []): |
523 """output the latest or given revision of the project manifest""" |
521 """output the latest or given revision of the project manifest""" |
524 n = repo.manifest.tip() |
522 n = repo.manifest.tip() |
525 if rev: |
523 if rev: |
743 "diff": (diff, [('r', 'rev', [], 'revision')], |
741 "diff": (diff, [('r', 'rev', [], 'revision')], |
744 'hg diff [-r A] [-r B] [files]'), |
742 'hg diff [-r A] [-r B] [files]'), |
745 "export": (export, [], "hg export <changeset>"), |
743 "export": (export, [], "hg export <changeset>"), |
746 "forget": (forget, [], "hg forget [files]"), |
744 "forget": (forget, [], "hg forget [files]"), |
747 "heads": (heads, [], 'hg heads'), |
745 "heads": (heads, [], 'hg heads'), |
748 "history": (history, [], 'hg history'), |
|
749 "help": (help, [], 'hg help [command]'), |
746 "help": (help, [], 'hg help [command]'), |
750 "identify|id": (identify, [], 'hg identify'), |
747 "identify|id": (identify, [], 'hg identify'), |
751 "import|patch": (import_, |
748 "import|patch": (import_, |
752 [('p', 'strip', 1, 'path strip'), |
749 [('p', 'strip', 1, 'path strip'), |
753 ('b', 'base', "", 'base path')], |
750 ('b', 'base', "", 'base path')], |
754 "hg import [options] <patches>"), |
751 "hg import [options] <patches>"), |
755 "init": (init, [], 'hg init'), |
752 "init": (init, [], 'hg init'), |
756 "log": (log, [], 'hg log <file>'), |
753 "log|history": (log, [], 'hg log [file]'), |
757 "manifest": (manifest, [], 'hg manifest [rev]'), |
754 "manifest": (manifest, [], 'hg manifest [rev]'), |
758 "parents": (parents, [], 'hg parents [node]'), |
755 "parents": (parents, [], 'hg parents [node]'), |
759 "pull": (pull, |
756 "pull": (pull, |
760 [('u', 'update', None, 'update working directory')], |
757 [('u', 'update', None, 'update working directory')], |
761 'hg pull [options] [source]'), |
758 'hg pull [options] [source]'), |