/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: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
from ... import (
20
18
    errors,
21
19
    hooks,
30
28
from breezy.i18n import gettext
31
29
from breezy.plugins.launchpad import (
32
30
    lp_api,
33
 
    lp_registration,
34
31
    )
35
32
""")
36
33
 
69
66
        """
70
67
        self.tree = tree
71
68
        if staging:
72
 
            lp_instance = 'staging'
 
69
            lp_base_url = lp_api.uris.STAGING_SERVICE_ROOT
73
70
        else:
74
 
            lp_instance = 'production'
75
 
        service = lp_registration.LaunchpadService(lp_instance=lp_instance)
76
 
        self.launchpad = lp_api.login(service)
 
71
            lp_base_url = lp_api.uris.LPNET_SERVICE_ROOT
 
72
        self.launchpad = lp_api.connect_launchpad(lp_base_url)
77
73
        self.source_branch = lp_api.LaunchpadBranch.from_bzr(
78
74
            self.launchpad, source_branch)
79
75
        if target_branch is None:
142
138
    def check_proposal(self):
143
139
        """Check that the submission is sensible."""
144
140
        if self.source_branch.lp.self_link == self.target_branch.lp.self_link:
145
 
            raise errors.BzrCommandError(
 
141
            raise errors.CommandError(
146
142
                'Source and target branches must be different.')
147
143
        for mp in self.source_branch.lp.landing_targets:
148
144
            if mp.queue_status in ('Merged', 'Rejected'):
149
145
                continue
150
146
            if mp.target_branch.self_link == self.target_branch.lp.self_link:
151
 
                raise errors.BzrCommandError(gettext(
 
147
                raise errors.CommandError(gettext(
152
148
                    'There is already a branch merge proposal: %s') %
153
149
                    lp_api.canonical_url(mp))
154
150
 
226
222
 
227
223
def modified_files(old_tree, new_tree):
228
224
    """Return a list of paths in the new tree with modified contents."""
229
 
    for f, (op, path), c, v, p, n, (ok, k), e in new_tree.iter_changes(
230
 
            old_tree):
231
 
        if c and k == 'file':
 
225
    for change in new_tree.iter_changes(old_tree):
 
226
        if change.changed_content and change.kind[1] == 'file':
232
227
            yield str(path)