From cb5be4c30ece4dcca3c2ead63cbba834f00001cc Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 4 Feb 2007 00:32:21 -0500 Subject: [PATCH] Rename branch section in config when the branch is renamed Signed-off-by: Pavel Roskin --- stgit/config.py | 3 +++ stgit/stack.py | 4 ++++ 2 files changed, 7 insertions(+) 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 6f0f67a..a657d27 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): -- 2.11.0