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

[PATCH 1/4] Rename branch section in config when the branch is renamed

From
PRPavel Roskin <proski@gnu.org>
Date
Feb 4, 2007, 05:32 UTC
Message-ID
<20070204053221.15035.88015.stgit@dv.roinet.com>
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 stgit/config.py |    3 +++
 stgit/stack.py  |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/stgit/config.py b/stgit/config.py
index 48b4e2d..fb38932 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -96,6 +96,9 @@ class GitConfig:
         else:
             raise GitConfigException, 'Value for "%s" is not an integer: "%s"' % (name, value)
 
+    def rename_section(self, from_name, to_name):
+        self.__run('git-repo-config --rename-section', [from_name, to_name])
+
     def set(self, name, value):
         self.__run('git-repo-config', [name, value])
 
diff --git a/stgit/stack.py b/stgit/stack.py
index 96863c6..c3bf3c6 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -590,6 +590,10 @@ class Series(StgitObject):
             rename(os.path.join(self.__base_dir, 'refs', 'patches'),
                    self.__name, to_stack.__name)
 
+        # Rename the config section
+        config.rename_section("branch.%s" % self.__name,
+                              "branch.%s" % to_name)
+
         self.__init__(to_name)
 
     def clone(self, target_series):
Next: Pavel Roskin
Message 1 of 4 in “Rename branch section in config when the branch is renamed”
  1. 1/4 Rename branch section in config when the branch is renamedPavel Roskin, Feb 4, 2007
  2. 2/4 Copy remote and merge settings when cloning a branchPavel Roskin, Feb 4, 2007
  3. 3/4 Don't print "rebasing" if the head doesn't changePavel Roskin, Feb 4, 2007
  4. 4/4 Assorted typosPavel Roskin, Feb 4, 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.