If I try an "stg series" command on a repository that hasn't yet been
initialized, I get a non-intuitive error message:
stg series: [Errno 2] No such file or directory:
'/home/cel/src/git/main/.git/patches/master/applied'
This patch replaces the message with a reasonable explanation.
Signed-off-by: Chuck Lever <cel@netapp.com>
"""Class including the operations on series
"""
def __init__(self, name = None):
"""Class including the operations on series
"""
def __init__(self, name = None):
- """Takes a series name as the parameter. A valid .git/patches/name
- directory should exist
+ """Takes a series name as the parameter.
"""
if name:
self.__name = name
"""
if name:
self.__name = name
return name
def get_applied(self):
return name
def get_applied(self):
+ if not os.path.isfile(self.__applied_file):
+ raise StackException, \
+ 'No StGIT metadata found. Try "stg init" first'
f = file(self.__applied_file)
names = [line.strip() for line in f.readlines()]
f.close()
return names
def get_unapplied(self):
f = file(self.__applied_file)
names = [line.strip() for line in f.readlines()]
f.close()
return names
def get_unapplied(self):
+ if not os.path.isfile(self.__unapplied_file):
+ raise StackException, \
+ 'No StGIT metadata found. Try "stg init" first'
f = file(self.__unapplied_file)
names = [line.strip() for line in f.readlines()]
f.close()
f = file(self.__unapplied_file)
names = [line.strip() for line in f.readlines()]
f.close()