From: Frederic Massart Date: Thu, 13 Nov 2014 05:45:12 +0000 (+0800) Subject: Pull command tracks the right branch X-Git-Tag: v1.5.1~14 X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=c501183c4d46093dbb907f7addb3213f3af40b5b;p=mdk.git Pull command tracks the right branch --- 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))