/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-02 14:27:00 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-20060902142700-53171c98d497a8db
Implemented Missing revisions functionality.

2006-09-02  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * po/olive-gtk.pot: regenerated
    * olive/backend/errors.py: added ConnectionError exception
    * olive/frontend/gtk/handler.py: implemented Missing revisions menu handler
    * olive.glade: added Branch/Missing revisions menu item
    * olive/backend/update.py: added NotBranchError and ConnectionError
      exceptions to missing()

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()