# HG changeset patch # User Ian Moody # Date 1567863321 -3600 # Node ID e26c2440a030b2c5fc43de1a2feedee37d437557 # Parent a4ca0610c754a65262a81ee327af1e4bf6875331 phabricator: don't abort if property writing fails during amending Currently if one of the writediffproperty calls fails due to network issues during the amending of commit messages to include the Diff. Rev. line, the transaction is aborted and rolled back. This means that the associations between the commits and the DREVs are lost for any already amended commits because the removal of the local tags isn't covered by the rollback. Differential Revision: https://phab.mercurial-scm.org/D6835 diff -r a4ca0610c754 -r e26c2440a030 hgext/phabricator.py --- a/hgext/phabricator.py Mon Sep 09 17:32:21 2019 +0200 +++ b/hgext/phabricator.py Sat Sep 07 14:35:21 2019 +0100 @@ -659,7 +659,12 @@ mapping[old.node()] = [newnode] # Update diff property - writediffproperties(unfi[newnode], diffmap[old.node()]) + # If it fails just warn and keep going, otherwise the DREV + # associations will be lost + try: + writediffproperties(unfi[newnode], diffmap[old.node()]) + except util.urlerr.urlerror: + ui.warn(b'Failed to update metadata for D%s\n' % drevid) # Remove local tags since it's no longer necessary tagname = b'D%d' % drevid if tagname in repo.tags():