summaryrefslogtreecommitdiff
path: root/buildstream/storage
diff options
context:
space:
mode:
authorMartin Blanchard <martin.blanchard@codethink.co.uk>2018-09-04 09:10:36 +0100
committerMartin Blanchard <martin.blanchard@codethink.co.uk>2018-09-07 13:57:29 +0100
commit853e0af71f1bf2b0793ebbc3b7dfd7a44ceae8a3 (patch)
tree9a7b9c8b8832099ecad139a26d4c722a484e01e9 /buildstream/storage
parent50bf313951ae459a02b045167aedd507f0f8b47e (diff)
downloadbuildstream-853e0af71f1bf2b0793ebbc3b7dfd7a44ceae8a3.tar.gz
_casbaseddirectory.py: Add a method for hash recalculation
https://gitlab.com/BuildStream/buildstream/issues/454
Diffstat (limited to 'buildstream/storage')
-rw-r--r--buildstream/storage/_casbaseddirectory.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 5ca100793..d580635c1 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -543,6 +543,15 @@ class CasBasedDirectory(Directory):
filelist.append(k)
return filelist
+ def recalculate_hash(self):
+ """ Recalcuates the hash for this directory and store the results in
+ the cache. If this directory has a parent, tell it to
+ recalculate (since changing this directory changes an entry in
+ the parent). Hashes for subdirectories also get recalculated.
+ """
+ self._recalculate_recursing_up()
+ self._recalculate_recursing_down()
+
def _get_identifier(self):
path = ""
if self.parent: