Merge lp:~james-page/juju-deployer/git-cwd into lp:juju-deployer

Proposed by James Page on 2015-07-21
Status: Merged
Merged at revision: 148
Proposed branch: lp:~james-page/juju-deployer/git-cwd
Merge into: lp:juju-deployer
Diff against target: 27 lines (+5/-1)
2 files modified
deployer/charm.py (+1/-0)
deployer/vcs.py (+4/-1)
To merge this branch: bzr merge lp:~james-page/juju-deployer/git-cwd
Reviewer Review Type Date Requested Status
Tim Van Steenburgh 2015-07-21 Approve on 2015-07-21
Review via email: mp+265365@code.launchpad.net

Description of the Change

Improve git support

1) ensure the cwd is set correctly when clone repositories (inline with bzr)

2) git.launchpad.net as a recognised git repository location

To post a comment you must log in.
Tim Van Steenburgh (tvansteenburgh) wrote :

LGTM, thanks James.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'deployer/charm.py'
2--- deployer/charm.py 2014-09-30 19:26:26 +0000
3+++ deployer/charm.py 2015-07-21 08:05:37 +0000
4@@ -33,6 +33,7 @@
5 if not self.branch:
6 return None
7 if self.branch.startswith('git') or 'github.com' in self.branch or \
8+ 'git.launchpad.net' in self.branch or \
9 os.path.exists(os.path.join(self.branch, '.git')):
10 return Git(self.path, self.branch, self.log)
11 elif self.branch.startswith("bzr") or self.branch.startswith('lp:') \
12
13=== modified file 'deployer/vcs.py'
14--- deployer/vcs.py 2014-09-29 14:36:34 +0000
15+++ deployer/vcs.py 2015-07-21 08:05:37 +0000
16@@ -100,7 +100,10 @@
17
18 def branch(self):
19 params = ["git", "clone", "--depth", "1", self.origin, self.path]
20- self._call(params, self.err_branch, os.path.dirname(self.path))
21+ cwd = os.path.dirname(os.path.dirname(self.path))
22+ if not cwd:
23+ cwd = "."
24+ self._call(params, self.err_branch, cwd)
25
26 def is_modified(self):
27 params = ["git", "status", "-s"]

Subscribers

People subscribed via source and target branches