From c501183c4d46093dbb907f7addb3213f3af40b5b Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 13 Nov 2014 13:45:12 +0800 Subject: [PATCH] Pull command tracks the right branch --- mdk/commands/pull.py | 2 +- mdk/fetch.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mdk/commands/pull.py b/mdk/commands/pull.py index 2656ce1..fe83469 100644 --- a/mdk/commands/pull.py +++ b/mdk/commands/pull.py @@ -158,7 +158,7 @@ class PullCommand(Command): newBranch = M.generateBranchName(issue, suffix=suffix, version=branch) if not M.git().hasBranch(newBranch): break - fetcher.pull(into=newBranch) + fetcher.pull(into=newBranch, track=M.get('stablebranch')) def pickPatches(self, mdl): """Prompts the user to pick a patch""" diff --git a/mdk/fetch.py b/mdk/fetch.py index d9640e2..d7f7bfc 100644 --- a/mdk/fetch.py +++ b/mdk/fetch.py @@ -68,7 +68,7 @@ class Fetch(object): if not self.M.git().merge('FETCH_HEAD'): raise FetchException('Merge failed, resolve the conflicts and commit') - def pull(self, into=None): + def pull(self, into=None, track=None): """Fetch and merge the fetched branch into a branch passed as param""" self._stash() @@ -81,7 +81,7 @@ class Fetch(object): if not git.hasBranch(into): if self.canCreateBranch: - if not git.createBranch(into): + if not git.createBranch(into, track=track): raise FetchException('Could not create the branch %s' % (into)) else: raise FetchException('Branch %s does not exist and create branch is forbidden' % (into)) -- 2.11.0