These are single line files that are displayed by "stg branch --list".
Signed-off-by: Chuck Lever <cel@netapp.com>
current = '>'
if stack.Series(branch_name).get_protected():
protected = 'p'
current = '>'
if stack.Series(branch_name).get_protected():
protected = 'p'
- print '%s %s%s\t%s' % (current, initialized, protected, branch_name)
+ print '%s %s%s\t%s\t%s' % (current, initialized, protected, branch_name, \
+ stack.Series(branch_name).get_description())
def delete_branch(doomed_name, force = False):
if stack.Series(doomed_name).get_protected():
def delete_branch(doomed_name, force = False):
if stack.Series(doomed_name).get_protected():
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.__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
def get_branch(self):
"""Return the branch name for the Series object
if os.path.isfile(protect_file):
os.remove(protect_file)
if os.path.isfile(protect_file):
os.remove(protect_file)
+ def get_description(self):
+ if os.path.isfile(self.__descr_file):
+ return read_string(self.__descr_file)
+ else:
+ return ''
+
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)
create_empty_file(self.__applied_file)
create_empty_file(self.__unapplied_file)
create_empty_file(self.__applied_file)
create_empty_file(self.__unapplied_file)
+ create_empty_file(self.__descr_file)
self.__begin_stack_check()
def delete(self, force = False):
self.__begin_stack_check()
def delete(self, force = False):
os.remove(self.__unapplied_file)
if os.path.isfile(self.__current_file):
os.remove(self.__current_file)
os.remove(self.__unapplied_file)
if os.path.isfile(self.__current_file):
os.remove(self.__current_file)
+ if os.path.isfile(self.__descr_file):
+ os.remove(self.__descr_file)
if not os.listdir(self.__patch_dir):
os.rmdir(self.__patch_dir)
else:
if not os.listdir(self.__patch_dir):
os.rmdir(self.__patch_dir)
else: