Fixed RepositoryTool patching of files in uncreated directories
Review Request #10247 — Created Oct. 19, 2018 and submitted — Latest diff uploaded
When a RepositoryTool is applying the review's patches to the cloned
repository, it simply writes usingopen(p, 'wb')
. This does not create
directories that the patch implies.This leads to the write failing with:
IOError: [Errno 2] No such file or directory: u'dir/file'
This patch creates directories for each file if the path does not exist
already.
Replciated the error by posting a review for a file in a new directory,
applied patch, and RepositoryTool successfully runs on patched files.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 5. See what's changed.
orig
1
2
3
4
5
bot/reviewbot/tools/__init__.py |
---|
bot/reviewbot/utils/filesystem.py |
---|