046811b7cb2d

Use format string from HGRC if available

This allows repository specific prompts (e.g. no status in large repos
or no incoming/outgoing on repos where the remote communication is too
slow).
[view raw] [browse files]
author Oben Sonne <obensonne@googlemail.com>
date Thu, 27 Feb 2014 14:22:43 +0100
parents 1cb3af183d2f
children 2e292ca8d768
branches/tags (none)
files prompt.py

Changes

--- a/prompt.py	Mon Feb 10 14:14:04 2014 +0100
+++ b/prompt.py	Thu Feb 27 14:22:43 2014 +0100
@@ -362,7 +362,6 @@
 
         return _with_groups(m.groups(), '^') if current_rev != repo[tip] else ''
 
-
     if opts.get("angle_brackets"):
         tag_start = r'\<([^><]*?\<)?'
         tag_end = r'(\>[^><]*?)?>'
@@ -427,6 +426,10 @@
     if opts.get("cache_outgoing"):
         _cache_remote(repo, 'outgoing')
 
+    hgrc_fs = repo.ui.config("prompt", "template")
+    if hgrc_fs is not None:
+        fs = hgrc_fs
+
     for tag, repl in patterns.items():
         fs = re.sub(tag_start + tag + tag_end, repl, fs)
     ui.status(fs)