ca659a3b3b97

Merged in sietsebb/hg-prompt (pull request #13)

Also hide ^ marker when on a non-tip head
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 29 Sep 2016 23:32:36 +0000
parents e90cf5cad060 (diff) 34c0e34e7fe7 (current diff)
children 54262d42ff7c
branches/tags (none)
files prompt.py

Changes

--- a/prompt.py	Tue Mar 22 10:49:32 2016 +0100
+++ b/prompt.py	Thu Sep 29 23:32:36 2016 +0000
@@ -18,6 +18,9 @@
 from mercurial import extensions, commands, cmdutil, help
 from mercurial.node import hex, short
 
+cmdtable = {}
+command = cmdutil.command(cmdtable)
+
 # `revrange' has been moved into module `scmutil' since v1.9.
 try :
     from mercurial import scmutil
@@ -72,6 +75,11 @@
     else:
         return None
 
+@command('prompt',
+         [('', 'angle-brackets', None, 'use angle brackets (<>) for keywords'),
+          ('', 'cache-incoming', None, 'used internally by hg-prompt'),
+          ('', 'cache-outgoing', None, 'used internally by hg-prompt')],
+         'hg prompt STRING')
 def prompt(ui, repo, fs='', **opts):
     '''get repository information for use in a shell prompt
 
@@ -457,15 +465,6 @@
     except KeyError:
         pass
 
-cmdtable = {
-    "prompt":
-    (prompt, [
-        ('', 'angle-brackets', None, 'use angle brackets (<>) for keywords'),
-        ('', 'cache-incoming', None, 'used internally by hg-prompt'),
-        ('', 'cache-outgoing', None, 'used internally by hg-prompt'),
-    ],
-    'hg prompt STRING')
-}
 help.helptable += (
     (['prompt-keywords', 'prompt-keywords'], ('Keywords supported by hg-prompt'),
      (r'''hg-prompt currently supports a number of keywords.