##// END OF EJS Templates
phabricator: extract the logic to amend diff properties to a function...
Matt Harbison -
r45137:99fa161a default
parent child Browse files
Show More
@@ -1168,6 +1168,20 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 _amend_diff_properties(unfi, drevid, newnodes, diff):
1172 """update the local commit list for the ``diff`` associated with ``drevid``
1173
1174 This is a utility function for the amend phase of ``phabsend``, which
1175 converts failures to warning messages.
1176 """
1177 try:
1178 writediffproperties([unfi[newnode] for newnode in newnodes], diff)
1179 except util.urlerr.urlerror:
1180 # If it fails just warn and keep going, otherwise the DREV
1181 # associations will be lost
1182 unfi.ui.warnnoi18n(b'Failed to update metadata for D%d\n' % drevid)
1183
1184
1171 @vcrcommand(
1185 @vcrcommand(
1172 b'phabsend',
1186 b'phabsend',
1173 [
1187 [
@@ -1357,17 +1371,10 b' def phabsend(ui, repo, *revs, **opts):'
1357 newnode = new.commit()
1371 newnode = new.commit()
1358
1372
1359 mapping[old.node()] = [newnode]
1373 mapping[old.node()] = [newnode]
1360 # Update diff property
1374
1361 # If it fails just warn and keep going, otherwise the DREV
1375 _amend_diff_properties(
1362 # associations will be lost
1376 unfi, drevid, [newnode], diffmap[old.node()]
1363 try:
1377 )
1364 writediffproperties(
1365 [unfi[newnode]], diffmap[old.node()]
1366 )
1367 except util.urlerr.urlerror:
1368 ui.warnnoi18n(
1369 b'Failed to update metadata for D%d\n' % drevid
1370 )
1371 # Remove local tags since it's no longer necessary
1378 # Remove local tags since it's no longer necessary
1372 tagname = b'D%d' % drevid
1379 tagname = b'D%d' % drevid
1373 if tagname in repo.tags():
1380 if tagname in repo.tags():
General Comments 0
You need to be logged in to leave comments. Login now