Rev 190: Merge upstream in file:///home/jelmer/bzr-gtk/trunk/
Jelmer Vernooij
jelmer at samba.org
Sat Apr 7 15:58:07 BST 2007
At file:///home/jelmer/bzr-gtk/trunk/
------------------------------------------------------------
revno: 190
revision-id: jelmer at samba.org-20070407145759-qn5j38wdy216qynm
parent: jelmer at samba.org-20070406144924-h8ckzxctlu9otblv
parent: szilveszter.farkas at gmail.com-20070407134059-erowddb18gxitjcg
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2007-04-07 16:57:59 +0200
message:
Merge upstream
added:
initialize.py initialize.py-20070406171439-vi4hce9b12bdofts-1
modified:
NEWS news-20070325173539-3va57o99cz3o57xe-1
README README-20051017002359-1debfab4c21afd00
__init__.py __init__.py-20060519165329-a1fd52c8a829fcd5
olive.glade olive.glade-20060716235030-brgx1ry6lt6z8044-1
olive/__init__.py __init__.py-20060925014013-13wdvwl8vi8gfqi1-2
------------------------------------------------------------
revno: 188.1.2
merged: szilveszter.farkas at gmail.com-20070407134059-erowddb18gxitjcg
parent: szilveszter.farkas at gmail.com-20070407074325-a8q9g9tv012elgqu
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: trunk
timestamp: Sat 2007-04-07 15:40:59 +0200
message:
Added note about plugin directory name.
------------------------------------------------------------
revno: 188.1.1
merged: szilveszter.farkas at gmail.com-20070407074325-a8q9g9tv012elgqu
parent: jelmer at samba.org-20070403200105-nn3xmr553g51r79e
parent: szilveszter.farkas at gmail.com-20070406181155-e28e8rvjiz0kdx2t
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: trunk
timestamp: Sat 2007-04-07 09:43:25 +0200
message:
Merged fix for #90839. Initialize dialog implemented.
------------------------------------------------------------
revno: 188.2.4
merged: szilveszter.farkas at gmail.com-20070406181155-e28e8rvjiz0kdx2t
parent: szilveszter.farkas at gmail.com-20070406175923-fkwoo73iy2yuv3jy
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk.90839
timestamp: Fri 2007-04-06 20:11:55 +0200
message:
Added NEWS entry.
------------------------------------------------------------
revno: 188.2.3
merged: szilveszter.farkas at gmail.com-20070406175923-fkwoo73iy2yuv3jy
parent: szilveszter.farkas at gmail.com-20070406174823-bclt7vsgn2nkcas2
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk.90839
timestamp: Fri 2007-04-06 19:59:23 +0200
message:
Added the new Initialize dialog to Olive.
------------------------------------------------------------
revno: 188.2.2
merged: szilveszter.farkas at gmail.com-20070406174823-bclt7vsgn2nkcas2
parent: szilveszter.farkas at gmail.com-20070406171631-mtb9r4kptogh35ox
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk.90839
timestamp: Fri 2007-04-06 19:48:23 +0200
message:
Implemented init functionality.
------------------------------------------------------------
revno: 188.2.1
merged: szilveszter.farkas at gmail.com-20070406171631-mtb9r4kptogh35ox
parent: jelmer at samba.org-20070403200105-nn3xmr553g51r79e
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk.90839
timestamp: Fri 2007-04-06 19:16:31 +0200
message:
Inital implementation of the Initialize dialog. Not fully functional yet.
=== added file 'initialize.py'
--- a/initialize.py 1970-01-01 00:00:00 +0000
+++ b/initialize.py 2007-04-06 17:48:23 +0000
@@ -0,0 +1,118 @@
+# Copyright (C) 2007 by Szilveszter Farkas (Phanatic) <szilveszter.farkas at gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+try:
+ import pygtk
+ pygtk.require("2.0")
+except:
+ pass
+
+import gtk
+
+import os
+
+from dialog import error_dialog
+from errors import show_bzr_error
+
+from bzrlib import bzrdir
+from bzrlib import transport
+import bzrlib.errors as errors
+
+class InitDialog(gtk.Dialog):
+ """ Initialize dialog. """
+ def __init__(self, path, parent=None):
+ """ Initialize the Initialize dialog. """
+ gtk.Dialog.__init__(self, title="Initialize - Olive",
+ parent=parent,
+ flags=0,
+ buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
+
+ # Get arguments
+ self.path = path
+
+ # Create the widgets
+ self._button_init = gtk.Button(_("_Initialize"), use_underline=True)
+ self._label_question = gtk.Label(_("Which directory do you want to initialize?"))
+ self._radio_current = gtk.RadioButton(None, _("Current directory"))
+ self._radio_custom = gtk.RadioButton(self._radio_current, _("Create a new directory with the name:"))
+ self._entry_custom = gtk.Entry()
+ self._hbox_custom = gtk.HBox()
+
+ # Set callbacks
+ self._button_init.connect('clicked', self._on_init_clicked)
+ self._radio_custom.connect('toggled', self._on_custom_toggled)
+
+ # Set properties
+ self._entry_custom.set_sensitive(False)
+
+ # Construct the dialog
+ self.action_area.pack_end(self._button_init)
+
+ self._hbox_custom.pack_start(self._radio_custom, False, False)
+ self._hbox_custom.pack_start(self._entry_custom, True, True)
+
+ self.vbox.pack_start(self._label_question)
+ self.vbox.pack_start(self._radio_current)
+ self.vbox.pack_start(self._hbox_custom)
+
+ # Display the dialog
+ self.vbox.show_all()
+
+ def _on_custom_toggled(self, widget):
+ """ Occurs if the Custom radiobutton is toggled. """
+ if self._radio_custom.get_active():
+ self._entry_custom.set_sensitive(True)
+ self._entry_custom.grab_focus()
+ else:
+ self._entry_custom.set_sensitive(False)
+
+ @show_bzr_error
+ def _on_init_clicked(self, widget):
+ if self._radio_custom.get_active() and len(self._entry_custom.get_text()) == 0:
+ error_dialog(_("Directory name not specified"),
+ _("You should specify a new directory name."))
+ return
+
+ if self._radio_current.get_active():
+ location = self.path
+ else:
+ location = self.path + os.sep + self._entry_custom.get_text()
+
+ format = bzrdir.format_registry.make_bzrdir('default')
+ to_transport = transport.get_transport(location)
+
+ try:
+ to_transport.mkdir('.')
+ except errors.FileExists:
+ pass
+
+ try:
+ existing_bzrdir = bzrdir.BzrDir.open(location)
+ except errors.NotBranchError:
+ branch = bzrdir.BzrDir.create_branch_convenience(to_transport.base,
+ format=format)
+ else:
+ from bzrlib.transport.local import LocalTransport
+ if existing_bzrdir.has_branch():
+ if (isinstance(to_transport, LocalTransport)
+ and not existing_bzrdir.has_workingtree()):
+ raise errors.BranchExistsWithoutWorkingTree(location)
+ raise errors.AlreadyBranchError(location)
+ else:
+ branch = existing_bzrdir.create_branch()
+ existing_bzrdir.create_workingtree()
+
+ self.response(gtk.RESPONSE_OK)
=== modified file 'NEWS'
--- a/NEWS 2007-04-03 20:01:05 +0000
+++ b/NEWS 2007-04-07 07:43:25 +0000
@@ -1,12 +1,16 @@
0.16.0 UNRELEASED
+ FEATURES
+
+ * An Initialize dialog added to Olive along with a 'ginit' command
+ (#90839, Szilveszter)
0.15.2 2007-04-03
BUG FIXES
* Fix regression that prevented gannotate from being used (#97473,
- Vincent, Jelmer)
+ Vincent, Jelmer)
* Fix regression that prevented gstatus from being used (Jelmer)
=== modified file 'README'
--- a/README 2007-03-09 16:22:27 +0000
+++ b/README 2007-04-07 13:40:59 +0000
@@ -43,6 +43,8 @@
your bzr working tree, or adding the location of bzr-gtk to your
BZR_PLUGIN_PATH environment variable.
+Note: the plugin directory of bzr-gtk must be called 'gtk'.
+
To use the nautilus integration, either place the nautilus-bzr.py file in
~/.nautilus/python-extensions or in /usr/lib/nautilus/extensions-1.0/python
=== modified file '__init__.py'
--- a/__init__.py 2007-04-03 20:01:05 +0000
+++ b/__init__.py 2007-04-06 17:16:31 +0000
@@ -419,6 +419,14 @@
local_branch.unlock()
+class cmd_ginit(GTKCommand):
+ def run(self):
+ self.open_display()
+ from initialize import InitDialog
+ dialog = InitDialog(os.path.abspath(os.path.curdir))
+ dialog.run()
+
+
commands = [
cmd_gmissing,
cmd_gpreferences,
@@ -430,7 +438,8 @@
cmd_gdiff,
cmd_gpush,
cmd_gcheckout,
- cmd_gbranch
+ cmd_gbranch,
+ cmd_ginit
]
for cmd in commands:
=== modified file 'olive.glade'
--- a/olive.glade 2007-02-04 12:05:45 +0000
+++ b/olive.glade 2007-04-06 17:59:23 +0000
@@ -204,7 +204,7 @@
<child>
<widget class="GtkMenuItem" id="menuitem_branch_initialize">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Initialize</property>
+ <property name="label" translatable="yes">_Initialize...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menuitem_branch_initialize_activate" last_modification_time="Mon, 17 Jul 2006 08:52:48 GMT"/>
</widget>
=== modified file 'olive/__init__.py'
--- a/olive/__init__.py 2007-03-15 16:54:15 +0000
+++ b/olive/__init__.py 2007-04-06 17:59:23 +0000
@@ -48,6 +48,7 @@
from bzrlib.plugins.gtk.annotate.config import GAnnotateConfig
from bzrlib.plugins.gtk.commit import CommitDialog
from bzrlib.plugins.gtk.conflicts import ConflictsDialog
+from bzrlib.plugins.gtk.initialize import InitDialog
from bzrlib.plugins.gtk.push import PushDialog
class OliveGtk:
@@ -343,30 +344,17 @@
status = StatusDialog(self.wt, self.wtpath)
status.display()
- @show_bzr_error
def on_menuitem_branch_initialize_activate(self, widget):
""" Initialize current directory. """
- import bzrlib.bzrdir as bzrdir
+ init = InitDialog(self.path, self.window)
+ response = init.run()
+ if response != gtk.RESPONSE_NONE:
+ init.hide()
- if not os.path.exists(self.path):
- os.mkdir(self.path)
-
- try:
- existing_bzrdir = bzrdir.BzrDir.open(self.path)
- except bzrerrors.NotBranchError:
- bzrdir.BzrDir.create_branch_convenience(self.path)
- else:
- if existing_bzrdir.has_branch():
- if existing_bzrdir.has_workingtree():
- raise bzrerrors.AlreadyBranchError(self.path)
- else:
- raise bzrerrors.BranchExistsWithoutWorkingTree(self.path)
- else:
- existing_bzrdir.create_branch()
- existing_bzrdir.create_workingtree()
- info_dialog(_('Initialize successful'),
- _('Directory successfully initialized.'))
- self.refresh_right()
+ if response == gtk.RESPONSE_OK:
+ self.refresh_right()
+
+ init.destroy()
def on_menuitem_file_annotate_activate(self, widget):
""" File/Annotate... menu handler. """
More information about the bazaar-commits
mailing list