/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: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.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. """
73
73
                return
74
74
            
75
75
            try:
76
 
                fileops.remove([directory + '/' + filename])
 
76
                wt, path = WorkingTree.open_containing(directory + '/' + filename)
 
77
                wt.remove(path)
77
78
            except errors.NotBranchError:
78
79
                self.dialog.error_dialog(_('Directory is not a branch'),
79
80
                                         _('You can perform this action only in a branch.'))
89
90
        elif radio_new.get_active():
90
91
            # Remove added files recursively
91
92
            try:
92
 
                fileops.remove([directory], True)
 
93
                wt, path = WorkingTree.open_containing(directory)
93
94
            except errors.NotBranchError:
94
95
                self.dialog.error_dialog(_('Directory is not a branch'),
95
96
                                         _('You can perform this action only in a branch.'))
96
97
                self.comm.set_busy(self.window, False)
97
98
                return
98
 
            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:
99
105
                dialog.warning_dialog(_('No matching files'),
100
106
                                      _('No added files were found in the working tree.'))
101
107
                self.comm.set_busy(self.window, False)
102
 
            except:
103
 
                raise
 
108
                return
 
109
            wt.remove(file_list)
104
110
        else:
105
111
            # This should really never happen.
106
112
            pass