equal
deleted
inserted
replaced
1206 ) |
1206 ) |
1207 mapping = {b'ctx': ctx} |
1207 mapping = {b'ctx': ctx} |
1208 if props: |
1208 if props: |
1209 mapping.update(props) |
1209 mapping.update(props) |
1210 return t.renderdefault(mapping) |
1210 return t.renderdefault(mapping) |
|
1211 |
|
1212 |
|
1213 def format_changeset_summary(ui, ctx, command=None, default_spec=None): |
|
1214 """Format a changeset summary (one line).""" |
|
1215 spec = None |
|
1216 if command: |
|
1217 spec = ui.config( |
|
1218 b'command-templates', b'oneline-summary.%s' % command, None |
|
1219 ) |
|
1220 if not spec: |
|
1221 spec = ui.config(b'command-templates', b'oneline-summary') |
|
1222 if not spec: |
|
1223 spec = default_spec |
|
1224 if not spec: |
|
1225 # TODO: Pick a default we can agree on. This isn't used yet. |
|
1226 raise error.ProgrammingError(b"no default one-line summary defined yet") |
|
1227 text = rendertemplate(ctx, spec) |
|
1228 return text.split(b'\n')[0] |
1211 |
1229 |
1212 |
1230 |
1213 def _buildfntemplate(pat, total=None, seqno=None, revwidth=None, pathname=None): |
1231 def _buildfntemplate(pat, total=None, seqno=None, revwidth=None, pathname=None): |
1214 r"""Convert old-style filename format string to template string |
1232 r"""Convert old-style filename format string to template string |
1215 |
1233 |