Merge lp:~rharding/charmworld/handle-0-rev into lp:charmworld
Proposed by
Richard Harding
Status: | Merged |
---|---|
Approved by: | Richard Harding |
Approved revision: | 451 |
Merged at revision: | 452 |
Proposed branch: | lp:~rharding/charmworld/handle-0-rev |
Merge into: | lp:charmworld |
Diff against target: |
52 lines (+6/-5) 2 files modified
charmworld/models.py (+4/-4) charmworld/views/tests/test_proof.py (+2/-1) |
To merge this branch: | bzr merge lp:~rharding/charmworld/handle-0-rev |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Gui Bot | continuous-integration | Approve | |
Charmworld Developers | Pending | ||
Review via email: mp+194526@code.launchpad.net |
Commit message
Update proof to handle 0 rev charms.
- When parsing the store url for a rev the regex would return the int 0
- Proof checks to determine if a revision was defined would use if revision
and fail (bool(0) == False)
- Updates the if checks to use if revision is not None, if revision is None
directly.
https:/
R=bac
Description of the change
Update proof to handle 0 rev charms.
- When parsing the store url for a rev the regex would return the int 0
- Proof checks to determine if a revision was defined would use if revision
and fail (bool(0) == False)
- Updates the if checks to use if revision is not None, if revision is None
directly.
To post a comment you must log in.
Reviewers: mp+194526_ code.launchpad. net,
Message:
Please take a look.
Description:
Update proof to handle 0 rev charms.
- When parsing the store url for a rev the regex would return the int 0
- Proof checks to determine if a revision was defined would use if
revision
and fail (bool(0) == False)
- Updates the if checks to use if revision is not None, if revision is
None
directly.
https:/ /code.launchpad .net/~rharding/ charmworld/ handle- 0-rev/+ merge/194526
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/23600043/
Affected files (+8, -5 lines): models. py views/tests/ test_proof. py
A [revision details]
M charmworld/
M charmworld/
Index: [revision details] 20131107014037- izzty1sphugl28b 5
=== 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: tarmac-
+New revision: <email address hidden>
Index: charmworld/ models. py models. py' models. py 2013-11-06 02:32:43 +0000 models. py 2013-11-08 14:53:06 +0000 store_url:
thoughts. append( 'Assuming the data provided is a store url.')
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -1604,14 +1604,14 @@
if self.assume_
- if self.revision:
thoughts. append(
'Looking for specific revision: ' + str(self.revision))
+ if self.revision is not None:
if self.store_url:
thoughts. append(
'Looking for store url: ' + self.store_url)
thoughts. append(
'Regex search for store_url since no revision found: '
self.store_ url) on.revision: on.revision is not None:
charm_query = {'store_url': charm_descripti on.store_ url} on.branch:
charm_ query = {u'branch_spec': charm_descripti on.branch} on.revision: on.revision is not None:
charm_query[ 'store_ data.revision' ] = charm_descripti on.revision on.charm and charm_descripti on.series:
- if not self.revision:
+ if self.revision is None:
+
@@ -1636,7 +1636,7 @@
# The description includes a cs: charm store url, use that.
# That charmstore (cs:) url may or may not have a revision in it.
If
# not, use a regex query to find charms regardless of revision.
- if charm_descripti
+ if charm_descripti
else:
# Charm names and series which make up a store_url are
garunteed
@@ -1653,7 +1653,7 @@
elif charm_descripti
# The description includes a branch_spec to search for.
- if charm_descripti
+ if charm_descripti
# Make sure we check the store revision.
elif charm_descripti
Index: charmworld/ views/tests/ test_proof. py views/tests/ test_proof. py' views/tests/ test_proof. py 2013-11-01 19:09:08 +0000 views/tests/ test_proof. py 2013-11-08 14:53:06 +0000
self.db,
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -15,7 +15,8 @@
# database:mongodb
_id, charm_one = factory.makeCharm(
- descripti...