/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/branch.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-27 19:11:59 UTC
  • mfrom: (0.8.90 merge)
  • mto: (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 103.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060927191159-cc4e54f613575779
Merge all changes. Release 0.11.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
except:
28
28
    sys.exit(1)
29
29
 
30
 
import olive.backend.init as init
31
 
import olive.backend.errors as errors
 
30
import bzrlib.errors as errors
32
31
 
33
32
class OliveBranch:
34
33
    """ Display branch dialog and perform the needed operations. """
71
70
        
72
71
        spinbutton_revno = self.glade.get_widget('spinbutton_branch_revno')
73
72
        revno = spinbutton_revno.get_value_as_int()
74
 
        if revno == 0:
75
 
            revno = None
 
73
        revision_id = br_from.get_rev_id(revno)
76
74
        
77
75
        self.comm.set_busy(self.window)
78
76
        try:
79
 
            revs = init.branch(location, destination, revno)
 
77
            from bzrlib.transport import get_transport
 
78
 
 
79
            br_from = Branch.open(location)
 
80
 
 
81
            br_from.lock_read()
 
82
 
 
83
            try:
 
84
                destination = destination + '/' + os.path.basename(location.rstrip("/\\"))
 
85
                to_transport = get_transport(destination)
 
86
 
 
87
                to_transport.mkdir('.')
 
88
 
 
89
                try:
 
90
                    dir = br_from.bzrdir.sprout(to_transport.base, revision_id)
 
91
                    branch = dir.open_branch()
 
92
                except NoSuchRevision:
 
93
                    to_transport.delete_tree('.')
 
94
                    raise
 
95
 
 
96
            finally:
 
97
                br_from.unlock()
 
98
                
 
99
            self.close()
 
100
            self.dialog.info_dialog(_('Branching successful'),
 
101
                                _('%d revision(s) branched.') % revs)
 
102
            self.comm.refresh_right()
80
103
        except errors.NonExistingSource, errmsg:
81
104
            self.dialog.error_dialog(_('Non existing source'),
82
105
                                     _("The location (%s)\ndoesn't exist.") % errmsg)
102
125
                                     _('The specified location has to be a branch.'))
103
126
            self.comm.set_busy(self.window, False)
104
127
            return
105
 
        except:
106
 
            raise
107
128
        
108
 
        self.close()
109
 
        self.dialog.info_dialog(_('Branching successful'),
110
 
                                _('%d revision(s) branched.') % revs)
111
 
        self.comm.refresh_right()
112
129
 
113
130
    def close(self, widget=None):
114
131
        self.window.destroy()