[Pkg-bazaar-commits] ./bzr-gtk/unstable r195: Merge some fixes from John.

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


------------------------------------------------------------
revno: 195
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2007-04-30 22:21:39 +0200
message:
  Merge some fixes from John.
modified:
  NEWS
  README
  __init__.py
  olive-gtk
  olive/guifiles.py
  olive/info_helper.py
    ------------------------------------------------------------
    revno: 194.1.1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Mon 2007-04-30 22:13:46 +0200
    message:
      Don't mention particular version of Bazaar in README.
    modified:
      README
    ------------------------------------------------------------
    revno: 188.3.1
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: gtk
    timestamp: Thu 2007-04-19 16:04:40 -0500
    message:
      Use tree.path2id to avoid getting 'Object Not Locked' errors.
    modified:
      __init__.py
    ------------------------------------------------------------
    revno: 188.3.2
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: gtk
    timestamp: Thu 2007-04-19 16:30:38 -0500
    message:
      Update code to properly handle loading failures.
      And do more searching to find the glade and .ui files.
      In 'olive-gtk' the '_' function was not defined, so it would die when
      trying to report startup failures.
      In 'olive/guifiles.py' it now searches around for olive.glade
      rather than only looking in 2 places. Once it finds olive.glade,
      it assumes that cmenu.ui will be nearby.
    modified:
      olive-gtk
      olive/guifiles.py
    ------------------------------------------------------------
    revno: 188.3.3
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: gtk
    timestamp: Thu 2007-04-19 16:35:53 -0500
    message:
      Avoid using working.inventory, instead use working.iter_entries_by_dir()
    modified:
      olive/info_helper.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-04-30 20:10:40 +0000
