diff contrib/hgk.py @ 1278:6a0d373d3126

hgit -> hgk.py Move hgit to hgk.py - importing hgit as an extension created compiled hgitc, which was confusing - hgit existed to support hgk so it was slightly misnamed - removed executable bit as we no longer run it directly - add 'view' command so we can run hg view - change git-* commands to debug-* so hg help won't show them - chdir to repository root on view so hgk doesn't choke in subdirs
author mpm@selenic.com
date Mon, 19 Sep 2005 15:59:17 -0700
parents contrib/hgit@9d10f89b75a5
children 2073e5a71008
line wrap: on
line diff
old mode 100755
new mode 100644
copy from contrib/hgit
copy to contrib/hgk.py
--- a/contrib/hgit
+++ b/contrib/hgk.py
@@ -7,7 +7,7 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import time, sys, signal
+import time, sys, signal, os
 from mercurial import hg, mdiff, fancyopts, commands, ui, util
 
 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
@@ -313,22 +313,28 @@ def revlist(ui, repo, *revs, **opts):
     copy = [x for x in revs]
     revtree(copy, repo, full, opts['max_count'], opts['parents'])
 
+def view(ui, repo, *etc):
+    "start interactive history viewer"
+    os.chdir(repo.root)
+    os.system("hgk " + " ".join(etc))
+
 cmdtable = {
-    "git-diff-tree": (difftree, [('p', 'patch', None, 'generate patch'),
+    "view": (view, [], 'hg view'),
+    "debug-diff-tree": (difftree, [('p', 'patch', None, 'generate patch'),
                             ('r', 'recursive', None, 'recursive'),
                             ('P', 'pretty', None, 'pretty'),
                             ('s', 'stdin', None, 'stdin'),
                             ('C', 'copy', None, 'detect copies'),
                             ('S', 'search', "", 'search')],
                             "hg git-diff-tree [options] node1 node2"),
-    "git-cat-file": (catfile, [('s', 'stdin', None, 'stdin')],
-                 "hg cat-file [options] type file"),
-    "git-merge-base": (base, [], "hg git-merge-base node node"),
-    "git-rev-list": (revlist, [('H', 'header', None, 'header'),
+    "debug-cat-file": (catfile, [('s', 'stdin', None, 'stdin')],
+                 "hg debug-cat-file [options] type file"),
+    "debug-merge-base": (base, [], "hg debug-merge-base node node"),
+    "debug-rev-list": (revlist, [('H', 'header', None, 'header'),
                            ('t', 'topo-order', None, 'topo-order'),
                            ('p', 'parents', None, 'parents'),
                            ('n', 'max-count', 0, 'max-count')],
-                 "hg git-rev-list [options] revs"),
+                 "hg debug-rev-list [options] revs"),
 }
 
 def reposetup(ui, repo):