##// END OF EJS Templates
commit: select template by spec.ref name...
Yuya Nishihara -
r32878:a3a36bcf default
parent child Browse files
Show More
@@ -2915,11 +2915,10 b' def commitforceeditor(repo, ctx, subs, f'
2915 forms.insert(0, 'changeset')
2915 forms.insert(0, 'changeset')
2916 templatetext = None
2916 templatetext = None
2917 while forms:
2917 while forms:
2918 tmpl = repo.ui.config('committemplate', '.'.join(forms))
2918 ref = '.'.join(forms)
2919 if tmpl:
2919 if repo.ui.config('committemplate', ref):
2920 tmpl = templater.unquotestring(tmpl)
2921 templatetext = committext = buildcommittemplate(
2920 templatetext = committext = buildcommittemplate(
2922 repo, ctx, subs, extramsg, tmpl)
2921 repo, ctx, subs, extramsg, ref)
2923 break
2922 break
2924 forms.pop()
2923 forms.pop()
2925 else:
2924 else:
@@ -2957,14 +2956,12 b' def commitforceeditor(repo, ctx, subs, f'
2957
2956
2958 return text
2957 return text
2959
2958
2960 def buildcommittemplate(repo, ctx, subs, extramsg, tmpl):
2959 def buildcommittemplate(repo, ctx, subs, extramsg, ref):
2961 ui = repo.ui
2960 ui = repo.ui
2962 spec = logtemplatespec(tmpl, None)
2961 spec = formatter.templatespec(ref, None, None)
2963 t = changeset_templater(ui, repo, spec, None, {}, False)
2962 t = changeset_templater(ui, repo, spec, None, {}, False)
2964
2963 t.t.cache.update((k, templater.unquotestring(v))
2965 for k, v in repo.ui.configitems('committemplate'):
2964 for k, v in repo.ui.configitems('committemplate'))
2966 if k != 'changeset':
2967 t.t.cache[k] = v
2968
2965
2969 if not extramsg:
2966 if not extramsg:
2970 extramsg = '' # ensure that extramsg is string
2967 extramsg = '' # ensure that extramsg is string
General Comments 0
You need to be logged in to leave comments. Login now