+++ b/NEWS	2007-04-30 20:21:39 +0000
@@ -8,8 +8,20 @@
   * Tags support added: 'gtags' command and Branch->Tags menu entry in Olive
   (#103725, Szilveszter)
 
+ BUG FIXES
+
   * Sort plugins in gpreferences (Jelmer)
 
+  * Give nicer errors when startup fails (John)
+
+  * Fix 'bzr gdiff notafile' (John)
+
+  * Find olive.glade on a couple more systems (John)
+
+ INTERNALS
+  
+  * Some minor style fixes (John)
+
 0.15.2	2007-04-03
 
  BUG FIXES

=== modified file 'README'
--- a/README	2007-04-07 13:40:59 +0000
+++ b/README	2007-04-30 20:13:46 +0000
@@ -14,7 +14,7 @@
 need the following runtime dependencies:
 
   * Python 2.4
-  * bzr 0.11 or later
+  * Bazaar with the same major version as bzr-gtk
   * PyGTK 2.8 or later
 
 In order to see graphs in the visualisation tool, you will also need:

=== modified file '__init__.py'
--- a/__init__.py	2007-04-08 21:08:06 +0000
+++ b/__init__.py	2007-04-30 20:21:39 +0000
@@ -181,8 +181,8 @@
                 try:
                     window.set_file(tree_filename)
                 except NoSuchFile:
-                    if (tree1.inventory.path2id(tree_filename) is None and 
-                        tree2.inventory.path2id(tree_filename) is None):
+                    if (tree1.path2id(tree_filename) is None and 
+                        tree2.path2id(tree_filename) is None):
                         raise NotVersionedError(filename)
                     raise BzrCommandError('No changes found for file "%s"' % 
                                           filename)

=== modified file 'olive-gtk'
--- a/olive-gtk	2007-02-04 12:11:31 +0000
+++ b/olive-gtk	2007-04-19 21:30:38 +0000
@@ -37,19 +37,25 @@
                 os.execvp(python, [python] + sys.argv)
             except OSError:
                 pass
-    print >>sys.stderr, _('bzr: error: cannot find a suitable python interpreter (need %d.%d or later)') % NEED_VERS
+    print >>sys.stderr, ('bzr: error: cannot find a suitable python interpreter'
+                         ' (need %d.%d or later)'
+                        ) % NEED_VERS
     sys.exit(1)
 
 try:
- 	import pygtk
-  	pygtk.require("2.0")
+    import pygtk
+    pygtk.require("2.0")
 except:
-  	pass
+    pass
+
 try:
-	import gtk
-	import gtk.glade
+    import gtk
+    import gtk.glade
 except:
-    print >>sys.stderr, _('You need to install python-glade2 and/or pygtk2 (gtk2) or set your PYTHONPATH correctly.\ntry: export PYTHONPATH=/usr/local/lib/python2.4/site-packages/')
+    print >>sys.stderr, ('You need to install python-glade2 and/or pygtk2 (gtk2)'
+                         ' or set your PYTHONPATH correctly.\n'
+                         'try: export PYTHONPATH=/usr/local/lib/python2.4/site-packages/'
+                        )
     sys.exit(1)
 
 # gettext support

=== modified file 'olive/guifiles.py'
--- a/olive/guifiles.py	2006-10-25 16:29:18 +0000
+++ b/olive/guifiles.py	2007-04-19 21:30:38 +0000
@@ -18,37 +18,41 @@
 import sys
 
 
+GLADEFILENAMES = ["/usr/share/olive/olive.glade",
+                  "/usr/local/share/olive/olive.glade",
+                  "/opt/share/olive/olive.glade",
+                  "/opt/local/share/olive/olive.glade",
+                 ]
+
 # Get the glade file name
 if sys.platform == 'win32':
-    GLADEFILENAME = os.path.join(os.path.dirname(sys.executable),
-                                 "share/olive/olive.glade")
-else:
-    GLADEFILENAME = "/usr/share/olive/olive.glade"
-
-if not os.path.isfile(GLADEFILENAME):
-    # Load from sources directory if not installed
-    dir_ = os.path.split(os.path.dirname(__file__))[0]
-    GLADEFILENAME = os.path.join(dir_, "olive.glade")
-    # Check again
-    if not os.path.isfile(GLADEFILENAME):
-        # Fail
-        print _('Glade file cannot be found.')
-        sys.exit(1)
+    GLADEFILENAMES = [os.path.join(os.path.dirname(sys.executable),
+                                   "share/olive/olive.glade")]
+
+dir_ = os.path.split(os.path.dirname(__file__))[0]
+# Check first if we are running from source
+GLADEFILENAMES.insert(0, os.path.join(dir_, "olive.glade"))
+
+GLADEFILENAME = None
+
+for path in GLADEFILENAMES:
+    if os.path.isfile(path):
+        GLADEFILENAME = path
+        break
+
+if GLADEFILENAME is None:
+    # Fail
+    print _('Glade file cannot be found.')
+    sys.exit(1)
+
+UIFILEDIR = os.path.dirname(GLADEFILENAME)
 
 # Get the cmenu.ui file name
-if sys.platform == 'win32':
-    UIFILENAME = os.path.dirname(sys.executable) + "/share/olive/cmenu.ui"
-else:
-    UIFILENAME = "/usr/share/olive/cmenu.ui"
+UIFILENAME = os.path.join(UIFILEDIR, 'cmenu.ui')
 
 if not os.path.isfile(UIFILENAME):
-    # Load from current directory if not installed
-    dir_ = os.path.split(os.path.dirname(__file__))[0]
-    UIFILENAME = os.path.join(dir_, "cmenu.ui")
-    # Check again
-    if not os.path.isfile(UIFILENAME):
-        # Fail
-        print _('UI description file cannot be found.')
-        sys.exit(1)
+    # Fail
+    print _('UI description file cannot be found.')
+    sys.exit(1)
 
 

=== modified file 'olive/info_helper.py'
--- a/olive/info_helper.py	2006-12-20 02:06:04 +0000
+++ b/olive/info_helper.py	2007-04-19 21:35:53 +0000
@@ -163,8 +163,7 @@
     ret = {}
     branch = working.branch
     basis = working.basis_tree()
-    work_inv = working.inventory
-    
+
     if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
         delta = compare_trees(basis, working, want_unchanged=True)
     else:
@@ -192,8 +191,7 @@
     
     ret = {}
     basis = working.basis_tree()
-    work_inv = working.inventory
-    
+
     if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
         delta = compare_trees(basis, working, want_unchanged=True)
     else:
@@ -215,8 +213,8 @@
     ret['ignored'] = ignore_cnt
 
     dir_cnt = 0
-    for file_id in work_inv:
-        if work_inv.get_file_kind(file_id) == 'directory':
+    for path, ie in working.iter_entries_by_dir():
+        if ie.kind == 'directory':
             dir_cnt += 1
     ret['subdirs'] = dir_cnt
 



More information about the Pkg-bazaar-commits mailing list