Mercurial > hg
diff hgext/phabricator.py @ 45772:294aab57a5f3
phabsend: use default one-line summary
This means that the `phabricator.node` and `phabricator.desc` color
configs will no longer be respected, but `log.changeset` and
`log.desc` will be respected instead.
Differential Revision: https://phab.mercurial-scm.org/D9254
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 27 Oct 2020 10:22:36 -0700 |
parents | c7fe0dfb5312 |
children | 89a2afe31e82 |
line wrap: on
line diff
--- a/hgext/phabricator.py Tue Oct 27 15:33:15 2020 -0700 +++ b/hgext/phabricator.py Tue Oct 27 10:22:36 2020 -0700 @@ -141,9 +141,7 @@ b'phabricator.action.created': b'green', b'phabricator.action.skipped': b'magenta', b'phabricator.action.updated': b'magenta', - b'phabricator.desc': b'', b'phabricator.drev': b'bold', - b'phabricator.node': b'', b'phabricator.status.abandoned': b'magenta dim', b'phabricator.status.accepted': b'green bold', b'phabricator.status.closed': b'green', @@ -1220,9 +1218,8 @@ b'phabricator.action.%s' % action, ) drevdesc = ui.label(b'D%d' % newrevid, b'phabricator.drev') - nodedesc = ui.label(bytes(ctx), b'phabricator.node') - desc = ui.label(ctx.description().split(b'\n')[0], b'phabricator.desc') - ui.write(_(b'%s - %s - %s: %s\n') % (drevdesc, actiondesc, nodedesc, desc)) + summary = cmdutil.format_changeset_summary(ui, ctx, b'phabsend') + ui.write(_(b'%s - %s - %s\n') % (drevdesc, actiondesc, summary)) def _amend_diff_properties(unfi, drevid, newnodes, diff): @@ -1642,7 +1639,6 @@ ui = repo.ui for rev in revs: ctx = repo[rev] - desc = ctx.description().splitlines()[0] oldnode, olddiff, drevid = oldmap.get(ctx.node(), (None, None, None)) if drevid: drevdesc = ui.label(b'D%d' % drevid, b'phabricator.drev') @@ -1650,11 +1646,10 @@ drevdesc = ui.label(_(b'NEW'), b'phabricator.drev') ui.write( - _(b'%s - %s: %s\n') + _(b'%s - %s\n') % ( drevdesc, - ui.label(bytes(ctx), b'phabricator.node'), - ui.label(desc, b'phabricator.desc'), + cmdutil.format_changeset_summary(ui, ctx, b'phabsend'), ) )