X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/7b1ba1a6f8c89f551377b3b3791bfee7b01d3350..0b4b9499a53813957d23adaa0e97e1cc3a3a6900:/stgit/stack.py diff --git a/stgit/stack.py b/stgit/stack.py index 6efee79..554ae8b 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -314,6 +314,19 @@ class Series: def get_base_file(self): return self.__base_file + def get_protected(self): + return os.path.isfile(os.path.join(self.__patch_dir, 'protected')) + + def protect(self): + protect_file = os.path.join(self.__patch_dir, 'protected') + if not os.path.isfile(protect_file): + create_empty_file(protect_file) + + def unprotect(self): + protect_file = os.path.join(self.__patch_dir, 'protected') + if os.path.isfile(protect_file): + os.remove(protect_file) + def __patch_is_current(self, patch): return patch.get_name() == read_string(self.__current_file)