Rev 172: Merge upstream in file:///home/jelmer/bzr-gtk/trunk/

Jelmer Vernooij jelmer at samba.org
Mon Mar 19 15:57:33 GMT 2007


At file:///home/jelmer/bzr-gtk/trunk/

------------------------------------------------------------
revno: 172
revision-id: jelmer at samba.org-20070317235803-fyaw65t8ika939s1
parent: jelmer at samba.org-20070313164848-x8j21t8u7ege6ml0
parent: aaron.bentley at utoronto.ca-20070317231321-1ougi4ktyqpbvmoh
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2007-03-18 00:58:03 +0100
message:
  Merge upstream
modified:
  __init__.py                    __init__.py-20060519165329-a1fd52c8a829fcd5
  annotate/gannotate.py          xannotate.py-20051024072750-fe35acd6bb909bd3
  olive/__init__.py              __init__.py-20060925014013-13wdvwl8vi8gfqi1-2
  tests/test_tortoise_bzr.py     test_tortoise_bzr.py-20070309174337-jc3vnh48k92dhzzk-1
    ------------------------------------------------------------
    revno: 170.1.5
    merged: aaron.bentley at utoronto.ca-20070317231321-1ougi4ktyqpbvmoh
    parent: aaron.bentley at utoronto.ca-20070317213437-0mwqbejd0inho0wi
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: bzr-gtk-meld
    timestamp: Sat 2007-03-17 19:13:21 -0400
    message:
      Add 'forward' button, much button cleanup
    ------------------------------------------------------------
    revno: 170.1.4
    merged: aaron.bentley at utoronto.ca-20070317213437-0mwqbejd0inho0wi
    parent: szilveszter.farkas at gmail.com-20070316193728-rsbbuv65k57s90do
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: bzr-gtk-meld
    timestamp: Sat 2007-03-17 17:34:37 -0400
    message:
      Move search fields directly below source window
    ------------------------------------------------------------
    revno: 170.1.3
    merged: szilveszter.farkas at gmail.com-20070316193728-rsbbuv65k57s90do
    parent: abentley at panoramicfeedback.com-20070316155457-wjkxdcci05j1atk3
    parent: szilveszter.farkas at gmail.com-20070316193607-ldfurhg0579yx062
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: trunk
    timestamp: Fri 2007-03-16 20:37:28 +0100
    message:
      Fix the locking issue with Olive (LP: #91522)
        ------------------------------------------------------------
        revno: 126.1.40
        merged: szilveszter.farkas at gmail.com-20070316193607-ldfurhg0579yx062
        parent: szilveszter.farkas at gmail.com-20070315165415-n7yhaqonn1k40met
        parent: abentley at panoramicfeedback.com-20070316155457-wjkxdcci05j1atk3
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Fri 2007-03-16 20:36:07 +0100
        message:
          Merge from trunk.
        ------------------------------------------------------------
        revno: 126.1.39
        merged: szilveszter.farkas at gmail.com-20070315165415-n7yhaqonn1k40met
        parent: szilveszter.farkas at gmail.com-20070315162324-l8o7tvxd59mmbsws
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Thu 2007-03-15 17:54:15 +0100
        message:
          Fix the locking issue with Olive (LP: #91522)
        ------------------------------------------------------------
        revno: 126.1.38
        merged: szilveszter.farkas at gmail.com-20070315162324-l8o7tvxd59mmbsws
        parent: szilveszter.farkas at gmail.com-20070315162315-rs1sbxjh31n314zc
        parent: szilveszter.farkas at gmail.com-20070315124348-0nx0zb7fv4pa8xk6
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Thu 2007-03-15 17:23:24 +0100
        message:
          Merge from trunk.
        ------------------------------------------------------------
        revno: 126.1.37
        merged: szilveszter.farkas at gmail.com-20070315162315-rs1sbxjh31n314zc
        parent: szilveszter.farkas at gmail.com-20070310171644-83yc6fd8ique6scx
        parent: jelmer at samba.org-20070313113834-vxkz3l62u6ubkvcc
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Thu 2007-03-15 17:23:15 +0100
        message:
          Merge from trunk.
        ------------------------------------------------------------
        revno: 126.1.36
        merged: szilveszter.farkas at gmail.com-20070310171644-83yc6fd8ique6scx
        parent: szilveszter.farkas at gmail.com-20070303133451-r6m6ibw55bkm29f0
        parent: jelmer at samba.org-20070309190506-f168z6k43zk3gf4c
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Sat 2007-03-10 18:16:44 +0100
        message:
          Merge from trunk.
        ------------------------------------------------------------
        revno: 126.1.35
        merged: szilveszter.farkas at gmail.com-20070303133451-r6m6ibw55bkm29f0
        parent: szilveszter.farkas at gmail.com-20070302160256-3ogad8cnunmq2h2f
        committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
        branch nick: bzr-gtk
        timestamp: Sat 2007-03-03 14:34:51 +0100
        message:
          Make test suite not fail if Olive was run before.
    ------------------------------------------------------------
    revno: 170.1.2
    merged: abentley at panoramicfeedback.com-20070316155457-wjkxdcci05j1atk3
    parent: szilveszter.farkas at gmail.com-20070315124348-0nx0zb7fv4pa8xk6
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: gtk
    timestamp: Fri 2007-03-16 11:54:57 -0400
    message:
      Test suite only fixes encoding if it's changed.  Fixes test_selftest bug.
    ------------------------------------------------------------
    revno: 170.1.1
    merged: szilveszter.farkas at gmail.com-20070315124348-0nx0zb7fv4pa8xk6
    parent: jelmer at samba.org-20070313113834-vxkz3l62u6ubkvcc
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: trunk
    timestamp: Thu 2007-03-15 13:43:48 +0100
    message:
      Fix the indentation error in the TortoiseBZR test.
=== modified file '__init__.py'
--- a/__init__.py	2007-03-13 16:48:48 +0000
+++ b/__init__.py	2007-03-17 23:58:03 +0000
@@ -461,6 +461,7 @@
         result = TestSuite()
         result.addTest(tests.test_suite())
     finally:
-        reload(sys)
-        sys.setdefaultencoding(default_encoding)
+        if sys.getdefaultencoding() != default_encoding:
+            reload(sys)
+            sys.setdefaultencoding(default_encoding)
     return result

=== modified file 'annotate/gannotate.py'
--- a/annotate/gannotate.py	2007-02-15 19:07:43 +0000
+++ b/annotate/gannotate.py	2007-03-17 23:13:21 +0000
@@ -55,6 +55,7 @@
 
         self._create()
         self.revisions = {}
+        self.history = []
 
     def annotate(self, tree, branch, file_id):
         self.annotations = []
@@ -177,11 +178,13 @@
             return None
         return self.annomodel[path][REVISION_ID_COL]
 
-    def _show_log(self, w):
+    def _activate_selected_revision(self, w):
         rev_id = self._selected_revision()
         if rev_id is None:
             return
-        self.logview.set_revision(self.revisions[rev_id])
+        selected = self.revisions[rev_id]
+        self.logview.set_revision(selected)
+        self.back_button.set_sensitive(len(selected.parent_ids) != 0)
 
     def _create(self):
         self.logview = self._create_log_view()
@@ -197,15 +200,19 @@
         sw.add(self.annoview)
         self.annoview.gwindow = self
         sw.show()
+
+        swbox = gtk.VBox()
+        swbox.pack_start(sw)
+        swbox.show()
         
         self.pane = pane = gtk.VPaned()
-        pane.add1(sw)
+        pane.add1(swbox)
         pane.add2(self.logview)
         pane.show()
         vbox.pack_start(pane, expand=True, fill=True)
 
         self._search = SearchBox()
-        vbox.pack_start(self._search, expand=False, fill=True)
+        swbox.pack_start(self._search, expand=False, fill=True)
         accels = gtk.AccelGroup()
         accels.connect_group(gtk.keysyms.f, gtk.gdk.CONTROL_MASK,
                              gtk.ACCEL_LOCKED,
@@ -215,8 +222,11 @@
                              self._search_by_line)
         self.add_accel_group(accels)
 
-        hbox = gtk.HBox(True, 6)
-        hbox.pack_start(self._create_prev_button(), expand=False, fill=True)
+        hbox = gtk.HBox(False, 6)
+        self.back_button = self._create_back_button()
+        hbox.pack_start(self.back_button, expand=False, fill=True)
+        self.forward_button = self._create_forward_button()
+        hbox.pack_start(self.forward_button, expand=False, fill=True)
         hbox.pack_end(self._create_button_box(), expand=False, fill=True)
         hbox.show()
         vbox.pack_start(hbox, expand=False, fill=True)
@@ -254,7 +264,7 @@
     def _create_annotate_view(self):
         tv = gtk.TreeView()
         tv.set_rules_hint(False)
-        tv.connect("cursor-changed", self._show_log)
+        tv.connect("cursor-changed", self._activate_selected_revision)
         tv.show()
         tv.connect("row-activated", self.row_diff)
 
@@ -315,42 +325,56 @@
         return lv
 
     def _create_button_box(self):
-        box = gtk.HButtonBox()
-        box.set_layout(gtk.BUTTONBOX_END)
-        box.show()
-
         button = gtk.Button()
         button.set_use_stock(True)
         button.set_label("gtk-close")
         button.connect("clicked", lambda w: self.destroy())
         button.show()
-
-        box.pack_start(button, expand=False, fill=False)
-
-        return box
-
-    def _create_prev_button(self):
-        box = gtk.HButtonBox()
-        box.set_layout(gtk.BUTTONBOX_START)
-        box.show()
-        
+        return button
+
+    def _create_back_button(self):
         button = gtk.Button()
         button.set_use_stock(True)
         button.set_label("gtk-go-back")
         button.connect("clicked", lambda w: self.go_back())
         button.show()
-        box.pack_start(button, expand=False, fill=False)
-        return box
+        return button
+
+    def _create_forward_button(self):
+        button = gtk.Button()
+        button.set_use_stock(True)
+        button.set_label("gtk-go-forward")
+        button.connect("clicked", lambda w: self.go_forward())
+        button.show()
+        button.set_sensitive(False)
+        return button
 
     def go_back(self):
+        self.history.append(self.tree)
+        self.forward_button.set_sensitive(True)
         rev_id = self._selected_revision()
         parent_id = self.revisions[rev_id].parent_ids[0]
-        tree = self.branch.repository.revision_tree(parent_id)
-        if self.file_id in tree:
-            offset = self.get_scroll_offset(tree)
+        target_tree = self.branch.repository.revision_tree(parent_id)
+        self._go(target_tree)
+
+    def go_forward(self):
+        if len(self.history) == 0:
+            return
+        target_tree = self.history.pop()
+        if len(self.history) == 0:
+            self.forward_button.set_sensitive(False)
+        self._go(target_tree)
+
+    def _go(self, target_tree):
+        rev_id = self._selected_revision()
+        if self.file_id in target_tree:
+            offset = self.get_scroll_offset(target_tree)
             (row,), col = self.annoview.get_cursor()
-            self.annotate(tree, self.branch, self.file_id)
-            self.annoview.set_cursor(row+offset)
+            self.annotate(target_tree, self.branch, self.file_id)
+            new_row = row+offset
+            if new_row < 0:
+                new_row = 0
+            self.annoview.set_cursor(new_row)
 
     def get_scroll_offset(self, tree):
         old = self.tree.get_file(self.file_id)

=== modified file 'olive/__init__.py'
--- a/olive/__init__.py	2007-03-13 11:38:34 +0000
+++ b/olive/__init__.py	2007-03-15 16:54:15 +0000
@@ -638,24 +638,29 @@
             if not self.notbranch:
                 filename = self.wt.relpath(self.path + os.sep + item)
                 
-                for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
-                    if rpathnew == filename:
-                        status = 'renamed'
-                for rpath, id, kind in delta.added:
-                    if rpath == filename:
-                        status = 'added'
-                for rpath, id, kind in delta.removed:
-                    if rpath == filename:
-                        status = 'removed'
-                for rpath, id, kind, text_modified, meta_modified in delta.modified:
-                    if rpath == filename:
-                        status = 'modified'
-                for rpath, id, kind in delta.unchanged:
-                    if rpath == filename:
-                        status = 'unchanged'
-                for rpath, file_class, kind, id, entry in self.wt.list_files():
-                    if rpath == filename and file_class == 'I':
-                        status = 'ignored'
+                try:
+                    self.wt.lock_read()
+                    
+                    for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
+                        if rpathnew == filename:
+                            status = 'renamed'
+                    for rpath, id, kind in delta.added:
+                        if rpath == filename:
+                            status = 'added'
+                    for rpath, id, kind in delta.removed:
+                        if rpath == filename:
+                            status = 'removed'
+                    for rpath, id, kind, text_modified, meta_modified in delta.modified:
+                        if rpath == filename:
+                            status = 'modified'
+                    for rpath, id, kind in delta.unchanged:
+                        if rpath == filename:
+                            status = 'unchanged'
+                    for rpath, file_class, kind, id, entry in self.wt.list_files():
+                        if rpath == filename and file_class == 'I':
+                            status = 'ignored'
+                finally:
+                    self.wt.unlock()
             
             #try:
             #    status = fileops.status(path + os.sep + item)
@@ -834,24 +839,29 @@
             if not notbranch:
                 filename = tree1.relpath(path + os.sep + item)
                 
-                for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
-                    if rpathnew == filename:
-                        status = 'renamed'
-                for rpath, id, kind in delta.added:
-                    if rpath == filename:
-                        status = 'added'                
-                for rpath, id, kind in delta.removed:
-                    if rpath == filename:
-                        status = 'removed'
-                for rpath, id, kind, text_modified, meta_modified in delta.modified:
-                    if rpath == filename:
-                        status = 'modified'
-                for rpath, id, kind in delta.unchanged:
-                    if rpath == filename:
-                        status = 'unchanged'
-                for rpath, file_class, kind, id, entry in self.wt.list_files():
-                    if rpath == filename and file_class == 'I':
-                        status = 'ignored'
+                try:
+                    self.wt.lock_read()
+                    
+                    for rpath, rpathnew, id, kind, text_modified, meta_modified in delta.renamed:
+                        if rpathnew == filename:
+                            status = 'renamed'
+                    for rpath, id, kind in delta.added:
+                        if rpath == filename:
+                            status = 'added'                
+                    for rpath, id, kind in delta.removed:
+                        if rpath == filename:
+                            status = 'removed'
+                    for rpath, id, kind, text_modified, meta_modified in delta.modified:
+                        if rpath == filename:
+                            status = 'modified'
+                    for rpath, id, kind in delta.unchanged:
+                        if rpath == filename:
+                            status = 'unchanged'
+                    for rpath, file_class, kind, id, entry in self.wt.list_files():
+                        if rpath == filename and file_class == 'I':
+                            status = 'ignored'
+                finally:
+                    self.wt.unlock()
             
             #try:
             #    status = fileops.status(path + os.sep + item)

=== modified file 'tests/test_tortoise_bzr.py'
--- a/tests/test_tortoise_bzr.py	2007-03-09 19:05:06 +0000
+++ b/tests/test_tortoise_bzr.py	2007-03-15 12:43:48 +0000
@@ -22,7 +22,7 @@
 class TestsShellExtension(TestCaseInTempDir):
     def setUp(self):
         super(TestsUrlHistory, self).setUp()
-		self.ext = client.Dispatch("Bazaar.ShellExtension.ContextMenu")
+        self.ext = client.Dispatch("Bazaar.ShellExtension.ContextMenu")
 
-	def test_get_command_string(self):
-		self.assertEqual(u"Hello from Python!!", self.ext.GetCommandString(1,1))
+    def test_get_command_string(self):
+        self.assertEqual(u"Hello from Python!!", self.ext.GetCommandString(1,1))




More information about the bazaar-commits mailing list