From 254d99f846f3427d21bc9224cd693bb4806d2d31 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Wed, 31 Jan 2007 23:15:38 +0000 Subject: [PATCH] Move identification of parent branch's remote def up into stack class. Also adds the __set_parent_remote() counterpart method, but only private since it is expected to be called only through set_parent, to be introduced in subsequent patch. Signed-off-by: Yann Dirson --- stgit/commands/pull.py | 2 +- stgit/stack.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stgit/commands/pull.py b/stgit/commands/pull.py index e47858a..0608fb6 100644 --- a/stgit/commands/pull.py +++ b/stgit/commands/pull.py @@ -53,7 +53,7 @@ def func(parser, options, args): if len(args) >= 1: repository = args[0] else: - repository = config.get('branch.%s.remote' % git.get_head_file()) or 'origin' + repository = crt_series.get_parent_remote() refspec = None if len(args) == 2: diff --git a/stgit/stack.py b/stgit/stack.py index 6281f36..947b416 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -407,6 +407,12 @@ class Series(StgitObject): def set_description(self, line): self._set_field('description', line) + def get_parent_remote(self): + return config.get('branch.%s.remote' % self.__name) or 'origin' + + def __set_parent_remote(self, remote): + value = config.set('branch.%s.remote' % self.__name, remote) + def __patch_is_current(self, patch): return patch.get_name() == self.get_current() -- 2.11.0