Merge lp:~frankban/charms/precise/juju-gui/revision-support into lp:~juju-gui/charms/precise/juju-gui/trunk
Proposed by
Francesco Banconi
Status: | Merged |
---|---|
Merged at revision: | 58 |
Proposed branch: | lp:~frankban/charms/precise/juju-gui/revision-support |
Merge into: | lp:~juju-gui/charms/precise/juju-gui/trunk |
Diff against target: |
117 lines (+38/-8) 4 files modified
config.yaml (+2/-1) hooks/utils.py (+26/-5) revision (+1/-1) tests/test_utils.py (+9/-1) |
To merge this branch: | bzr merge lp:~frankban/charms/precise/juju-gui/revision-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
charmers | Pending | ||
Review via email: mp+164326@code.launchpad.net |
Description of the change
Support juju-gui-
Added support for creating and deploying
a release from a specific branch revision.
To post a comment you must log in.
Reviewers: mp+164326_ code.launchpad. net,
Message:
Please take a look.
Description: source= branch: revno
Support juju-gui-
Added support for creating and deploying
a release from a specific branch revision.
https:/ /code.launchpad .net/~frankban/ charms/ precise/ juju-gui/ revision- support/ +merge/ 164326
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/9464043/
Affected files:
A [revision details]
M config.yaml
M hooks/utils.py
M revision
M tests/test_utils.py
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision:
<email address hidden>
Index: config.yaml ' prefixed
=== modified file 'config.yaml'
--- config.yaml 2013-05-02 14:57:04 +0000
+++ config.yaml 2013-05-11 00:18:47 +0000
@@ -10,7 +10,8 @@
will be deployed;
- a Bazaar branch (e.g. 'lp:juju-gui'): a release will be created and
deployed from the specified Bazaar branch. 'http://
branches
- work as well.
+ work as well. It is also possible to include the specific branch
+ revision, e.g. 'lp:juju-gui:42' will checkout revno 42.
- a 'url:' prefixed url (ex: url:http://...) of a specific location
to pull a release from.
type: string
Index: revision
=== modified file 'revision'
--- revision 2013-05-02 14:57:04 +0000
+++ revision 2013-05-16 13:54:35 +0000
@@ -1,1 +1,1 @@
-45
+46
Index: hooks/utils.py
=== modified file 'hooks/utils.py'
--- hooks/utils.py 2013-05-03 10:37:06 +0000
+++ hooks/utils.py 2013-05-17 09:07:28 +0000
@@ -44,6 +44,7 @@
import json
import os
import logging
+import re
import shutil
from subprocess import CalledProcessError
import tempfile
@@ -211,6 +212,14 @@
log("<<< Exiting {}".format(script))
+bzr_url_expression = re.compile(r""" |http:\ /\/)[^: ]+) # Branch URL (scheme + domain/path). source) :
+ ^ # Beginning of line.
+ ((?:lp:
+ (?::(\d+))? # Optional branch revision.
+ $ # End of line.
+""", re.VERBOSE)
+
+
def parse_source(
"""Parse the ``juju-gui-source`` option.
@@ -220,7 +229,9 @@ example. com/gui'): release from a downloaded file. startswith( 'url:') : '): expression. match(sourc. ..
- ('stable', '0.1.0'): stable release v0.1.0;
- ('trunk', None): latest trunk release;
- ('trunk', '0.1.0+build.1'): trunk release v0.1.0 bzr revision 1;
- - ('branch', 'lp:juju-gui'): release is made from a branch;
+ - ('branch', ('lp:juju-gui', 42): release is made from a branch -
+ in this case the second element includes the branch URL and
revision;
+ - ('branch', ('lp:juju-gui', None): no revision is specified;
- ('url', 'http://
"""
if source.
@@ -233,8 +244,9 @@
return 'url', source
if source in ('stable', 'trunk'):
return source, None
- if source.startswith('lp:') or source.startswith('http://
- return 'branch', source
+ match = bzr_url_