def __patch_is_current(self, patch):
return patch.get_name() == read_string(self.__current_file)
def __patch_is_current(self, patch):
return patch.get_name() == read_string(self.__current_file)
def patch_exists(self, name):
"""Return true if there is a patch with the given name, false
otherwise."""
def patch_exists(self, name):
"""Return true if there is a patch with the given name, false
otherwise."""
if os.path.exists(self.__applied_file):
os.remove(self.__applied_file)
if os.path.exists(self.__unapplied_file):
if os.path.exists(self.__applied_file):
os.remove(self.__applied_file)
if os.path.exists(self.__unapplied_file):
raise StackException, 'Patch "%s" already exists' % name
if not message and can_edit:
raise StackException, 'Patch "%s" already exists' % name
if not message and can_edit:
raise StackException, 'Cannot remove an applied patch, "%s", ' \
'which is not current' % name
elif not name in self.get_unapplied():
raise StackException, 'Unknown patch "%s"' % name
raise StackException, 'Cannot remove an applied patch, "%s", ' \
'which is not current' % name
elif not name in self.get_unapplied():
raise StackException, 'Unknown patch "%s"' % name