def __init__(self, name = None):
"""Takes a series name as the parameter.
"""
- if name:
- self.__name = name
- else:
- self.__name = git.get_head_file()
-
- if self.__name:
+ try:
+ if name:
+ self.__name = name
+ else:
+ self.__name = git.get_head_file()
base_dir = git.get_base_dir()
- self.__patch_dir = os.path.join(base_dir, 'patches',
- self.__name)
- self.__base_file = os.path.join(base_dir, 'refs', 'bases',
- self.__name)
- self.__applied_file = os.path.join(self.__patch_dir, 'applied')
- self.__unapplied_file = os.path.join(self.__patch_dir, 'unapplied')
- self.__current_file = os.path.join(self.__patch_dir, 'current')
- self.__descr_file = os.path.join(self.__patch_dir, 'description')
+ except git.GitException, ex:
+ raise StackException, 'GIT tree not initialised: %s' % ex
+
+ self.__patch_dir = os.path.join(base_dir, 'patches',
+ self.__name)
+ self.__base_file = os.path.join(base_dir, 'refs', 'bases',
+ self.__name)
+ self.__applied_file = os.path.join(self.__patch_dir, 'applied')
+ self.__unapplied_file = os.path.join(self.__patch_dir, 'unapplied')
+ self.__current_file = os.path.join(self.__patch_dir, 'current')
+ self.__descr_file = os.path.join(self.__patch_dir, 'description')
def get_branch(self):
"""Return the branch name for the Series object
if os.path.exists(self.__base_file):
os.remove(self.__base_file)
- def refresh_patch(self, message = None, edit = False, show_patch = False,
+ def refresh_patch(self, files = None, message = None, edit = False,
+ show_patch = False,
cache_update = True,
author_name = None, author_email = None,
author_date = None,
if not committer_email:
committer_email = patch.get_commemail()
- commit_id = git.commit(message = descr, parents = [patch.get_bottom()],
+ commit_id = git.commit(files = files,
+ message = descr, parents = [patch.get_bottom()],
cache_update = cache_update,
allowempty = True,
author_name = author_name,