/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/launchpad/lp_propose.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
    def __init__(self):
42
42
        hooks.Hooks.__init__(self, "breezy.plugins.launchpad.lp_propose",
43
 
            "Proposer.hooks")
 
43
                             "Proposer.hooks")
44
44
        self.add_hook('get_prerequisite',
45
 
            "Return the prerequisite branch for proposing as merge.", (2, 1))
 
45
                      "Return the prerequisite branch for proposing as merge.", (2, 1))
46
46
        self.add_hook('merge_proposal_body',
47
 
            "Return an initial body for the merge proposal message.", (2, 1))
 
47
                      "Return an initial body for the merge proposal message.", (2, 1))
48
48
 
49
49
 
50
50
class Proposer(object):
122
122
            files = modified_files(lca_tree, source_tree)
123
123
            return list(files)
124
124
        target_loc = ('bzr+ssh://bazaar.launchpad.net/%s' %
125
 
                       self.target_branch.lp.unique_name)
 
125
                      self.target_branch.lp.unique_name)
126
126
        body = None
127
127
        for hook in self.hooks['merge_proposal_body']:
128
128
            body = hook({
165
165
 
166
166
    def call_webservice(self, call, *args, **kwargs):
167
167
        """Make a call to the webservice, wrapping failures.
168
 
        
 
168
 
169
169
        :param call: The call to make.
170
170
        :param *args: *args for the call.
171
171
        :param **kwargs: **kwargs for the call.
187
187
        self.call_webservice(
188
188
            mp.createComment,
189
189
            vote=u'Approve',
190
 
            subject='', # Use the default subject.
 
190
            subject='',  # Use the default subject.
191
191
            content=u"Rubberstamp! Proposer approves of own proposal.")
192
192
        self.call_webservice(mp.setStatus, status=u'Approved', revid=revid)
193
193
 
227
227
def modified_files(old_tree, new_tree):
228
228
    """Return a list of paths in the new tree with modified contents."""
229
229
    for f, (op, path), c, v, p, n, (ok, k), e in new_tree.iter_changes(
230
 
        old_tree):
 
230
            old_tree):
231
231
        if c and k == 'file':
232
232
            yield str(path)