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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-27 19:10:00 UTC
  • mto: (0.14.1 main)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060927191000-2b5382eda85d82e4
Fixed a context menu bug; set release date.

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.errors as errors
31
 
import olive.backend.fileops as fileops
 
30
import bzrlib.errors as errors
 
31
from bzrlib.workingtree import WorkingTree
32
32
 
33
33
class OliveRemove:
34
34
    """ Display the Remove file(s) dialog and perform the needed actions. """
69
69
            if filename is None:
70
70
                self.dialog.error_dialog(_('No file was selected'),
71
71
                                         _('Please select a file from the list,\nor choose the other option.'))
 
72
                self.comm.set_busy(self.window, False)
72
73
                return
73
74
            
74
75
            try:
75
 
                fileops.remove([directory + '/' + filename])
 
76
                wt, path = WorkingTree.open_containing(directory + '/' + filename)
 
77
                wt.remove(path)
76
78
            except errors.NotBranchError:
77
79
                self.dialog.error_dialog(_('Directory is not a branch'),
78
80
                                         _('You can perform this action only in a branch.'))
88
90
        elif radio_new.get_active():
89
91
            # Remove added files recursively
90
92
            try:
91
 
                fileops.remove([directory], True)
 
93
                wt, path = WorkingTree.open_containing(directory)
92
94
            except errors.NotBranchError:
93
95
                self.dialog.error_dialog(_('Directory is not a branch'),
94
96
                                         _('You can perform this action only in a branch.'))
95
97
                self.comm.set_busy(self.window, False)
96
98
                return
97
 
            except errors.NoMatchingFiles:
 
99
            except:
 
100
                raise
 
101
            
 
102
            added = wt.changes_from(wt.basis_tree()).added
 
103
            file_list = sorted([f[0] for f in added], reverse=True)
 
104
            if len(file_list) == 0:
98
105
                dialog.warning_dialog(_('No matching files'),
99
106
                                      _('No added files were found in the working tree.'))
100
107
                self.comm.set_busy(self.window, False)
101
 
            except:
102
 
                raise
 
108
                return
 
109
            wt.remove(file_list)
103
110
        else:
104
111
            # This should really never happen.
105
112
            pass