e1ea36d1bf0f

Add some very bare functionality.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 19 Jun 2009 18:12:33 -0400
parents 1e14e266ef41
children 048db3b4a2a4
branches/tags (none)
files prompt.py

Changes

diff -r 1e14e266ef41 -r e1ea36d1bf0f prompt.py
--- a/prompt.py	Fri Jun 19 17:50:13 2009 -0400
+++ b/prompt.py	Fri Jun 19 18:12:33 2009 -0400
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+'''prompt
+
+Take a format string, parse any template variables inside, and output
+the result.  Useful for putting information about the current repository into
+a bash prompt.
+'''
+
+from mercurial import hg
+
+def prompt(ui, repo, fs):
+    """Take a format string, parse any variables, and output the result."""
+    ui.write(fs)
+
+cmdtable = {
+    # "command-name": (function-call, options-list, help-string)
+    "prompt": (prompt, [],
+    #                 [('s', 'short', None, 'print short form'),
+     #                 ('l', 'long', None, 'print long form')],
+                     "hg prompt 'FORMATSTRING'")
+}
\ No newline at end of file