~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-16 18:34:26 UTC
  • mfrom: (5609.46.3 2.3.4-dev)
  • mto: This revision was merged to the branch mainline in revision 5980.
  • Revision ID: v.ladeuil+lp@free.fr-20110616183426-oj818x56zm7yzvb8
Merge 2.3 into trunk

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
 
"""Reconfigure a controldir into a new tree/branch/repository layout.
 
17
"""Reconfigure a bzrdir into a new tree/branch/repository layout.
18
18
 
19
19
Various types of reconfiguration operation are available either by
20
20
constructing a class or using a factory method on Reconfigure.
23
23
 
24
24
from bzrlib import (
25
25
    branch,
26
 
    controldir,
 
26
    bzrdir,
27
27
    errors,
28
28
    trace,
29
29
    ui,
30
30
    urlutils,
31
31
    )
32
 
from bzrlib.i18n import gettext
 
32
 
33
33
 
34
34
# TODO: common base class for all reconfigure operations, making no
35
35
# assumptions about what kind of change will be done.
48
48
        try:
49
49
            branch.set_stacked_on_url(on_url)
50
50
            if not trace.is_quiet():
51
 
                ui.ui_factory.note(gettext(
52
 
                    "{0} is now stacked on {1}\n").format(
53
 
                      branch.base, branch.get_stacked_on_url()))
 
51
                ui.ui_factory.note(
 
52
                    "%s is now stacked on %s\n"
 
53
                    % (branch.base, branch.get_stacked_on_url()))
54
54
        finally:
55
55
            branch.unlock()
56
56
 
63
63
        try:
64
64
            branch.set_stacked_on_url(None)
65
65
            if not trace.is_quiet():
66
 
                ui.ui_factory.note(gettext(
67
 
                    "%s is now not stacked\n")
 
66
                ui.ui_factory.note(
 
67
                    "%s is now not stacked\n"
68
68
                    % (branch.base,))
69
69
        finally:
70
70
            branch.unlock()
344
344
                reference_branch.repository.fetch(self.repository)
345
345
            elif self.local_branch is not None and not self._destroy_branch:
346
346
                up = self.local_branch.user_transport.clone('..')
347
 
                up_bzrdir = controldir.ControlDir.open_containing_from_transport(
348
 
                    up)[0]
 
347
                up_bzrdir = bzrdir.BzrDir.open_containing_from_transport(up)[0]
349
348
                new_repo = up_bzrdir.find_repository()
350
349
                new_repo.fetch(self.repository)
351
350
        last_revision_info = None