29
28
import bzrlib.errors as errors
31
30
from olive import gladefile
31
from dialog import error_dialog, warning_dialog
34
34
""" Display the Make directory dialog and perform the needed actions. """
60
63
error_dialog(_('No directory name given'),
61
_('Please specify a desired name for the new directory.'))
64
_('Please specify a desired name for the new directory.'))
64
67
if checkbox.get_active():
65
68
# Want to create a versioned directory
67
from bzrlib.workingtree import WorkingTree
69
os.mkdir(os.path.join(wt.base, wtpath))
70
os.mkdir(os.path.join(self.wt.basedir, self.wtpath, dirname))
72
self.wt.add([os.path.join(self.wtpath, dirname)])
74
75
error_dialog(_('Directory already exists'),
75
_('Please specify another name to continue.'))
76
_('Please specify another name to continue.'))
78
79
except errors.NotBranchError:
79
80
warning_dialog(_('Directory is not in a branch'),
80
_('You can only create a non-versioned directory.'))
81
_('You can only create a non-versioned directory.'))
82
83
# Just a simple directory
84
os.mkdir(os.path.join(wt.base, wtpath))
85
os.mkdir(os.path.join(self.wt.basedir, self.wtpath, dirname))
87
88
error_dialog(_('Directory already exists'),
88
_('Please specify another name to continue.'))
89
_('Please specify another name to continue.'))
92
self.comm.refresh_right()
94
94
def close(self, widget=None):
95
95
self.window.destroy()