From: Yann Dirson Date: Tue, 20 Feb 2007 00:14:08 +0000 (+0100) Subject: Move stack-base querying into Series class. X-Git-Tag: v0.12.1~5 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/ba66e579c03a92dd8a3bc27ceb951fd2dc40723e?ds=sidebyside Move stack-base querying into Series class. Signed-off-by: Yann Dirson --- diff --git a/stgit/commands/common.py b/stgit/commands/common.py index aa0409a..c2c99e2 100644 --- a/stgit/commands/common.py +++ b/stgit/commands/common.py @@ -101,7 +101,7 @@ def git_id(rev): elif patch_id == 'log': return series.get_patch(patch).get_log() if patch == 'base' and patch_id == None: - return read_string(series.get_base_file()) + return series.get_base() except RevParseException: pass return git.rev_parse(rev + '^{commit}') diff --git a/stgit/stack.py b/stgit/stack.py index 3632aa1..dc6caa6 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -394,6 +394,9 @@ class Series(StgitObject): self.__begin_stack_check() return self.__base_file + def get_base(self): + return read_string(self.get_base_file()) + def get_protected(self): return os.path.isfile(os.path.join(self._dir(), 'protected')) @@ -609,7 +612,7 @@ class Series(StgitObject): """ try: # allow cloning of branches not under StGIT control - base = read_string(self.get_base_file()) + base = self.get_base() except: base = git.get_head() Series(target_series).init(create_at = base)