/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/reconfigure.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        # it may be a path relative to the cwd or a url; the branch wants
119
119
        # a path relative to itself...
120
120
        on_url = urlutils.relative_url(branch.base,
121
 
            urlutils.normalize_url(stacked_on_url))
 
121
                                       urlutils.normalize_url(stacked_on_url))
122
122
        branch.lock_write()
123
123
        try:
124
124
            branch.set_stacked_on_url(on_url)
125
125
            if not trace.is_quiet():
126
126
                ui.ui_factory.note(gettext(
127
127
                    "{0} is now stacked on {1}\n").format(
128
 
                      branch.base, branch.get_stacked_on_url()))
 
128
                    branch.base, branch.get_stacked_on_url()))
129
129
        finally:
130
130
            branch.unlock()
131
131
 
273
273
            raise ReconfigurationNotSupported(reconfiguration.controldir)
274
274
        if with_trees and reconfiguration.repository.make_working_trees():
275
275
            raise AlreadyWithTrees(controldir)
276
 
        elif (not with_trees
277
 
              and not reconfiguration.repository.make_working_trees()):
 
276
        elif (not with_trees and
 
277
              not reconfiguration.repository.make_working_trees()):
278
278
            raise AlreadyWithNoTrees(controldir)
279
279
        else:
280
280
            reconfiguration._repository_trees = with_trees
292
292
                self._create_repository = True
293
293
        else:
294
294
            if want_reference and (
295
 
                self.repository.user_url == self.controldir.user_url):
 
295
                    self.repository.user_url == self.controldir.user_url):
296
296
                if not self.repository.is_shared():
297
297
                    self._destroy_repository = True
298
298
        if self.referenced_branch is None:
332
332
 
333
333
    def changes_planned(self):
334
334
        """Return True if changes are planned, False otherwise"""
335
 
        return (self._unbind or self._bind or self._destroy_tree
336
 
                or self._create_tree or self._destroy_reference
337
 
                or self._create_branch or self._create_repository
338
 
                or self._create_reference or self._destroy_repository)
 
335
        return (self._unbind or self._bind or self._destroy_tree or
 
336
                self._create_tree or self._destroy_reference or
 
337
                self._create_branch or self._create_repository or
 
338
                self._create_reference or self._destroy_repository)
339
339
 
340
340
    def _check(self):
341
341
        """Raise if reconfiguration would destroy local changes"""
342
342
        if self._destroy_tree and self.tree.has_changes():
343
 
                raise errors.UncommittedChanges(self.tree)
 
343
            raise errors.UncommittedChanges(self.tree)
344
344
        if self._create_reference and self.local_branch is not None:
345
345
            reference_branch = branch.Branch.open(self._select_bind_location())
346
 
            if (reference_branch.last_revision() !=
347
 
                self.local_branch.last_revision()):
 
346
            if (reference_branch.last_revision()
 
347
                    != self.local_branch.last_revision()):
348
348
                raise UnsyncedBranches(self.controldir, reference_branch)
349
349
 
350
350
    def _select_bind_location(self):