/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 bzrlib/upgrade.py

  • Committer: Neil Santos
  • Date: 2010-03-04 02:43:41 UTC
  • mto: (5080.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5081.
  • Revision ID: neil_santos@users.sourceforge.net-20100304024341-ra7njxj4lzjb46rl
Removed separate lstat() and reverted LocalTransport and SFTPTransport's stat() methods to using lstat() internally.
Reworked how SFTPTransport's symlink() handles success and signals failure.
Removed lstat() declaration on the Transport base class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    def __init__(self, url, format=None):
29
29
        self.format = format
30
30
        self.bzrdir = BzrDir.open_unsupported(url)
31
 
        # XXX: Change to cleanup
32
 
        warning_id = 'cross_format_fetch'
33
 
        saved_warning = warning_id in ui.ui_factory.suppressed_warnings
34
31
        if isinstance(self.bzrdir, RemoteBzrDir):
35
32
            self.bzrdir._ensure_real()
36
33
            self.bzrdir = self.bzrdir._real_bzrdir
37
34
        if self.bzrdir.root_transport.is_readonly():
38
35
            raise errors.UpgradeReadonly
39
36
        self.transport = self.bzrdir.root_transport
40
 
        ui.ui_factory.suppressed_warnings.add(warning_id)
41
 
        try:
42
 
            self.convert()
43
 
        finally:
44
 
            if not saved_warning:
45
 
                ui.ui_factory.suppressed_warnings.remove(warning_id)
 
37
        self.convert()
46
38
 
47
39
    def convert(self):
48
40
        try:
49
41
            branch = self.bzrdir.open_branch()
50
 
            if branch.user_url != self.bzrdir.user_url:
 
42
            if branch.bzrdir.root_transport.base != \
 
43
                self.bzrdir.root_transport.base:
51
44
                ui.ui_factory.note("This is a checkout. The branch (%s) needs to be "
52
45
                             "upgraded separately." %
53
 
                             branch.user_url)
 
46
                             branch.bzrdir.root_transport.base)
54
47
            del branch
55
48
        except (errors.NotBranchError, errors.IncompatibleRepositories):
56
49
            # might not be a format we can open without upgrading; see e.g.