##// END OF EJS Templates
phabricator: extract logic to print the status when posting a commit...
Matt Harbison -
r45138:949a8714 default
parent child Browse files
Show More
@@ -1168,6 +1168,26 b' def userphids(ui, names):'
1168 return [entry[b'phid'] for entry in data]
1168 return [entry[b'phid'] for entry in data]
1169
1169
1170
1170
1171 def _print_phabsend_action(ui, ctx, newrevid, action):
1172 """print the ``action`` that occurred when posting ``ctx`` for review
1173
1174 This is a utility function for the sending phase of ``phabsend``, which
1175 makes it easier to show a status for all local commits with `--fold``.
1176 """
1177 actiondesc = ui.label(
1178 {
1179 b'created': _(b'created'),
1180 b'skipped': _(b'skipped'),
1181 b'updated': _(b'updated'),
1182 }[action],
1183 b'phabricator.action.%s' % action,
1184 )
1185 drevdesc = ui.label(b'D%d' % newrevid, b'phabricator.drev')
1186 nodedesc = ui.label(bytes(ctx), b'phabricator.node')
1187 desc = ui.label(ctx.description().split(b'\n')[0], b'phabricator.desc')
1188 ui.write(_(b'%s - %s - %s: %s\n') % (drevdesc, actiondesc, nodedesc, desc))
1189
1190
1171 def _amend_diff_properties(unfi, drevid, newnodes, diff):
1191 def _amend_diff_properties(unfi, drevid, newnodes, diff):
1172 """update the local commit list for the ``diff`` associated with ``drevid``
1192 """update the local commit list for the ``diff`` associated with ``drevid``
1173
1193
@@ -1317,23 +1337,11 b' def phabsend(ui, repo, *revs, **opts):'
1317 newrevid = revid
1337 newrevid = revid
1318 action = b'skipped'
1338 action = b'skipped'
1319
1339
1320 actiondesc = ui.label(
1321 {
1322 b'created': _(b'created'),
1323 b'skipped': _(b'skipped'),
1324 b'updated': _(b'updated'),
1325 }[action],
1326 b'phabricator.action.%s' % action,
1327 )
1328 drevdesc = ui.label(b'D%d' % newrevid, b'phabricator.drev')
1329 nodedesc = ui.label(bytes(ctx), b'phabricator.node')
1330 desc = ui.label(ctx.description().split(b'\n')[0], b'phabricator.desc')
1331 ui.write(
1332 _(b'%s - %s - %s: %s\n') % (drevdesc, actiondesc, nodedesc, desc)
1333 )
1334 drevids.append(newrevid)
1340 drevids.append(newrevid)
1335 lastrevphid = newrevphid
1341 lastrevphid = newrevphid
1336
1342
1343 _print_phabsend_action(ui, ctx, newrevid, action)
1344
1337 # Update commit messages and remove tags
1345 # Update commit messages and remove tags
1338 if opts.get(b'amend'):
1346 if opts.get(b'amend'):
1339 unfi = repo.unfiltered()
1347 unfi = repo.unfiltered()
General Comments 0
You need to be logged in to leave comments. Login now