mercurial/cmdutil.py
changeset 22012 9d92b9d1e282
parent 22011 97acb4504704
child 22013 de5cee8ba088
--- a/mercurial/cmdutil.py	Sat Aug 02 21:46:27 2014 +0900
+++ b/mercurial/cmdutil.py	Sat Aug 02 21:46:27 2014 +0900
@@ -2193,9 +2193,15 @@
                       editform=''):
     if not extramsg:
         extramsg = _("Leave message empty to abort commit.")
-    tmpl = repo.ui.config('committemplate', 'changeset', '').strip()
-    if tmpl:
-        committext = buildcommittemplate(repo, ctx, subs, extramsg, tmpl)
+
+    forms = [e for e in editform.split('.') if e]
+    forms.insert(0, 'changeset')
+    while forms:
+        tmpl = repo.ui.config('committemplate', '.'.join(forms))
+        if tmpl:
+            committext = buildcommittemplate(repo, ctx, subs, extramsg, tmpl)
+            break
+        forms.pop()
     else:
         committext = buildcommittext(repo, ctx, subs, extramsg)