diff options
author | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-09-04 09:10:36 +0100 |
---|---|---|
committer | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-09-07 13:57:29 +0100 |
commit | 853e0af71f1bf2b0793ebbc3b7dfd7a44ceae8a3 (patch) | |
tree | 9a7b9c8b8832099ecad139a26d4c722a484e01e9 /buildstream/storage | |
parent | 50bf313951ae459a02b045167aedd507f0f8b47e (diff) | |
download | buildstream-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.py | 9 |
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: |