Merge lp:~stevenk/launchpad/clean-up-ibranch into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 15873
Proposed branch: lp:~stevenk/launchpad/clean-up-ibranch
Merge into: lp:launchpad
Diff against target: 81 lines (+13/-26)
3 files modified
database/schema/security.cfg (+0/-1)
lib/lp/code/interfaces/branch.py (+11/-16)
lib/lp/code/model/branch.py (+2/-9)
To merge this branch: bzr merge lp:~stevenk/launchpad/clean-up-ibranch
Reviewer Review Type Date Requested Status
Ian Booth (community) Approve
Review via email: mp+121536@code.launchpad.net

Commit message

Clean up IBranch. Delete an unneeded explicitly_private defintion from the interface, and destroy transitively_private in the model.

Description of the change

I noticed this a few days ago, but only got around to fixing it now. Firstly, Branch.transitively_private now only exists in the model, so it can finally be killed. IBranch.explicitly_private was listed twice in the interface, one exported and one not, so I killed the one that wasn't exported. I have also made explicitly_private = private in the model to save on duplicated code.

To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) wrote :

Awesome. No more transitively_private \o/

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/security.cfg'
2--- database/schema/security.cfg 2012-08-28 19:07:49 +0000
3+++ database/schema/security.cfg 2012-08-29 01:09:26 +0000
4@@ -77,7 +77,6 @@
5 public.sha1(text) = EXECUTE
6 public.ulower(text) = EXECUTE
7 public.update_database_disk_utilization() =
8-public.update_transitively_private(integer, integer, boolean) =
9 public.valid_absolute_url(text) = EXECUTE
10 public.valid_branch_name(text) = EXECUTE
11 public.valid_bug_name(text) = EXECUTE
12
13=== modified file 'lib/lp/code/interfaces/branch.py'
14--- lib/lp/code/interfaces/branch.py 2012-08-21 11:03:33 +0000
15+++ lib/lp/code/interfaces/branch.py 2012-08-29 01:09:26 +0000
16@@ -249,10 +249,16 @@
17 title=_('Date Last Modified'),
18 required=True,
19 readonly=False))
20- explicitly_private = Bool(
21- title=_("Explicitly Private"),
22- description=_("This branch is explicitly marked private as opposed "
23- "to being private because it is stacked on a private branch."))
24+ # Defines whether *this* branch is private. A branch may have
25+ # explicitly private set false but still be considered private because it
26+ # is stacked on a private branch. This attribute is read-only. The value
27+ # is guarded by setPrivate().
28+ explicitly_private = exported(
29+ Bool(
30+ title=_("Keep branch confidential"), required=False,
31+ readonly=True, default=False,
32+ description=_(
33+ "Make this branch visible only to its subscribers.")))
34 information_type = exported(
35 Choice(
36 title=_('Information Type'), vocabulary=InformationType,
37@@ -1223,18 +1229,7 @@
38 description=_(
39 "This branch is visible only to its subscribers.")))
40
41- # Defines whether *this* branch is private. A branch may have
42- # explicitly private set false but still be considered private because it
43- # is stacked on a private branch. This attribute is read-only. The value
44- # is guarded by setPrivate().
45- explicitly_private = exported(
46- Bool(
47- title=_("Keep branch confidential"), required=False,
48- readonly=True, default=False,
49- description=_(
50- "Make this branch visible only to its subscribers.")))
51-
52- @mutator_for(explicitly_private)
53+ @mutator_for(IBranchPublic['explicitly_private'])
54 @call_with(user=REQUEST_USER)
55 @operation_parameters(
56 private=Bool(title=_("Keep branch confidential")))
57
58=== modified file 'lib/lp/code/model/branch.py'
59--- lib/lp/code/model/branch.py 2012-08-24 05:09:51 +0000
60+++ lib/lp/code/model/branch.py 2012-08-29 01:09:26 +0000
61@@ -202,19 +202,12 @@
62 enum=InformationType, default=InformationType.PUBLIC)
63 access_policy = IntCol()
64
65- # These can die after the UI is dropped.
66- @property
67- def explicitly_private(self):
68- return self.private
69-
70- @property
71- def transitively_private(self):
72- return self.private
73-
74 @property
75 def private(self):
76 return self.information_type in PRIVATE_INFORMATION_TYPES
77
78+ explicitly_private = private
79+
80 def _reconcileAccess(self):
81 """Reconcile the branch's sharing information.
82