Merge lp:~brunogirin/charms/precise/python-django/repos-branch into lp:~charmers/charms/precise/python-django/trunk

Proposed by Bruno Girin
Status: Merged
Approved by: Brandon Holtsclaw
Approved revision: 25
Merged at revision: 24
Proposed branch: lp:~brunogirin/charms/precise/python-django/repos-branch
Merge into: lp:~charmers/charms/precise/python-django/trunk
Prerequisite: lp:~brunogirin/charms/precise/python-django/application-path
Diff against target: 43 lines (+14/-1)
2 files modified
config.yaml (+8/-0)
hooks/install (+6/-1)
To merge this branch: bzr merge lp:~brunogirin/charms/precise/python-django/repos-branch
Reviewer Review Type Date Requested Status
Brandon Holtsclaw (community) Approve
Review via email: mp+145406@code.launchpad.net

Description of the change

Added support for a repos_branch option to support cloning a given branch out of the repository. The option currently supports git. It should get ignored for bzr and svn as both specify the branch in the URL. I did not implement anything for Mercurial as I don't use it at all and have no idea how it handles branches.

To post a comment you must log in.
Revision history for this message
Brandon Holtsclaw (imbrandon) wrote :

Looks good to me, merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2013-01-29 15:37:24 +0000
3+++ config.yaml 2013-01-29 15:37:24 +0000
4@@ -8,6 +8,14 @@
5 type: string
6 default: ""
7 description: The vcs url to checkout.
8+ repos_branch:
9+ type: string
10+ default: ""
11+ description: |
12+ The repo branch to pull out from. If empty, it will pull out the
13+ default branch or trunk (such as origin/master with git).
14+ Note that this setting is ignored for bzr and svn as the branch is
15+ specified in the URL for both of them.
16 repos_username:
17 type: string
18 default: ""
19
20=== modified file 'hooks/install'
21--- hooks/install 2013-01-29 15:37:24 +0000
22+++ hooks/install 2013-01-29 15:37:24 +0000
23@@ -4,6 +4,7 @@
24 source $(dirname "$0")/common.incl
25
26 REPOS_URL=$(config-get repos_url)
27+REPOS_BRANCH=$(config-get repos_branch)
28 REPOS_USERNAME=$(config-get repos_username)
29 REPOS_PASSWORD=$(config-get repos_password)
30 EXTRA_DEB_PKGS=$(config-get extra_deb_pkgs)
31@@ -37,7 +38,11 @@
32 hg clone ${REPOS_URL} ${UNIT_DIR}
33 ;;
34 git)
35- git clone ${REPOS_URL} ${UNIT_DIR}
36+ if [ -n "$REPOS_BRANCH" ]; then
37+ git clone ${REPOS_URL} -b ${REPOS_BRANCH} ${UNIT_DIR}
38+ else
39+ git clone ${REPOS_URL} ${UNIT_DIR}
40+ fi
41 ;;
42 bzr)
43 bzr branch ${REPOS_URL} ${UNIT_DIR}

Subscribers

People subscribed via source and target branches

to all changes: