046811b7cb2d — Oben Sonne 6 years ago
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).
1 files changed, 4 insertions(+), 1 deletions(-)

M prompt.py
M prompt.py +4 -1
@@ 362,7 362,6 @@ def prompt(ui, repo, fs='', **opts):
 
         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 @@ def prompt(ui, repo, fs='', **opts):
     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)