hgext/hgk.py
changeset 21783 82bf4d89e068
parent 21250 8d354d58147c
child 22580 271a1ddad1fb
equal deleted inserted replaced
21782:404eca1ce4f9 21783:82bf4d89e068
    48     ('r', 'recursive', None, _('recursive')),
    48     ('r', 'recursive', None, _('recursive')),
    49     ('P', 'pretty', None, _('pretty')),
    49     ('P', 'pretty', None, _('pretty')),
    50     ('s', 'stdin', None, _('stdin')),
    50     ('s', 'stdin', None, _('stdin')),
    51     ('C', 'copy', None, _('detect copies')),
    51     ('C', 'copy', None, _('detect copies')),
    52     ('S', 'search', "", _('search'))],
    52     ('S', 'search', "", _('search'))],
    53     ('hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'))
    53     ('hg git-diff-tree [OPTION]... NODE1 NODE2 [FILE]...'),
       
    54     inferrepo=True)
    54 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
    55 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
    55     """diff trees from two commits"""
    56     """diff trees from two commits"""
    56     def __difftree(repo, node1, node2, files=[]):
    57     def __difftree(repo, node1, node2, files=[]):
    57         assert node2 is not None
    58         assert node2 is not None
    58         mmap = repo[node1].manifest()
    59         mmap = repo[node1].manifest()
   143     n = repo.changelog.ancestor(node1, node2)
   144     n = repo.changelog.ancestor(node1, node2)
   144     ui.write(short(n) + "\n")
   145     ui.write(short(n) + "\n")
   145 
   146 
   146 @command('debug-cat-file',
   147 @command('debug-cat-file',
   147     [('s', 'stdin', None, _('stdin'))],
   148     [('s', 'stdin', None, _('stdin'))],
   148     _('hg debug-cat-file [OPTION]... TYPE FILE'))
   149     _('hg debug-cat-file [OPTION]... TYPE FILE'),
       
   150     inferrepo=True)
   149 def catfile(ui, repo, type=None, r=None, **opts):
   151 def catfile(ui, repo, type=None, r=None, **opts):
   150     """cat a specific revision"""
   152     """cat a specific revision"""
   151     # in stdin mode, every line except the commit is prefixed with two
   153     # in stdin mode, every line except the commit is prefixed with two
   152     # spaces.  This way the our caller can find the commit without magic
   154     # spaces.  This way the our caller can find the commit without magic
   153     # strings
   155     # strings
   342     os.chdir(repo.root)
   344     os.chdir(repo.root)
   343     optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
   345     optstr = ' '.join(['--%s %s' % (k, v) for k, v in opts.iteritems() if v])
   344     cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
   346     cmd = ui.config("hgk", "path", "hgk") + " %s %s" % (optstr, " ".join(etc))
   345     ui.debug("running %s\n" % cmd)
   347     ui.debug("running %s\n" % cmd)
   346     util.system(cmd)
   348     util.system(cmd)
   347 
       
   348 commands.inferrepo += " debug-diff-tree debug-cat-file"