( )⚙ D36 phabricator: verify local tags before trusting them

This is an archive of the discontinued Mercurial Phabricator instance.

phabricator: verify local tags before trusting them
ClosedPublic

Authored by quark on Jul 11 2017, 11:56 AM.

Details

Summary

Previously we trust local tags blindly and that could cause wrong
Differential Revision to be updated, when people switch between Phabricator
instances.

This patch adds verification logic to detect such issue and remove
problematic tags. For example, a tag "D19" was on node "X", the code will
fetch all diffs attached to D19, and check if nodes server-side overlaps
with nodes in precursors. If they do not overlap, create a new Differential
Revision.

Test Plan

Use a test Phabricator instance, send patches using hg phabsend, then
change the local tag manually to a wrong Differential Revision number.
Amend the patch and send again. Make sure the tag gets ignored and deleted.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Jul 11 2017, 11:56 AM
durin42 accepted this revision.Jul 14 2017, 12:00 PM
This revision is now accepted and ready to land.Jul 14 2017, 12:00 PM
This revision was automatically updated to reflect the committed changes.