Rename branch section in config when the branch is renamed
PATCH 1/4 Rename branch section in config when the branch is renamed
Signed-off-by Pavel Roskin <[email protected]>
---
stgit/config.py | 3 +++ stgit/stack.py | 4 ++++ 2 files changed, 7 insertions(+), 0 deletions(-)
stgit/config.py +3 -0
@@ -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])
stgit/stack.py +4 -0
@@ -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):
PATCH 2/4 Copy remote and merge settings when cloning a branch
Signed-off-by Pavel Roskin <[email protected]>
---
stgit/stack.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
stgit/stack.py +9 -0
@@ -632,6 +632,15 @@ class Series(StgitObject): # fast forward the cloned series to self's top new_series.forward_patches(applied) + # Clone remote and merge settings + value = config.get('branch.%s.remote' % self.__name) + if value: + config.set('branch.%s.remote' % target_series, value) + + value = config.get('branch.%s.merge' % self.__name) + if value: + config.set('branch.%s.merge' % target_series, value) + def delete(self, force = False): """Deletes an stgit series """
PATCH 3/4 Don't print "rebasing" if the head doesn't change
In reply to Pavel RoskinSigned-off-by Pavel Roskin <[email protected]>
---
stgit/commands/pull.py | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
stgit/commands/pull.py +4 -2
@@ -73,8 +73,10 @@ def func(parser, options, args): print 'Pulling from "%s"...' % repository git.fetch(repository) if (config.get('stgit.pull-does-rebase') == 'yes'): - print 'rebasing to "%s"...' % git.fetch_head() - git.reset(tree_id = git.fetch_head()) + tree_id = git.fetch_head() + if tree_id != git.get_head(): + print 'rebasing to "%s"...' % tree_id + git.reset(tree_id) print 'done' # push the patches back
PATCH 4/4 Assorted typos
In reply to Pavel RoskinSigned-off-by Pavel Roskin <[email protected]>
---
debian/copyright | 2 +- stgit/commands/branch.py | 2 +- stgit/stack.py | 4 ++-- t/t1301-assimilate.sh | 2 +- t/test-lib.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
debian/copyright +1 -1
@@ -1,6 +1,6 @@ This package was downloaded from http://www.procode.org/stgit/ -Copyright Holder: Cataling Marinas <[email protected]> +Copyright Holder: Catalin Marinas <[email protected]> and various contributors License:
stgit/commands/branch.py +1 -1
@@ -126,7 +126,7 @@ def func(parser, options, args): if len(args) >= 2: try: if git.rev_parse(args[1]) == git.rev_parse('refs/heads/' + args[1]): - # we are for sure refering to a branch + # we are for sure referring to a branch parentbranch = 'refs/heads/' + args[1] print 'Recording "%s" as parent branch.' % parentbranch elif git.rev_parse(args[1]) and re.search('/', args[1]):
stgit/stack.py +2 -2
@@ -658,7 +658,7 @@ class Series(StgitObject): os.rmdir(self.__trash_dir) # FIXME: find a way to get rid of those manual removals - # (move functionnality to StgitObject ?) + # (move functionality to StgitObject ?) if os.path.exists(self.__applied_file): os.remove(self.__applied_file) if os.path.exists(self.__unapplied_file):
@@ -1044,7 +1044,7 @@ class Series(StgitObject): else: # we store the correctly merged files only for # tracking the conflict history. Note that the - # git.merge() operations shouls always leave the index + # git.merge() operations should always leave the index # in a valid state (i.e. only stage 0 files) self.refresh_patch(cache_update = False, log = 'push(c)') raise StackException, str(ex)
t/t1301-assimilate.sh +1 -1
@@ -65,7 +65,7 @@ test_expect_success \ ' test_expect_success \ - 'Create a mege commit' \ + 'Create a merge commit' \ ' git checkout -b br master^^ && echo woof > woof.txt &&
t/test-lib.sh +1 -1
@@ -164,7 +164,7 @@ test_create_repo () { mv .git/hooks .git/hooks-disabled echo "empty start" | git-commit-tree `git-write-tree` >.git/refs/heads/master 2>&4 || - error "cannot run git-commit -- is your git-core funtionning?" + error "cannot run git-commit -- is your git-core functioning?" cd "$owd" }