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

[StGIT PATCH 4/4] Rename branch.*.stgitformatversion to branch.*.stgit.stackformatversion.

From
Yann Dirson <ydirson@altern.org>
Date
Jun 11, 2007, 00:33 UTC
Message-ID
<20070611003341.4736.49364.stgit@gandelf.nowhere.earth>
In-Reply-To
<20070611003117.4736.33551.stgit@gandelf.nowhere.earth>

Nearly as discussed on the ml, with the name slightly modified to better allow other types of PatchSet. ---

 stgit/stack.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/stgit/stack.py b/stgit/stack.py
index 89b5a55..634588d 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -366,7 +366,7 @@ class Series(PatchSet):
         self.__trash_dir = os.path.join(self._dir(), 'trash')
 
     def format_version_key(self):
-        return 'branch.%s.stgitformatversion' % self.get_name()
+        return 'branch.%s.stgit.stackformatversion' % self.get_name()
 
     def update_to_current_format_version(self):
         """Update a potentially older StGIT directory structure to the
@@ -379,11 +379,17 @@ class Series(PatchSet):
             """Return the integer format version number, or None if the
             branch doesn't have any StGIT metadata at all, of any version."""
             fv = config.get(self.format_version_key())
+            ofv = config.get('branch.%s.stgitformatversion' % self.get_name())
             if fv:
                 # Great, there's an explicitly recorded format version
                 # number, which means that the branch is initialized and
                 # of that exact version.
                 return int(fv)
+            elif ofv:
+                # Old name for the version info, upgrade it
+                config.set(self.format_version_key(), ofv)
+                config.unset('branch.%s.stgitformatversion' % self.get_name())
+                return int(ofv)
             elif os.path.isdir(os.path.join(branch_dir, 'patches')):
                 # There's a .git/patches/<branch>/patches dirctory, which
                 # means this is an initialized version 1 branch.
@@ -713,7 +719,7 @@ class Series(PatchSet):
         config.unset('branch.%s.remote' % self.get_name())
         config.unset('branch.%s.merge' % self.get_name())
         config.unset('branch.%s.stgit.parentbranch' % self.get_name())
-        config.unset('branch.%s.stgitformatversion' % self.get_name())
+        config.unset(self.format_version_key())
 
     def refresh_patch(self, files = None, message = None, edit = False,
                       show_patch = False,
Previous: Yann Dirson
Message 14 of 14 in “Cleanups of the Series object.”
  1. 0/4 Cleanups of the Series object.Yann Dirson, Jun 11, 2007
  2. 1/4 Use get/set_name for a stack's name.Yann Dirson, Jun 11, 2007
  3. 2/4 Abstract a PatchSet object out of Series.Yann Dirson, Jun 11, 2007
  4. Catalin MarinasJun 12, 2007
  5. Yann DirsonJun 13, 2007
  6. Yann DirsonJun 14, 2007
  7. Catalin MarinasJun 19, 2007
  8. Catalin MarinasJun 19, 2007
  9. Yann DirsonJun 19, 2007
  10. Catalin MarinasJun 14, 2007
  11. Yann DirsonJun 15, 2007
  12. Catalin MarinasJun 19, 2007
  13. 3/4 Move stack format-version checks into Stack class.Yann Dirson, Jun 11, 2007
  14. 4/4 Rename branch.*.stgitformatversion to branch.*.stgit.stackformatversion.Yann Dirson, Jun 11, 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.