[Pkg-bazaar-commits] ./bzr-gtk/unstable r172: Merge upstream

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:49:04 UTC 2009


------------------------------------------------------------
revno: 172
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
  annotate/gannotate.py
  olive/__init__.py
  tests/test_tortoise_bzr.py
    ------------------------------------------------------------
    revno: 170.1.1
    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:
      tests/test_tortoise_bzr.py
    ------------------------------------------------------------
    revno: 170.1.2
    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.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 170.1.3
    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)
    modified:
      olive/__init__.py
        ------------------------------------------------------------
        revno: 126.1.35
        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.
        modified:
          olive/__init__.py
          tests/test_preferences.py
        ------------------------------------------------------------
        revno: 126.1.36
        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.
        added:
          tests/test_tortoise_bzr.py
          tortoise-bzr.py
        modified:
          README
          TODO
          __init__.py
          commit.py
          nautilus-bzr.py
          tests/__init__.py
          tests/test_history.py
          tests/test_preferences.py
        ------------------------------------------------------------
        revno: 126.1.37
        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.
        modified:
          olive/__init__.py
          tests/test_preferences.py
        ------------------------------------------------------------
        revno: 126.1.38
        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.
        modified:
          tests/test_tortoise_bzr.py
        ------------------------------------------------------------
        revno: 126.1.39
        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)
        modified:
          olive/__init__.py
        ------------------------------------------------------------
        revno: 126.1.40
        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.
        modified:
          __init__.py
    ------------------------------------------------------------
    revno: 170.1.4
    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
    modified:
      annotate/gannotate.py
    ------------------------------------------------------------
    revno: 170.1.5
    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
    modified:
      annotate/gannotate.py
-------------- next part --------------
=== 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 Pkg-bazaar-commits mailing list