summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fba895f)
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from stgit.utils import *
from stgit import git, basedir, templates
from stgit.utils import *
from stgit import git, basedir, templates
if self.is_initialised() and not os.path.isdir(self.__trash_dir):
os.makedirs(self.__trash_dir)
if self.is_initialised() and not os.path.isdir(self.__trash_dir):
os.makedirs(self.__trash_dir)
+ def __patch_name_valid(self, name):
+ """Raise an exception if the patch name is not valid.
+ """
+ if not name or re.search('[^\w.-]', name):
+ raise StackException, 'Invalid patch name: "%s"' % name
+
def get_branch(self):
"""Return the branch name for the Series object
"""
def get_branch(self):
"""Return the branch name for the Series object
"""
before_existing = False, refresh = True):
"""Creates a new patch
"""
before_existing = False, refresh = True):
"""Creates a new patch
"""
+ self.__patch_name_valid(name)
+
if self.patch_applied(name) or self.patch_unapplied(name):
raise StackException, 'Patch "%s" already exists' % name
if self.patch_applied(name) or self.patch_unapplied(name):
raise StackException, 'Patch "%s" already exists' % name
def delete_patch(self, name):
"""Deletes a patch
"""
def delete_patch(self, name):
"""Deletes a patch
"""
+ self.__patch_name_valid(name)
patch = Patch(name, self.__patch_dir, self.__refs_dir)
if self.__patch_is_current(patch):
patch = Patch(name, self.__patch_dir, self.__refs_dir)
if self.__patch_is_current(patch):
def empty_patch(self, name):
"""Returns True if the patch is empty
"""
def empty_patch(self, name):
"""Returns True if the patch is empty
"""
+ self.__patch_name_valid(name)
patch = Patch(name, self.__patch_dir, self.__refs_dir)
bottom = patch.get_bottom()
top = patch.get_top()
patch = Patch(name, self.__patch_dir, self.__refs_dir)
bottom = patch.get_bottom()
top = patch.get_top()
return False
def rename_patch(self, oldname, newname):
return False
def rename_patch(self, oldname, newname):
+ self.__patch_name_valid(newname)
+
applied = self.get_applied()
unapplied = self.get_unapplied()
applied = self.get_applied()
unapplied = self.get_unapplied()