/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: Jelmer Vernooij
  • Date: 2006-09-04 23:33:13 UTC
  • mto: (0.8.83 merge)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060904233313-f8d303ec87f6de13
Eliminate olive.backend.errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
 
19
 
import bzrlib.errors as errors
20
 
 
21
19
from bzrlib.workingtree import WorkingTree
22
20
 
23
 
from errors import ConnectionError, NoLocationKnown, NotBranchError
 
21
from bzrlib.errors import NoLocationKnown
24
22
 
25
23
def missing(branch, other_branch=None, reverse=False):
26
24
    """ Get the number of missing or extra revisions of local branch.
36
34
    import bzrlib
37
35
    from bzrlib.missing import find_unmerged
38
36
    
39
 
    try:
40
 
        local_branch = bzrlib.branch.Branch.open_containing(branch)[0]
41
 
    except errors.NotBranchError:
42
 
        raise NotBranchError(branch)
43
 
    except:
44
 
        raise
 
37
    local_branch = bzrlib.branch.Branch.open_containing(branch)[0]
45
38
    
46
39
    parent = local_branch.get_parent()
47
40
    if other_branch is None:
49
42
        if other_branch is None:
50
43
            raise NoLocationKnown
51
44
    
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
 
45
    remote_branch = bzrlib.branch.Branch.open(other_branch)
60
46
    
61
47
    if remote_branch.base == local_branch.base:
62
48
        remote_branch = local_branch
127
113
    try:
128
114
        tree_to = WorkingTree.open_containing(branch)[0]
129
115
        branch_to = tree_to.branch
130
 
    except errors.NoWorkingTree:
 
116
    except NoWorkingTree:
131
117
        tree_to = None
132
 
        try:
133
 
            branch_to = Branch.open_containing(branch)[0]
134
 
        except errors.NotBranchError:
135
 
            raise NotBranchError(location)
136
 
    except errors.NotBranchError:
137
 
        raise NotBranchError(location)
 
118
        branch_to = Branch.open_containing(branch)[0]
138
119
 
139
120
    reader = None
140
121
    if location is not None and not nobundle:
141
122
        try:
142
123
            reader = read_bundle_from_url(location)
143
 
        except errors.NotABundle:
 
124
        except NotABundle:
144
125
            pass # Continue on considering this url a Branch
145
126
 
146
127
    stored_loc = branch_to.get_parent()