/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/backend/update.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-11 02:56:58 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060911025658-997cf3a305b9f1da
A better implementation for the drive selection. (OptionMenu didn't work on Win32)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib.workingtree import WorkingTree
22
22
 
23
 
from errors import NoLocationKnown, NotBranchError
 
23
from errors import ConnectionError, NoLocationKnown, NotBranchError
24
24
 
25
25
def missing(branch, other_branch=None, reverse=False):
26
26
    """ Get the number of missing or extra revisions of local branch.
36
36
    import bzrlib
37
37
    from bzrlib.missing import find_unmerged
38
38
    
39
 
    local_branch = bzrlib.branch.Branch.open_containing(branch)[0]
 
39
    try:
 
40
        local_branch = bzrlib.branch.Branch.open_containing(branch)[0]
 
41
    except errors.NotBranchError:
 
42
        raise NotBranchError(branch)
 
43
    except:
 
44
        raise
 
45
    
40
46
    parent = local_branch.get_parent()
41
47
    if other_branch is None:
42
48
        other_branch = parent
43
49
        if other_branch is None:
44
50
            raise NoLocationKnown
45
 
    remote_branch = bzrlib.branch.Branch.open(other_branch)
 
51
    
 
52
    try:
 
53
        remote_branch = bzrlib.branch.Branch.open(other_branch)
 
54
    except errors.NotBranchError:
 
55
        raise NotBranchError(other_branch)
 
56
    except errors.ConnectionError:
 
57
        raise ConnectionError(other_branch)
 
58
    except:
 
59
        raise
 
60
    
46
61
    if remote_branch.base == local_branch.base:
47
62
        remote_branch = local_branch
48
63
    local_branch.lock_read()
99
114
    
100
115
    :return: number of revisions pulled
101
116
    """
 
117
    nobundle = False
 
118
    
102
119
    from bzrlib.branch import Branch
103
 
    from bzrlib.bundle import read_bundle_from_url
104
 
    from bzrlib.bundle.apply_bundle import install_bundle
 
120
    try:
 
121
        from bzrlib.bundle import read_bundle_from_url
 
122
        from bzrlib.bundle.apply_bundle import install_bundle
 
123
    except ImportError:
 
124
        # no bundle support
 
125
        nobundle = True
105
126
    
106
127
    try:
107
128
        tree_to = WorkingTree.open_containing(branch)[0]
116
137
        raise NotBranchError(location)
117
138
 
118
139
    reader = None
119
 
    if location is not None:
 
140
    if location is not None and not nobundle:
120
141
        try:
121
142
            reader = read_bundle_from_url(location)
122
143
        except errors.NotABundle:
129
150
        else:
130
151
            location = stored_loc
131
152
 
132
 
    if reader is not None:
 
153
    if reader is not None and not nobundle:
133
154
        install_bundle(branch_to.repository, reader)
134
155
        branch_from = branch_to
135
156
    else: