git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/5] Move stack-base querying into Series class.

From
Yann Dirson <ydirson@altern.org>
Date
Feb 20, 2007, 00:14 UTC
Message-ID
<20070220001408.31139.3657.stgit@gandelf.nowhere.earth>
In-Reply-To
<20070220000908.31139.36841.stgit@gandelf.nowhere.earth>
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 stgit/commands/common.py |    2 +-
 stgit/stack.py           |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/stgit/commands/common.py b/stgit/commands/common.py
index a352d89..240d003 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)
Previous: Yann DirsonNext: Yann Dirson
Message 3 of 7 in “stgit rebasing fixes”
  1. 0/5 stgit rebasing fixesYann Dirson, Feb 20, 2007
  2. 1/5 Factorize rebasing behaviour.Yann Dirson, Feb 20, 2007
  3. 2/5 Move stack-base querying into Series class.Yann Dirson, Feb 20, 2007
  4. 3/5 Various cleanups for clarity.Yann Dirson, Feb 20, 2007
  5. 4/5 Keep track of safe base changes.Yann Dirson, Feb 20, 2007
  6. 5/5 Refuse to pull/rebase when rendered unsafe by (un)commits.Yann Dirson, Feb 20, 2007
  7. stgit "push --merged" woesYann Dirson, Feb 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.