{"thread":{"id":"6658","subject":"[PATCH 1/4] Rename branch section in config when the branch is renamed","startedAt":"2007-02-04T05:32:21Z","lastAt":"2007-02-04T05:32:37Z","messageCount":4,"participants":["Pavel Roskin"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"33530","messageId":"20070204053221.15035.88015.stgit@dv.roinet.com","threadId":"6658","inReplyTo":null,"subject":"[PATCH 1/4] Rename branch section in config when the branch is renamed","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-04T05:32:21Z","receivedAt":"2007-02-04T05:32:21Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Signed-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/config.py |    3 +++\n stgit/stack.py  |    4 ++++\n 2 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/stgit/config.py b/stgit/config.py\nindex 48b4e2d..fb38932 100644\n--- a/stgit/config.py\n+++ b/stgit/config.py\n@@ -96,6 +96,9 @@ class GitConfig:\n         else:\n             raise GitConfigException, 'Value for \"%s\" is not an integer: \"%s\"' % (name, value)\n \n+    def rename_section(self, from_name, to_name):\n+        self.__run('git-repo-config --rename-section', [from_name, to_name])\n+\n     def set(self, name, value):\n         self.__run('git-repo-config', [name, value])\n \ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex 96863c6..c3bf3c6 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -590,6 +590,10 @@ class Series(StgitObject):\n             rename(os.path.join(self.__base_dir, 'refs', 'patches'),\n                    self.__name, to_stack.__name)\n \n+        # Rename the config section\n+        config.rename_section(\"branch.%s\" % self.__name,\n+                              \"branch.%s\" % to_name)\n+\n         self.__init__(to_name)\n \n     def clone(self, target_series):\n"},{"id":"33531","messageId":"20070204053226.15035.40105.stgit@dv.roinet.com","threadId":"6658","inReplyTo":"20070204053221.15035.88015.stgit@dv.roinet.com","subject":"[PATCH 2/4] Copy remote and merge settings when cloning a branch","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-04T05:32:26Z","receivedAt":"2007-02-04T05:32:26Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Signed-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/stack.py |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex c3bf3c6..2e01f52 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -632,6 +632,15 @@ class Series(StgitObject):\n         # fast forward the cloned series to self's top\n         new_series.forward_patches(applied)\n \n+        # Clone remote and merge settings\n+        value = config.get('branch.%s.remote' % self.__name)\n+        if value:\n+            config.set('branch.%s.remote' % target_series, value)\n+\n+        value = config.get('branch.%s.merge' % self.__name)\n+        if value:\n+            config.set('branch.%s.merge' % target_series, value)\n+\n     def delete(self, force = False):\n         \"\"\"Deletes an stgit series\n         \"\"\"\n"},{"id":"33532","messageId":"20070204053231.15035.4631.stgit@dv.roinet.com","threadId":"6658","inReplyTo":"20070204053221.15035.88015.stgit@dv.roinet.com","subject":"[PATCH 3/4] Don't print \"rebasing\" if the head doesn't change","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-04T05:32:31Z","receivedAt":"2007-02-04T05:32:31Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Signed-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n stgit/commands/pull.py |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/stgit/commands/pull.py b/stgit/commands/pull.py\nindex b63ef7a..0aee6bf 100644\n--- a/stgit/commands/pull.py\n+++ b/stgit/commands/pull.py\n@@ -73,8 +73,10 @@ def func(parser, options, args):\n     print 'Pulling from \"%s\"...' % repository\n     git.fetch(repository)\n     if (config.get('stgit.pull-does-rebase') == 'yes'):\n-        print 'rebasing to \"%s\"...' % git.fetch_head()\n-        git.reset(tree_id = git.fetch_head())\n+        tree_id = git.fetch_head()\n+        if tree_id != git.get_head():\n+            print 'rebasing to \"%s\"...' % tree_id\n+            git.reset(tree_id)\n     print 'done'\n \n     # push the patches back\n"},{"id":"33533","messageId":"20070204053236.15035.75366.stgit@dv.roinet.com","threadId":"6658","inReplyTo":"20070204053221.15035.88015.stgit@dv.roinet.com","subject":"[PATCH 4/4] Assorted typos","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2007-02-04T05:32:37Z","receivedAt":"2007-02-04T05:32:37Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Signed-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n debian/copyright         |    2 +-\n stgit/commands/branch.py |    2 +-\n stgit/stack.py           |    4 ++--\n t/t1301-assimilate.sh    |    2 +-\n t/test-lib.sh            |    2 +-\n 5 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/debian/copyright b/debian/copyright\nindex 345789d..15d8679 100644\n--- a/debian/copyright\n+++ b/debian/copyright\n@@ -1,6 +1,6 @@\n This package was downloaded from http://www.procode.org/stgit/\n \n-Copyright Holder: Cataling Marinas <catalin.marinas@gmail.com>\n+Copyright Holder: Catalin Marinas <catalin.marinas@gmail.com>\n                   and various contributors\n \n License:\ndiff --git a/stgit/commands/branch.py b/stgit/commands/branch.py\nindex f074d47..d7ddedb 100644\n--- a/stgit/commands/branch.py\n+++ b/stgit/commands/branch.py\n@@ -126,7 +126,7 @@ def func(parser, options, args):\n         if len(args) >= 2:\n             try:\n                 if git.rev_parse(args[1]) == git.rev_parse('refs/heads/' + args[1]):\n-                    # we are for sure refering to a branch\n+                    # we are for sure referring to a branch\n                     parentbranch = 'refs/heads/' + args[1]\n                     print 'Recording \"%s\" as parent branch.' % parentbranch\n                 elif git.rev_parse(args[1]) and re.search('/', args[1]):\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex 2e01f52..7f3b65d 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -658,7 +658,7 @@ class Series(StgitObject):\n             os.rmdir(self.__trash_dir)\n \n             # FIXME: find a way to get rid of those manual removals\n-            # (move functionnality to StgitObject ?)\n+            # (move functionality to StgitObject ?)\n             if os.path.exists(self.__applied_file):\n                 os.remove(self.__applied_file)\n             if os.path.exists(self.__unapplied_file):\n@@ -1044,7 +1044,7 @@ class Series(StgitObject):\n             else:\n                 # we store the correctly merged files only for\n                 # tracking the conflict history. Note that the\n-                # git.merge() operations shouls always leave the index\n+                # git.merge() operations should always leave the index\n                 # in a valid state (i.e. only stage 0 files)\n                 self.refresh_patch(cache_update = False, log = 'push(c)')\n                 raise StackException, str(ex)\ndiff --git a/t/t1301-assimilate.sh b/t/t1301-assimilate.sh\nindex 26b263c..906f5bb 100755\n--- a/t/t1301-assimilate.sh\n+++ b/t/t1301-assimilate.sh\n@@ -65,7 +65,7 @@ test_expect_success \\\n     '\n \n test_expect_success \\\n-    'Create a mege commit' \\\n+    'Create a merge commit' \\\n     '\n     git checkout -b br master^^ &&\n     echo woof > woof.txt &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex b44a590..3274b84 100755\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -164,7 +164,7 @@ test_create_repo () {\n \tmv .git/hooks .git/hooks-disabled\n \techo \"empty start\" |\n \tgit-commit-tree `git-write-tree` >.git/refs/heads/master 2>&4 ||\n-\terror \"cannot run git-commit -- is your git-core funtionning?\"\n+\terror \"cannot run git-commit -- is your git-core functioning?\"\n \tcd \"$owd\"\n }\n \n"}]}