comparison treepkg/git.py @ 562:e188e780977b

Use local-master as default local branch name if no branch is set in the config If a branch is set use branch name also as local branch name
author Bjoern Ricks <bricks@intevation.de>
date Fri, 02 Sep 2011 09:47:42 +0000
parents 1f7746e2288e
children bf8114a76224
comparison
equal deleted inserted replaced
561:1f7746e2288e 562:e188e780977b
34 34
35 branch -- The name of the remote Branch to track 35 branch -- The name of the remote Branch to track
36 defaults to master 36 defaults to master
37 """ 37 """
38 self.url = url 38 self.url = url
39 self.local_branch = "local"
40 self.branch = branch
41 if not branch: 39 if not branch:
40 # as default track master as local-master
41 self.local_branch = "local-master"
42 self.branch = "master" 42 self.branch = "master"
43 else:
44 self.local_branch = branch
45 self.branch = branch
43 if ":" in self.branch: 46 if ":" in self.branch:
44 branches = self.branch.split(":") 47 branches = self.branch.split(":")
45 self.local_branch = branches[0] 48 self.local_branch = branches[0]
46 self.branch = branches[1] 49 self.branch = branches[1]
47 # use master as default
48 50
49 def checkout(self, localdir): 51 def checkout(self, localdir):
50 """Clones the repository at url into the localdir""" 52 """Clones the repository at url into the localdir"""
51 run.call(cmdexpand("git clone -q $url $localdir", **locals())) 53 run.call(cmdexpand("git clone -q $url $localdir", **locals()))
52 if branch: 54 if branch:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)