[Pkg-bazaar-commits] ./bzr-gtk/unstable r58: [merge] Home
Jelmer Vernooij
jelmer at samba.org
Fri Apr 10 07:16:12 UTC 2009
------------------------------------------------------------
revno: 58
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Wed 2006-06-07 10:27:13 +0100
message:
[merge] Home
removed:
commit/
commit/__init__.py
gdiff.py
added:
clone.py
renamed:
commit/gcommit.py => commit.py
modified:
__init__.py
annotate/__init__.py
viz/__init__.py
viz/branchwin.py
viz/diffwin.py
------------------------------------------------------------
revno: 55.1.1
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Sat 2006-05-20 21:23:38 +0200
message:
Add framework for "clone branch" dialog
added:
clone.py
------------------------------------------------------------
revno: 55.1.2
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Sat 2006-05-20 21:24:12 +0200
message:
Move commands to top-level __init__
removed:
commit/
commit/__init__.py
gdiff.py
renamed:
commit/gcommit.py => commit.py
modified:
__init__.py
annotate/__init__.py
viz/__init__.py
------------------------------------------------------------
revno: 55.1.3
committer: Jelmer Vernooij <jelmer at samba.org>
timestamp: Sat 2006-05-20 21:47:46 +0200
message:
Implement simple command for cloning branches
modified:
__init__.py
clone.py
------------------------------------------------------------
revno: 55.1.4
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Wed 2006-06-07 11:06:10 +0200
message:
[merge] Michael
modified:
viz/branchwin.py
viz/diffwin.py
------------------------------------------------------------
revno: 45.1.1
committer: Michael Ellerman <michael at ellerman.id.au>
branch nick: bzrk
timestamp: Wed 2006-05-17 00:01:07 +1000
message:
Instead of having a "jump to revision" button with a dubious icon, make
the revision name the button instead.
modified:
branchwin.py
------------------------------------------------------------
revno: 45.1.2
committer: Michael Ellerman <michael at ellerman.id.au>
branch nick: bzrk
timestamp: Wed 2006-05-17 00:01:50 +1000
message:
Remove the border on the diff window, so that when maximized the scroll
bar sits on the right screen edge and is easier to hit.
modified:
diffwin.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2006-05-20 15:44:48 +0000
+++ b/__init__.py 2006-06-07 09:27:13 +0000
@@ -15,7 +15,195 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""GTK+ frontends to Bazaar commands """
-import viz
-import annotate
-import commit
-import gdiff
+from bzrlib.commands import Command, register_command, display_command
+from bzrlib.errors import NotVersionedError, BzrCommandError
+from bzrlib.commands import Command, register_command
+from bzrlib.option import Option
+from bzrlib.branch import Branch
+from bzrlib.workingtree import WorkingTree
+from bzrlib.bzrdir import BzrDir
+
+class cmd_gbranch(Command):
+ """GTK+ branching.
+
+ """
+
+ def run(self):
+ import pygtk
+ pygtk.require("2.0")
+ try:
+ import gtk
+ except RuntimeError, e:
+ if str(e) == "could not open display":
+ raise NoDisplayError
+
+ from clone import CloneDialog
+
+ window = CloneDialog()
+ if window.run() == gtk.RESPONSE_OK:
+ bzrdir = BzrDir.open(window.url)
+ bzrdir.sprout(window.dest_path)
+
+register_command(cmd_gbranch)
+
+class cmd_gdiff(Command):
+ """Show differences in working tree in a GTK+ Window.
+
+ Otherwise, all changes for the tree are listed.
+ """
+ takes_args = []
+ takes_options = []
+
+ @display_command
+ def run(self, revision=None, file_list=None):
+ tree1 = WorkingTree.open_containing(".")[0]
+ branch = tree1.branch
+ tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
+
+ from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
+ import gtk
+ window = DiffWindow()
+ window.connect("destroy", lambda w: gtk.main_quit())
+ window.set_diff("Working Tree", tree1, tree2)
+ window.show()
+
+ gtk.main()
+
+register_command(cmd_gdiff)
+
+class cmd_visualise(Command):
+ """Graphically visualise this branch.
+
+ Opens a graphical window to allow you to see the history of the branch
+ and relationships between revisions in a visual manner,
+
+ The default starting point is latest revision on the branch, you can
+ specify a starting point with -r revision.
+ """
+ takes_options = [
+ "revision",
+ Option('limit', "maximum number of revisions to display",
+ int, 'count')]
+ takes_args = [ "location?" ]
+ aliases = [ "visualize", "vis", "viz" ]
+
+ def run(self, location=".", revision=None, limit=None):
+ (branch, path) = Branch.open_containing(location)
+ branch.lock_read()
+ branch.repository.lock_read()
+ try:
+ if revision is None:
+ revid = branch.last_revision()
+ if revid is None:
+ return
+ else:
+ (revno, revid) = revision[0].in_history(branch)
+
+ from viz.bzrkapp import BzrkApp
+
+ app = BzrkApp()
+ app.show(branch, revid, limit)
+ finally:
+ branch.repository.unlock()
+ branch.unlock()
+ app.main()
+
+
+register_command(cmd_visualise)
+
+class cmd_gannotate(Command):
+ """GTK+ annotate.
+
+ Browse changes to FILENAME line by line in a GTK+ window.
+ """
+
+ takes_args = ["filename"]
+ takes_options = [
+ Option("all", help="show annotations on all lines"),
+ Option("plain", help="don't highlight annotation lines"),
+ Option("line", type=int, argname="lineno",
+ help="jump to specified line number")
+ ]
+ aliases = ["gblame", "gpraise"]
+
+ def run(self, filename, all=False, plain=False, line=1):
+ import pygtk
+ pygtk.require("2.0")
+
+ try:
+ import gtk
+ except RuntimeError, e:
+ if str(e) == "could not open display":
+ raise NoDisplayError
+
+ from annotate.gannotate import GAnnotateWindow
+ from annotate.config import GAnnotateConfig
+
+ (wt, path) = WorkingTree.open_containing(filename)
+ branch = wt.branch
+
+ file_id = wt.path2id(path)
+
+ if file_id is None:
+ raise NotVersionedError(filename)
+
+ window = GAnnotateWindow(all, plain)
+ window.connect("destroy", lambda w: gtk.main_quit())
+ window.set_title(path + " - gannotate")
+ config = GAnnotateConfig(window)
+ window.show()
+ branch.lock_read()
+ try:
+ window.annotate(branch, file_id)
+ finally:
+ branch.unlock()
+ window.jump_to_line(line)
+
+ gtk.main()
+
+register_command(cmd_gannotate)
+
+class cmd_gcommit(Command):
+ """GTK+ commit dialog
+
+ Graphical user interface for committing revisions"""
+
+ takes_args = []
+ takes_options = []
+
+ def run(self, filename=None):
+ import pygtk
+ pygtk.require("2.0")
+
+ try:
+ import gtk
+ except RuntimeError, e:
+ if str(e) == "could not open display":
+ raise NoDisplayError
+
+ from commit import GCommitDialog
+ from bzrlib.commit import Commit
+ from bzrlib.errors import (BzrCommandError, PointlessCommit, ConflictsInTree,
+ StrictCommitFailed)
+
+ (wt, path) = WorkingTree.open_containing(filename)
+ branch = wt.branch
+
+ file_id = wt.path2id(path)
+
+ if file_id is None:
+ raise NotVersionedError(filename)
+
+ dialog = GCommitDialog(wt)
+ dialog.set_title(path + " - Commit")
+ if dialog.run() != gtk.RESPONSE_CANCEL:
+ Commit().commit(working_tree=wt,message=dialog.message,
+ specific_files=dialog.specific_files)
+
+register_command(cmd_gcommit)
+
+class NoDisplayError(BzrCommandError):
+ """gtk could not find a proper display"""
+
+ def __str__(self):
+ return "No DISPLAY. gannotate is disabled."
=== modified file 'annotate/__init__.py'
--- a/annotate/__init__.py 2006-05-19 16:56:46 +0000
+++ b/annotate/__init__.py 2006-05-20 19:24:12 +0000
@@ -17,69 +17,3 @@
__version__ = "0.7pre"
__author__ = "Dan Loda <danloda at gmail.com>"
-from bzrlib.workingtree import WorkingTree
-from bzrlib.commands import Command, register_command
-from bzrlib.errors import NotVersionedError, BzrCommandError
-from bzrlib.option import Option
-
-
-class cmd_gannotate(Command):
- """GTK+ annotate.
-
- Browse changes to FILENAME line by line in a GTK+ window.
- """
-
- takes_args = ["filename"]
- takes_options = [
- Option("all", help="show annotations on all lines"),
- Option("plain", help="don't highlight annotation lines"),
- Option("line", type=int, argname="lineno",
- help="jump to specified line number")
- ]
- aliases = ["gblame", "gpraise"]
-
- def run(self, filename, all=False, plain=False, line=1):
- import pygtk
- pygtk.require("2.0")
-
- try:
- import gtk
- except RuntimeError, e:
- if str(e) == "could not open display":
- raise NoDisplayError
-
- from gannotate import GAnnotateWindow
- from config import GAnnotateConfig
-
- (wt, path) = WorkingTree.open_containing(filename)
- branch = wt.branch
-
- file_id = wt.path2id(path)
-
- if file_id is None:
- raise NotVersionedError(filename)
-
- window = GAnnotateWindow(all, plain)
- window.connect("destroy", lambda w: gtk.main_quit())
- window.set_title(path + " - gannotate")
- config = GAnnotateConfig(window)
- window.show()
- branch.lock_read()
- try:
- window.annotate(branch, file_id)
- finally:
- branch.unlock()
- window.jump_to_line(line)
-
- gtk.main()
-
-
-register_command(cmd_gannotate)
-
-
-class NoDisplayError(BzrCommandError):
- """gtk could not find a proper display"""
-
- def __str__(self):
- return "No DISPLAY. gannotate is disabled."
-
=== added file 'clone.py'
--- a/clone.py 1970-01-01 00:00:00 +0000
+++ b/clone.py 2006-05-20 19:47:46 +0000
@@ -0,0 +1,79 @@
+# Copyright (C) 2006 Jelmer Vernooij <jelmer at samba.org>
+
+# 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
+
+import pygtk
+pygtk.require("2.0")
+import gobject
+import gtk
+import pango
+from bzrlib.delta import compare_trees
+
+#FIXME: Allow specifying stop_revision
+#FIXME: Allow specifying target branch format
+#FIXME: Implement _Browse callback
+
+class CloneDialog(gtk.Dialog):
+ """ Branch (clone) Dialog """
+
+ def __init__(self, dest_path=None):
+ gtk.Dialog.__init__(self)
+
+ self.set_default_size(400, 200)
+
+ self._create()
+
+ if dest_path:
+ self.url_entry.set_text(dest_path)
+
+ def _get_url(self):
+ return self.url_entry.get_text()
+
+ def _get_dest_path(self):
+ return self.path_entry.get_text()
+
+ dest_path = property(_get_dest_path)
+ url = property(_get_url)
+
+ def _browse_cb(self, *args):
+ #FIXME
+ pass
+
+ def _create(self):
+ frame = gtk.Frame(label="Branch URL")
+ self.vbox.pack_start(frame, fill=True)
+ self.url_entry = gtk.Entry()
+ frame.add(self.url_entry)
+ frame.show_all()
+
+ frame = gtk.Frame(label="Destination Path")
+ self.vbox.pack_start(frame, fill=True)
+ hbox = gtk.HBox()
+ self.path_entry = gtk.Entry()
+ hbox.add(self.path_entry)
+ hbox.add(gtk.Button(label="_Browse"))
+ frame.add(hbox)
+ frame.show_all()
+
+ frame = gtk.Frame(label="Options")
+ self.vbox.pack_start(frame)
+ vbox = gtk.VBox()
+ self.lightweight_button = gtk.CheckButton(label="Lightweight")
+ vbox.add(self.lightweight_button)
+ frame.add(vbox)
+ frame.show_all()
+
+ self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, "_Get", gtk.RESPONSE_OK)
+
=== removed directory 'commit'
=== renamed file 'commit/gcommit.py' => 'commit.py'
=== removed file 'commit/__init__.py'
--- a/commit/__init__.py 2006-05-20 15:44:48 +0000
+++ b/commit/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
-# Copyright (C) 2006 Jelmer Vernooij <jelmer at samba.org>
-
-# 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
-
-__version__ = "0.8"
-__author__ = "Jelmer Vernooij <jelmer at samba.org>"
-
-from bzrlib.workingtree import WorkingTree
-from bzrlib.commands import Command, register_command
-from bzrlib.commit import Commit
-from bzrlib.errors import (BzrCommandError, PointlessCommit, ConflictsInTree,
- StrictCommitFailed)
-
-class cmd_gcommit(Command):
- """GTK+ commit dialog
-
- Graphical user interface for committing revisions"""
-
- takes_args = []
- takes_options = []
-
- def run(self, filename=None):
- import pygtk
- pygtk.require("2.0")
-
- try:
- import gtk
- except RuntimeError, e:
- if str(e) == "could not open display":
- raise NoDisplayError
-
- from gcommit import GCommitDialog
-
- (wt, path) = WorkingTree.open_containing(filename)
- branch = wt.branch
-
- file_id = wt.path2id(path)
-
- if file_id is None:
- raise NotVersionedError(filename)
-
- dialog = GCommitDialog(wt)
- dialog.set_title(path + " - Commit")
- if dialog.run() != gtk.RESPONSE_CANCEL:
- Commit().commit(working_tree=wt,message=dialog.message,
- specific_files=dialog.specific_files)
-
-register_command(cmd_gcommit)
=== removed file 'gdiff.py'
--- a/gdiff.py 2006-06-06 17:46:40 +0000
+++ b/gdiff.py 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-# 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
-
-from bzrlib.commands import Command, register_command, display_command
-from bzrlib.bzrdir import BzrDir
-from bzrlib.workingtree import WorkingTree
-
-
-class cmd_gdiff(Command):
- """Show differences in working tree in a GTK+ Window.
-
- Otherwise, all changes for the tree are listed.
- """
- takes_args = []
- takes_options = []
-
- @display_command
- def run(self, revision=None, file_list=None):
- tree1 = WorkingTree.open_containing(".")[0]
- branch = tree1.branch
- tree2 = tree1.branch.repository.revision_tree(branch.last_revision())
-
- from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
- import gtk
- window = DiffWindow()
- window.connect("destroy", lambda w: gtk.main_quit())
- window.set_diff("Working Tree", tree1, tree2)
- window.show()
-
- gtk.main()
-
-register_command(cmd_gdiff)
=== modified file 'viz/__init__.py'
--- a/viz/__init__.py 2006-05-19 16:37:13 +0000
+++ b/viz/__init__.py 2006-05-20 19:24:12 +0000
@@ -15,48 +15,3 @@
__copyright__ = "Copyright ? 2005 Canonical Ltd."
__author__ = "Scott James Remnant <scott at ubuntu.com>"
-
-from bzrlib.commands import Command, register_command
-from bzrlib.option import Option
-from bzrlib.branch import Branch
-
-
-class cmd_visualise(Command):
- """Graphically visualise this branch.
-
- Opens a graphical window to allow you to see the history of the branch
- and relationships between revisions in a visual manner,
-
- The default starting point is latest revision on the branch, you can
- specify a starting point with -r revision.
- """
- takes_options = [
- "revision",
- Option('limit', "maximum number of revisions to display",
- int, 'count')]
- takes_args = [ "location?" ]
- aliases = [ "visualize", "vis", "viz" ]
-
- def run(self, location=".", revision=None, limit=None):
- (branch, path) = Branch.open_containing(location)
- branch.lock_read()
- branch.repository.lock_read()
- try:
- if revision is None:
- revid = branch.last_revision()
- if revid is None:
- return
- else:
- (revno, revid) = revision[0].in_history(branch)
-
- from bzrkapp import BzrkApp
-
- app = BzrkApp()
- app.show(branch, revid, limit)
- finally:
- branch.repository.unlock()
- branch.unlock()
- app.main()
-
-
-register_command(cmd_visualise)
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py 2006-05-19 16:37:13 +0000
+++ b/viz/branchwin.py 2006-06-07 09:06:10 +0000
@@ -346,17 +346,6 @@
image = gtk.Image()
image.set_from_stock(
- gtk.STOCK_JUMP_TO, gtk.ICON_SIZE_SMALL_TOOLBAR)
- image.show()
-
- button = gtk.Button()
- button.add(image)
- button.connect("clicked", self._go_clicked_cb, parent_id)
- hbox.pack_start(button, expand=False, fill=True)
- button.show()
-
- image = gtk.Image()
- image.set_from_stock(
gtk.STOCK_FIND, gtk.ICON_SIZE_SMALL_TOOLBAR)
image.show()
@@ -368,10 +357,10 @@
hbox.pack_start(button, expand=False, fill=True)
button.show()
- label = gtk.Label(parent_id)
- label.set_selectable(True)
- hbox.pack_start(label, expand=False, fill=True)
- label.show()
+ button = gtk.Button(parent_id)
+ button.connect("clicked", self._go_clicked_cb, parent_id)
+ hbox.pack_start(button, expand=False, fill=True)
+ button.show()
def _back_clicked_cb(self, *args):
=== modified file 'viz/diffwin.py'
--- a/viz/diffwin.py 2006-05-19 18:59:23 +0000
+++ b/viz/diffwin.py 2006-06-07 09:06:10 +0000
@@ -49,7 +49,7 @@
def construct(self):
"""Construct the window contents."""
hbox = gtk.HBox(spacing=6)
- hbox.set_border_width(12)
+ hbox.set_border_width(0)
self.add(hbox)
hbox.show()
More information about the Pkg-bazaar-commits
mailing list