comparison hgext/phabricator.py @ 45426:1a5d3e555c70

phabricator: update the hashes in commit messages as they get submitted Due to the sequence of actions (posting, amending the local commit, and then updating the Differential properties), the message in the commit is updated on the initial send but the message displayed in Phabricator is not. It should get updated there if the review is reposted. The data in the Commits tab is accurate for the first `phabsend`. Differential Revision: https://phab.mercurial-scm.org/D8950
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 24 Aug 2020 18:51:25 -0400
parents b1f2659c1c34
children b71858b42963
comparison
equal deleted inserted replaced
45425:f7e293e0475f 45426:1a5d3e555c70
74 obsutil, 74 obsutil,
75 parser, 75 parser,
76 patch, 76 patch,
77 phases, 77 phases,
78 pycompat, 78 pycompat,
79 rewriteutil,
79 scmutil, 80 scmutil,
80 smartset, 81 smartset,
81 tags, 82 tags,
82 templatefilters, 83 templatefilters,
83 templateutil, 84 templateutil,
1509 continue 1510 continue
1510 parents = [ 1511 parents = [
1511 mapping.get(old.p1().node(), (old.p1(),))[0], 1512 mapping.get(old.p1().node(), (old.p1(),))[0],
1512 mapping.get(old.p2().node(), (old.p2(),))[0], 1513 mapping.get(old.p2().node(), (old.p2(),))[0],
1513 ] 1514 ]
1515 newdesc = rewriteutil.update_hash_refs(
1516 repo, newdesc, mapping,
1517 )
1514 new = context.metadataonlyctx( 1518 new = context.metadataonlyctx(
1515 repo, 1519 repo,
1516 old, 1520 old,
1517 parents=parents, 1521 parents=parents,
1518 text=newdesc, 1522 text=newdesc,
1586 ] 1590 ]
1587 new = context.metadataonlyctx( 1591 new = context.metadataonlyctx(
1588 repo, 1592 repo,
1589 old, 1593 old,
1590 parents=parents, 1594 parents=parents,
1591 text=old.description(), 1595 text=rewriteutil.update_hash_refs(
1596 repo, old.description(), mapping
1597 ),
1592 user=old.user(), 1598 user=old.user(),
1593 date=old.date(), 1599 date=old.date(),
1594 extra=old.extra(), 1600 extra=old.extra(),
1595 ) 1601 )
1596 1602