# HG changeset patch # User Steve Losh # Date 1245449553 14400 # Node ID e1ea36d1bf0fbfc73c971bdcaca3a7cb4a8407d4 # Parent 1e14e266ef4183ebeec6d246f542c057116bdb55 Add some very bare functionality. 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