This is an archive of the discontinued Mercurial Phabricator instance.

cleanup: use mergestate.unresolvedcount() instead of bool(list(unresolved()))
ClosedPublic

Authored by durin42 on May 18 2020, 6:08 PM.

Details

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

durin42 created this revision.May 18 2020, 6:08 PM
durin42 updated this revision to Diff 21511.May 28 2020, 4:26 PM

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

I'd rather not: right now we have no extra type overhead, and if we make unresolved() return some custom iterator type it'll add extra bookkeeping etc.

If you feel strongly, I'd much rather someone that cares do that as a follow-up, since I'm just trying to do a quick-win case here.

durin42 updated this revision to Diff 21594.Jun 9 2020, 4:51 PM
marmoute accepted this revision.Jun 10 2020, 5:35 AM

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

I'd rather not: right now we have no extra type overhead, and if we make unresolved() return some custom iterator type it'll add extra bookkeeping etc.
If you feel strongly, I'd much rather someone that cares do that as a follow-up, since I'm just trying to do a quick-win case here.

nevermind, I got confused, the unresolvedcount method existed before your series, so this patch is clear win.

pulkit accepted this revision.Jun 17 2020, 9:25 AM
This revision is now accepted and ready to land.Jun 17 2020, 9:25 AM
durin42 planned changes to this revision.
durin42 updated this revision to Diff 23027.
durin42 updated this revision to Diff 25157.Jan 19 2021, 1:53 PM
This revision is now accepted and ready to land.Jan 19 2021, 1:53 PM
pulkit accepted this revision.Jan 21 2021, 6:19 AM