[Pkg-bazaar-commits] ./bzr-gtk/unstable r637: * New upstream snapshot.

Jelmer Vernooij jelmer at samba.org
Wed May 20 16:26:02 UTC 2009


------------------------------------------------------------
revno: 637
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: unstable
timestamp: Wed 2009-05-20 18:26:02 +0200
message:
  * New upstream snapshot.
   + Fixes compatibility with Bazaar 1.15.
  * Bump standards version to 3.8.1.
added:
  tests/test_annotate_config.py
modified:
  NEWS
  __init__.py
  annotate/config.py
  annotate/gannotate.py
  debian/changelog
  debian/control
  nautilus-bzr.py
  olive/__init__.py
  olive/menu.py
  push.py
  tests/__init__.py
  viz/branchwin.py
    ------------------------------------------------------------
    revno: 621.7.2
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Fri 2009-04-10 03:35:07 +0200
    message:
      Use NULL_REVISION rather than None.
    modified:
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 621.7.3
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2009-04-22 00:00:10 +0200
    message:
      merge trunk.
    added:
      commands.py
    modified:
      NEWS
      __init__.py
      bzr-notify
    ------------------------------------------------------------
    revno: 621.7.4
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Mon 2009-05-04 19:15:09 +0200
    message:
      Use new transport.create_prefix.
    modified:
      push.py
    ------------------------------------------------------------
    revno: 621.7.5
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Mon 2009-05-04 22:06:58 +0200
    message:
      Use _get_nick(local=True) rather than .nick to get at a branches' nick, since 
      the previous might check the nickname of the master branch, which will be slow.
    modified:
      annotate/gannotate.py
      nautilus-bzr.py
      olive/__init__.py
      olive/menu.py
      viz/branchwin.py
    ------------------------------------------------------------
    revno: 621.7.6
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Wed 2009-05-06 13:51:38 +0200
    message:
      Upgrade COMPATIBLE_BZR_VERSIONS
    modified:
      __init__.py
        ------------------------------------------------------------
        revno: 621.9.1
        committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
        branch nick: gtk
        timestamp: Mon 2009-05-04 08:58:46 +0200
        message:
          Use public API for create_prefix.
          
          * push.py:
          (do_push): Call create_prefix on transport.
        modified:
          push.py
        ------------------------------------------------------------
        revno: 621.9.2
        committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
        branch nick: gtk
        timestamp: Mon 2009-05-04 09:01:58 +0200
        message:
          Upgrade COMPATIBLE_BZR_VERSIONS.
          
          * __init__.py: 
          (COMPATIBLE_BZR_VERSIONS): Add 1.15.0.
        modified:
          __init__.py
    ------------------------------------------------------------
    revno: 621.7.7
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Thu 2009-05-07 11:41:56 +0200
    message:
      Upgrade to the new loading tests API.
      
      * tests/__init__.py:
      (load_tests): Upgrade to the new loading tests API.
      
      * __init__.py:
      (load_tests): Upgrade to the new loading tests API.
    modified:
      __init__.py
      tests/__init__.py
    ------------------------------------------------------------
    revno: 621.7.8
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Thu 2009-05-07 11:54:50 +0200
    message:
      Reproduce bug #373157 root cause.
      
      * tests/test_annotate_config.py: 
      Reproduce bug #373157.
      
      * tests/__init__.py:
      (load_tests): Add test_annotate_config.
    added:
      tests/test_annotate_config.py
    modified:
      tests/__init__.py
    ------------------------------------------------------------
    revno: 621.7.9
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Thu 2009-05-07 13:48:03 +0200
    message:
      Fix bug #373157 by properly setting the default values.
      
      * tests/test_annotate_config.py:
      (TestConfig.test_create_initial_config): Urgh, remove pdb breakpoint.
      
      * annotate/config.py:
      (gannotate_configspec): Deleted, can't be used for default values
      and not used for validation: useless.
      (gannotate_config_filename): Turned into a function so that tests
      get proper isolated result (evaluating the path at load time
      forbids the test framework overriding).
      (GAnnotateConfig.__init__): Add default values *only* if the
      'window' section doesn't exist. Assigning them unconditionally
      defeats the config file purpose... Also delete the 'spans' section
      since nobody use it.
      (GAnnotateConfig.apply): Coerce config values when we use them.
      (Gannotateconfig._save_custom_spans): Deleted (dead code).
    modified:
      annotate/config.py
      tests/test_annotate_config.py
    ------------------------------------------------------------
    revno: 621.7.10
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: trunk
    timestamp: Mon 2009-05-11 15:46:33 +0200
    message:
      Add NEWS entry
    modified:
      NEWS
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2009-02-27 19:07:13 +0000
+++ b/NEWS	2009-05-11 13:46:33 +0000
@@ -12,6 +12,8 @@
 
   * Fix Olive homepage URL. (#255152)
 
+  * Fix gannotate.conf handling. (Vincent Ladeuil, #373157)
+
   * Mark as compatible with bzr 1.13.
 
 0.95.0	2008-08-04

=== modified file '__init__.py'
--- a/__init__.py	2009-02-27 01:28:30 +0000
+++ b/__init__.py	2009-05-07 09:41:56 +0000
@@ -50,7 +50,8 @@
 __version__ = version_string
 
 COMPATIBLE_BZR_VERSIONS = [(1, 6, 0), (1, 7, 0), (1, 8, 0), (1, 9, 0),
-                           (1, 10, 0), (1, 11, 0), (1, 12, 0), (1, 13, 0)]
+                           (1, 10, 0), (1, 11, 0), (1, 12, 0), (1, 13, 0),
+                           (1, 15, 0),]
 
 bzrlib.api.require_any_api(bzrlib, COMPATIBLE_BZR_VERSIONS)
 
@@ -101,21 +102,21 @@
             raise NoDisplayError
     set_ui_factory()
     return gtk
- 
+
 
 commands = {
     "gannotate": ["gblame", "gpraise"],
     "gbranch": [],
-    "gcheckout": [], 
-    "gcommit": ["gci"], 
-    "gconflicts": [], 
+    "gcheckout": [],
+    "gcommit": ["gci"],
+    "gconflicts": [],
     "gdiff": [],
     "ginit": [],
     "ginfo": [],
     "gmerge": [],
-    "gmissing": [], 
-    "gpreferences": [], 
-    "gpush": [], 
+    "gmissing": [],
+    "gpreferences": [],
+    "gpush": [],
     "gselftest": [],
     "gsend": [],
     "gstatus": ["gst"],
@@ -131,7 +132,8 @@
     commands["gloom"] = []
 
 for cmd, aliases in commands.iteritems():
-    plugin_cmds.register_lazy("cmd_%s" % cmd, aliases, "bzrlib.plugins.gtk.commands")
+    plugin_cmds.register_lazy("cmd_%s" % cmd, aliases,
+                              "bzrlib.plugins.gtk.commands")
 
 
 import gettext
@@ -148,20 +150,22 @@
         return "No DISPLAY. Unable to run GTK+ application."
 
 
-def test_suite():
-    from unittest import TestSuite
-    import tests
+def load_tests(basic_tests, module, loader):
+    testmod_names = [
+        'tests',
+        ]
     import sys
     default_encoding = sys.getdefaultencoding()
     try:
-        result = TestSuite()
+        result = basic_tests
         try:
             import_pygtk()
         except errors.BzrCommandError:
-            return result
-        result.addTest(tests.test_suite())
+            return basic_tests
+        basic_tests.addTest(loader.loadTestsFromModuleNames(
+                ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
     finally:
         if sys.getdefaultencoding() != default_encoding:
             reload(sys)
             sys.setdefaultencoding(default_encoding)
-    return result
+    return basic_tests

=== modified file 'annotate/config.py'
--- a/annotate/config.py	2007-01-17 06:42:55 +0000
+++ b/annotate/config.py	2009-05-07 11:48:03 +0000
@@ -18,24 +18,12 @@
 
 import gtk.gdk
 
-from bzrlib.config import config_dir
+from bzrlib import config
 import bzrlib.util.configobj.configobj as configobj
 
 
-gannotate_configspec = (
-    "[window]",
-    "width = integer(default=750)",
-    "height = integer(default=550)",
-    "maximized = boolean(default=False)",
-    "x = integer(default=0)",
-    "y = integer(default=0)",
-    "pane_position = integer(default=325)",
-    "[spans]",
-    "max_custom_spans = integer(default=4)",
-    "custom_spans = float_list()"
-)
-
-gannotate_config_filename = os.path.join(config_dir(), "gannotate.conf")
+def gannotate_config_filename():
+    return os.path.join(config.config_dir(), "gannotate.conf")
 
 
 class GAnnotateConfig(configobj.ConfigObj):
@@ -47,20 +35,20 @@
     """
 
     def __init__(self, window):
-        configobj.ConfigObj.__init__(self, gannotate_config_filename,
-                                     configspec=gannotate_configspec)
+        configobj.ConfigObj.__init__(self, gannotate_config_filename())
         self.window = window
         self.pane = window.pane
-        
-        self.initial_comment = ["gannotate plugin configuration"]
-        self['window']['width'] = 750
-        self['window']['height'] = 550
-        self['window']['maximized'] = False
-        self['window']['x'] = 0
-        self['window']['y'] = 0
-        self['window']['pane_position'] = 325
-        self['spans']['max_custom_spans'] = 4
-        self['spans']['custom_spans'] = []
+
+        if 'window' not in self:
+            # Set default values, configobj expects strings here
+            self.initial_comment = ["gannotate plugin configuration"]
+            self['window'] = {}
+            self['window']['width'] = '750'
+            self['window']['height'] = '550'
+            self['window']['maximized'] = 'False'
+            self['window']['x'] = '0'
+            self['window']['y'] = '0'
+            self['window']['pane_position'] = '325'
 
         self.apply()
         self._connect_signals()
@@ -68,16 +56,14 @@
     def apply(self):
         """Apply properties and such from gannotate.conf, or
         gannotate_configspec defaults."""
-        self.pane.set_position(self["window"]["pane_position"])
-        self.window.set_default_size(self["window"]["width"],
-                                     self["window"]["height"])
-        self.window.move(self["window"]["x"], self["window"]["y"])
+        self.pane.set_position(self['window'].as_int('pane_position'))
+        self.window.set_default_size(self['window'].as_int('width'),
+                                     self['window'].as_int('height'))
+        self.window.move(self['window'].as_int('x'), self['window'].as_int('y'))
 
-        if self["window"]["maximized"]:
+        if self['window'].as_bool('maximized'):
             self.window.maximize()
 
-        # XXX Don't know how to set an empty list as default in
-        # gannotate_configspec.
     def _connect_signals(self):
         self.window.connect("destroy", self._write)
         self.window.connect("configure-event", self._save_window_props)
@@ -91,9 +77,7 @@
             self["window"]["width"], self["window"]["height"] = w.get_size()
             self["window"]["x"], self["window"]["y"] = w.get_position()
             maximized = False
-
         self["window"]["maximized"] = maximized
-        
         return False
 
     def _save_pane_props(self, w, gparam):
@@ -102,11 +86,6 @@
 
         return False
 
-    def _save_custom_spans(self, w, *args):
-        self["spans"]["custom_spans"] = w.custom_spans
-
-        return False
-
     def _write(self, *args):
         self.write()
 

=== modified file 'annotate/gannotate.py'
--- a/annotate/gannotate.py	2008-04-29 08:17:01 +0000
+++ b/annotate/gannotate.py	2009-05-04 20:06:58 +0000
@@ -139,7 +139,7 @@
         current_revision.timestamp = time.time()
         current_revision.message = '[Not yet committed]'
         current_revision.parent_ids = tree.get_parent_ids()
-        current_revision.properties['branch-nick'] = self.branch.nick
+        current_revision.properties['branch-nick'] = self.branch._get_nick(local=True)
         current_revno = '%d?' % (self.branch.revno() + 1)
         repository = self.branch.repository
         if self.revision_id == CURRENT_REVISION:

=== modified file 'debian/changelog'
--- a/debian/changelog	2009-03-10 14:07:00 +0000
+++ b/debian/changelog	2009-05-20 16:26:02 +0000
@@ -1,3 +1,11 @@
+bzr-gtk (0.95.0+bzr635-1) unstable; urgency=low
+
+  * New upstream snapshot.
+   + Fixes compatibility with Bazaar 1.15.
+  * Bump standards version to 3.8.1.
+
+ -- Jelmer Vernooij <jelmer at debian.org>  Wed, 20 May 2009 18:25:51 +0200
+
 bzr-gtk (0.95.0+bzr631-1) unstable; urgency=low
 
   * New upstream snapshot.

=== modified file 'debian/control'
--- a/debian/control	2009-02-27 17:29:08 +0000
+++ b/debian/control	2009-05-20 16:26:02 +0000
@@ -5,7 +5,7 @@
 Uploaders: Jelmer Vernooij <jelmer at debian.org>
 Build-Depends-Indep: bzr (>= 1.6~)
 Build-Depends: python-central (>= 0.5), cdbs (>= 0.4.43), python, debhelper (>= 5.0.37.2), bzr-stats, python-nautilus (>= 0.5.0)
-Standards-Version: 3.8.0
+Standards-Version: 3.8.1
 Homepage: http://bazaar-vcs.org/bzr-gtk
 XS-Python-Version: >= 2.4
 Vcs-Bzr: http://bzr.debian.org/pkg-bazaar/bzr-gtk/unstable

=== modified file 'nautilus-bzr.py'
--- a/nautilus-bzr.py	2008-07-27 12:01:06 +0000
+++ b/nautilus-bzr.py	2009-05-04 20:06:58 +0000
@@ -86,7 +86,8 @@
 
         from bzrlib.plugins.gtk.diff import DiffWindow
         window = DiffWindow()
-        window.set_diff(tree.branch.nick, tree, tree.branch.basis_tree())
+        window.set_diff(tree.branch._get_nick(local=True), tree, 
+                        tree.branch.basis_tree())
         window.show()
 
         return

=== modified file 'olive/__init__.py'
--- a/olive/__init__.py	2008-10-28 15:11:19 +0000
+++ b/olive/__init__.py	2009-05-04 20:06:58 +0000
@@ -665,7 +665,8 @@
         """ Statistics/Differences... menu handler. """
         window = DiffWindow(parent=self.window)
         parent_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
-        window.set_diff(self.wt.branch.nick, self.wt, parent_tree)
+        window.set_diff(self.wt.branch._get_nick(local=True), self.wt, 
+                        parent_tree)
         window.show()
     
     def on_menuitem_stats_infos_activate(self, widget):

=== modified file 'olive/menu.py'
--- a/olive/menu.py	2008-07-24 19:33:17 +0000
+++ b/olive/menu.py	2009-05-04 20:06:58 +0000
@@ -310,7 +310,7 @@
         wt = WorkingTree.open_containing(self.path)[0]
         window = DiffWindow(self.app)
         parent_tree = wt.branch.repository.revision_tree(wt.branch.last_revision())
-        window.set_diff(wt.branch.nick, wt, parent_tree)
+        window.set_diff(wt.branch._get_nick(local=True), wt, parent_tree)
         window.set_file(wt.relpath(self.path + os.sep + self.selected))
         window.show()
     
@@ -367,7 +367,7 @@
         wt = WorkingTree.open_containing(self.path)[0]
         window = DiffWindow(self.app)
         parent_tree = wt.branch.repository.revision_tree(wt.branch.last_revision())
-        window.set_diff(wt.branch.nick, wt, parent_tree)
+        window.set_diff(wt.branch._get_nick(local=True), wt, parent_tree)
         window.show()
     
     def view_remote(self, action):

=== modified file 'push.py'
--- a/push.py	2008-07-22 19:46:47 +0000
+++ b/push.py	2009-05-06 11:51:38 +0000
@@ -25,8 +25,6 @@
 
 from errors import show_bzr_error
 
-# FIXME: This needs to be public JRV 20070714
-from bzrlib.builtins import _create_prefix
 from bzrlib.config import LocationConfig
 import bzrlib.errors as errors
 
@@ -144,7 +142,7 @@
             response = question_dialog(_i18n('Non existing parent directory'),
                          _i18n("The parent directory (%s)\ndoesn't exist. Create?") % location)
             if response == gtk.RESPONSE_OK:
-                _create_prefix(transport)
+                transport.create_prefix()
             else:
                 return
         dir_to = br_from.bzrdir.clone(location_url,

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-11-13 06:55:41 +0000
+++ b/tests/__init__.py	2009-05-07 09:54:50 +0000
@@ -14,17 +14,11 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from unittest import TestLoader, TestSuite
-from bzrlib.tests import TestUtil
-
-import os
-
-def test_suite():
-    result = TestSuite()
-
-    loader = TestUtil.TestLoader()
-
+from bzrlib import tests
+
+def load_tests(basic_tests, module, loader):
     testmod_names = [
+        'test_annotate_config',
         'test_commit',
         'test_diff',
         'test_history',
@@ -33,6 +27,6 @@
         'test_revisionview',
         ]
 
-    result.addTest(loader.loadTestsFromModuleNames(["%s.%s" % (__name__, i) for i in testmod_names]))
-    return result
-
+    basic_tests.addTest(loader.loadTestsFromModuleNames(
+            ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))
+    return basic_tests

=== added file 'tests/test_annotate_config.py'
--- a/tests/test_annotate_config.py	1970-01-01 00:00:00 +0000
+++ b/tests/test_annotate_config.py	2009-05-07 11:48:03 +0000
@@ -0,0 +1,40 @@
+# Copyright (C) 2009 Canonical Ltd
+#
+# 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
+
+"""Test the annotate configuration functionality."""
+
+from bzrlib import (
+    tests,
+    )
+
+from bzrlib.plugins.gtk.annotate import (
+    config,
+    gannotate,
+    )
+
+class TestConfig(tests.TestCaseInTempDir):
+
+    def setUp(self):
+        super(TestConfig, self).setUp()
+        self.window = gannotate.GAnnotateWindow()
+
+    def test_create_initial_config(self):
+        """We can create a config even without a prior conf file"""
+        conf = config.GAnnotateConfig(self.window)
+        # We can access the default values (we just pick a random one)
+        width = conf['window']['width']
+        # configobj presents attributes as strings only
+        self.assertIsInstance(width, str)

=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py	2008-11-28 16:42:25 +0000
+++ b/viz/branchwin.py	2009-05-04 20:06:58 +0000
@@ -55,7 +55,7 @@
         else:
             self.compact_view = False
 
-        self.set_title(branch.nick + " - revision history")
+        self.set_title(branch._get_nick(local=True) + " - revision history")
 
         # user-configured window size
         size = self._load_size('viz-window-size')
@@ -439,7 +439,7 @@
         parents  = self.treeview.get_parents()
 
         if len(parents) == 0:
-            parent_id = None
+            parent_id = NULL_REVISION
         else:
             parent_id = parents[0]
 
@@ -616,18 +616,15 @@
             value = '%sx%s' % (width, height)
             self.config.set_user_option(name, value)
 
-    def show_diff(self, revid=None, parentid=None):
+    def show_diff(self, revid=None, parentid=NULL_REVISION):
         """Open a new window to show a diff between the given revisions."""
         from bzrlib.plugins.gtk.diff import DiffWindow
         window = DiffWindow(parent=self)
 
-        if parentid is None:
-            parentid = NULL_REVISION
-
         rev_tree    = self.branch.repository.revision_tree(revid)
         parent_tree = self.branch.repository.revision_tree(parentid)
 
-        description = revid + " - " + self.branch.nick
+        description = revid + " - " + self.branch._get_nick(local=True)
         window.set_diff(description, rev_tree, parent_tree)
         window.show()
 
@@ -638,13 +635,13 @@
 
         if not revision: # default to selected row
             revision = self.treeview.get_revision()
-        if (not revision) or (revision == NULL_REVISION):
+        if revision == NULL_REVISION:
             return
 
         if not parents: # default to selected row's parents
             parents  = self.treeview.get_parents()
         if len(parents) == 0:
-            parent_id = None
+            parent_id = NULL_REVISION
         else:
             parent_id = parents[0]
 



More information about the Pkg-bazaar-commits mailing list