diff options
author | 2018-06-08 14:22:15 -0700 | |
---|---|---|
committer | 2018-06-08 14:23:57 -0700 | |
commit | a41c46e7982e3b8599c8e8fd2f66d552333c31ca (patch) | |
tree | 4927f785862e033f2bcb87e04b4cf8f4e5cc5bf7 /src/main/java/com/google/devtools/build/lib | |
parent | f92107b43c108c6f7043f003ec31bb14c158d8ca (diff) |
Support file renaming in ActionFS.
PiperOrigin-RevId: 199850381
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/ActionFileSystem.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionFileSystem.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionFileSystem.java index 5abb9c8966..fb4ead3947 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionFileSystem.java @@ -465,7 +465,13 @@ final class ActionFileSystem extends FileSystem implements MetadataProvider, Inj @Override public void renameTo(Path sourcePath, Path targetPath) throws IOException { - throw new UnsupportedOperationException("renameTo(" + sourcePath + ", " + targetPath + ")"); + PathFragment sourceExecPath = asExecPath(sourcePath); + OutputMetadata sourceMetadata = outputs.getIfPresent(sourceExecPath); + if (sourceMetadata == null) { + throw new IOException("No output file at " + sourcePath + " to move to " + targetPath); + } + outputs.put(asExecPath(targetPath), sourceMetadata); + outputs.invalidate(sourceExecPath); } @Override |