During batchget, if a target file conflicts with a directory, or if the
directory a target file is in conflicts with a file, backup and remove the
conflicting file or directory before performing the get.
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
It seems like this one should have an externally-testable result. Could you adda test that shows the new behavior working better than it did before? If there a bug on bugzilla open that this solves?
This doesn't actually become a problem until D781. For now backup can only be true if f conflicts with a real file. If it has a path conflict then we fail earlier. In D781 I will add the possibility to detect path conflicts and mark them for backup, at which point we need this function to work for path conflicts as well as normal file conflicts.
mercurial/merge.py | ||
---|---|---|
1178 | This seems quite a bit slower. But I guess it never will happen in tight loops? If we have to backup a lot of files, then we have lost anyway? |
mercurial/merge.py | ||
---|---|---|
1178 | It will happen in batchget, which is for each file that is being created in the update. The new loop is O(path-length), which should be small. We should also only be touching things the OS needed to look at anyway to answer the original question, and which we looked at when we audited the path earlier on. |
lgtm
mercurial/merge.py | ||
---|---|---|
1178 |
I think that's essentially the case. The other option here is to always rename conflcting files/directories, but then you end up with unbounded growth in the size of backup files (either in working copy or in some other dir), so that's not really awesome either. |
This seems quite a bit slower. But I guess it never will happen in tight loops? If we have to backup a lot of files, then we have lost anyway?