This is an archive of the discontinued Mercurial Phabricator instance.

mergeresult: add `files()` and use it
ClosedPublic

Authored by pulkit on Aug 5 2020, 8:11 AM.

Details

Summary

files() will return a list of files on which an action needs to be performed.

This is a step to stop exposing the underlying map to the user of this object.

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

pulkit created this revision.Aug 5 2020, 8:11 AM
pulkit updated this revision to Diff 22308.Aug 6 2020, 7:16 AM
indygreg accepted this revision.Aug 8 2020, 12:33 PM
indygreg added a subscriber: indygreg.
indygreg added inline comments.
mercurial/merge.py
1327

A generator is passed in here. I suspect this is fine. But just wanted to call it out since most other consumers of files() consume the generator immediately.

This revision is now accepted and ready to land.Aug 8 2020, 12:33 PM

FWIW I encountered the following test failure when running this series locally:

--- /home/gps/src/hg-committed/tests/test-remotefilelog-prefetch.t
+++ /home/gps/src/hg-committed/tests/test-remotefilelog-prefetch.t.err
@@ -241,7 +241,6 @@
   ? files fetched over 1 fetches - (? misses, 0.00% hit ratio) over * (glob)
   abort: z2@109c3a557a73: not found in manifest! (?)
   $ find $CACHEDIR -type f | sort
-  $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
   $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
   $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
   $TESTTMP/hgcache/repos

But the failure wasn't reproducible when running the test in isolation. It might be a race condition somewhere. Possibly due to prefetch() now taking a generator after this patch.

This revision was automatically updated to reflect the committed changes.