--- 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