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.
indygreg |
hg-reviewers |
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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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.
Path | Packages | |||
---|---|---|---|---|
M | hgext/largefiles/overrides.py (2 lines) | |||
M | mercurial/merge.py (56 lines) |
repo, p1, p2, pas, branchmerge, force, acceptremote, *args, **kwargs | repo, p1, p2, pas, branchmerge, force, acceptremote, *args, **kwargs | ||||
) | ) | ||||
if overwrite: | if overwrite: | ||||
return mresult | return mresult | ||||
# Convert to dictionary with filename as key and action as value. | # Convert to dictionary with filename as key and action as value. | ||||
lfiles = set() | lfiles = set() | ||||
for f in mresult.actions: | for f in mresult.files(): | ||||
splitstandin = lfutil.splitstandin(f) | splitstandin = lfutil.splitstandin(f) | ||||
if splitstandin is not None and splitstandin in p1: | if splitstandin is not None and splitstandin in p1: | ||||
lfiles.add(splitstandin) | lfiles.add(splitstandin) | ||||
elif lfutil.standin(f) in p1: | elif lfutil.standin(f) in p1: | ||||
lfiles.add(f) | lfiles.add(f) | ||||
for lfile in sorted(lfiles): | for lfile in sorted(lfiles): | ||||
standin = lfutil.standin(lfile) | standin = lfutil.standin(lfile) |
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.