Page MenuHomePhabricator

phrevset: fix code that was returning commit strings
ClosedPublic

Authored by simpkins on Sep 11 2017, 6:16 PM.

Details

Summary

Fix another code path in phrevset that could incorrectly return commit strings
instead of rev numbers.

Test Plan

Manually tweaked phrevset to force it to hit this code path (to ensure it would
not find the commit from the local log walk first), and confirmed it now
returned a rev ID instead of commit strings.

Diff Detail

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

Event Timeline

simpkins created this revision.Sep 11 2017, 6:16 PM
quark accepted this revision.Sep 11 2017, 7:03 PM
quark added inline comments.
hgext3rd/phrevset.py
96

It seems we can raise directly here to simplify the code. But that could be a separate diff.

243

Maybe use mercurial.encoding.unitolocal

249–250

I think it makes more sense to use filtered repo here. An obsoleted commit may or may not have successors and there could be a split. If there is a successor, the successor would be visible and would be searched.

252

rev is already encoded in line 243?

267

nit: results is already a set

This revision is now accepted and ready to land.Sep 11 2017, 7:03 PM
This revision was automatically updated to reflect the committed changes.