Skip to content

Commit

Permalink
casecollisionauditor: ignore eden_dirstate_map
Browse files Browse the repository at this point in the history
Summary:
The default casecollisionauditor reads all of dirstate._map by iterating through it. This is expensive for a large repo and eden now raises RuntimeError for the iterator method. Please check D3964461 (73f0e3d) for more info.

As Jun pointed out:

* For non-edenfs we would always use treestate, therefore the original `if not dirstate._istreestate and not dirstate._istreedirstate:` check always evaluate to `False`.
* For EdenFS, due to above reason, we should not go into the `then`-part of the if statement.

So we can just delete the `then`-part of the if statement:

```
if not dirstate._istreestate and not dirstate._istreedirstate:
    allfiles = "\0".join(dirstate._map)
    self._loweredfiles = set(encoding.lower(allfiles).split("\0"))
```

Reviewed By: quark-zju

Differential Revision: D42210487

fbshipit-source-id: 6c5d5daca9dd85deae6505344a4abad2cafb2831
  • Loading branch information
zzl0 authored and facebook-github-bot committed Dec 22, 2022
1 parent 01167e3 commit a6a66d0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions eden/scm/edenscm/scmutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,9 @@ class casecollisionauditor(object):
def __init__(self, ui, abort, dirstate):
self._ui = ui
self._abort = abort
if not dirstate._istreestate and not dirstate._istreedirstate:
allfiles = "\0".join(dirstate._map)
self._loweredfiles = set(encoding.lower(allfiles).split("\0"))
else:
# Still need an in-memory set to collect files being tested, but
# haven't been added to treestate yet.
self._loweredfiles = set()
# Still need an in-memory set to collect files being tested, but
# haven't been added to treestate yet.
self._loweredfiles = set()
self._dirstate = dirstate
# The purpose of _newfiles is so that we don't complain about
# case collisions if someone were to call this object with the
Expand Down

0 comments on commit a6a66d0

Please sign in to comment.