[Pkg-bazaar-commits] ./bzr-gtk/unstable r103: Merged Alexander Belchenko's Win32 fixes and additions.

Szilveszter Farkas (Phanatic) Szilveszter.Farkas at gmail.com
Fri Apr 10 07:49:24 UTC 2009


------------------------------------------------------------
revno: 103
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk
timestamp: Tue 2006-10-24 23:25:38 +0200
message:
  Merged Alexander Belchenko's Win32 fixes and additions.
added:
  Makefile
modified:
  .bzrignore
  olive-gtk
  olive.glade
  olive/__init__.py
  olive/menu.py
  olive/push.py
  setup.py
    ------------------------------------------------------------
    revno: 0.14.1
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: main
    timestamp: Wed 2006-09-27 21:11:59 +0200
    message:
      Merge all changes. Release 0.11.0.
    removed:
      ChangeLog
      olive/__init__.py
      olive/backend/
      olive/backend/__init__.py
      olive/backend/commit.py
      olive/backend/errors.py
      olive/backend/fileops.py
      olive/backend/info.py
      olive/backend/info_helper.py
      olive/backend/init.py
      olive/backend/update.py
      olive/frontend/
      olive/frontend/__init__.py
      olive/frontend/gtk/
      olive/frontend/gtk/__init__.py
      olive/frontend/gtk/viz/
      olive/frontend/gtk/viz/__init__.py
      olive/frontend/gtk/viz/branchwin.py
      olive/frontend/gtk/viz/bzrkapp.py
      olive/frontend/gtk/viz/diffwin.py
      olive/frontend/gtk/viz/graph.py
      olive/frontend/gtk/viz/graphcell.py
    added:
      olive/__init__.py
      olive/info_helper.py
    renamed:
      olive/backend/ui.py => olive/ui.py
      olive/frontend/gtk/add.py => olive/add.py
      olive/frontend/gtk/bookmark.py => olive/bookmark.py
      olive/frontend/gtk/branch.py => olive/branch.py
      olive/frontend/gtk/checkout.py => olive/checkout.py
      olive/frontend/gtk/commit.py => olive/commit.py
      olive/frontend/gtk/dialog.py => olive/dialog.py
      olive/frontend/gtk/diff.py => olive/diff.py
      olive/frontend/gtk/handler.py => olive/handler.py
      olive/frontend/gtk/info.py => olive/info.py
      olive/frontend/gtk/launch.py => olive/launch.py
      olive/frontend/gtk/log.py => olive/log.py
      olive/frontend/gtk/menu.py => olive/menu.py
      olive/frontend/gtk/mkdir.py => olive/mkdir.py
      olive/frontend/gtk/move.py => olive/move.py
      olive/frontend/gtk/push.py => olive/push.py
      olive/frontend/gtk/remove.py => olive/remove.py
      olive/frontend/gtk/rename.py => olive/rename.py
      olive/frontend/gtk/status.py => olive/status.py
    modified:
      NEWS.txt
      README.txt
      debian/changelog
      debian/control
      genpot.sh
      olive-gtk
      po/olive-gtk.pot
      setup.py
      olive/add.py
      olive/branch.py
      olive/checkout.py
      olive/commit.py
      olive/dialog.py
      olive/handler.py
      olive/info.py
      olive/log.py
      olive/menu.py
      olive/mkdir.py
      olive/move.py
      olive/push.py
      olive/remove.py
      olive/rename.py
    ------------------------------------------------------------
    revno: 0.14.2
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: main
    timestamp: Thu 2006-09-28 16:40:06 +0200
    message:
      Fix init error. Added .bzrignore.
    added:
      .bzrignore
    modified:
      olive/add.py
      olive/handler.py
      olive/menu.py
      olive/remove.py
    ------------------------------------------------------------
    revno: 0.14.3
    committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
    branch nick: main
    timestamp: Tue 2006-10-03 08:44:48 +0200
    message:
      Merge from the merge branch.
    removed:
      .bzrignore
      olive/diff.py
      olive/handler.py
      olive/log.py
    added:
      .bzrignore
    modified:
      TODO.txt
      olive.glade
      olive/__init__.py
      olive/add.py
      olive/bookmark.py
      olive/branch.py
      olive/checkout.py
      olive/commit.py
      olive/dialog.py
      olive/info.py
      olive/launch.py
      olive/menu.py
      olive/mkdir.py
      olive/move.py
      olive/push.py
      olive/remove.py
      olive/rename.py
      olive/status.py
      olive/ui.py
    ------------------------------------------------------------
    revno: 0.14.4
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Thu 2006-10-05 16:44:08 +0300
    message:
      Make olive-gtk runnable even when bzrlib not installed in site-packages
      
      If "import bzrlib" fails but user have working version of bzr
      then try to find bzrlib location in output of "bzr version"
    modified:
      olive-gtk
    ------------------------------------------------------------
    revno: 0.14.5
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Thu 2006-10-05 17:06:23 +0300
    message:
      Added Makefile for building windows python-based installer
    added:
      Makefile
    ------------------------------------------------------------
    revno: 0.14.6
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Thu 2006-10-05 17:06:45 +0300
    message:
      ignore dist directory
    modified:
      .bzrignore
    ------------------------------------------------------------
    revno: 0.14.7
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Thu 2006-10-05 17:08:40 +0300
    message:
      Make olive.glade universal by using the same path to icon resources
      in both installed and non-installed versions
    modified:
      olive.glade
      setup.py
    ------------------------------------------------------------
    revno: 0.14.8
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Thu 2006-10-05 18:16:58 +0300
    message:
      If there is no push location saved then use empty string
    modified:
      olive/push.py
    ------------------------------------------------------------
    revno: 0.14.9
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 09:59:14 +0300
    message:
      Try to find olive.glade in source directory (where is olive-gtk script)
      instead of current directory. 
      Thus we can to start olive-gtk from within any directory 
      without installing olive.
    modified:
      olive/__init__.py
    ------------------------------------------------------------
    revno: 0.14.10
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 10:01:27 +0300
    message:
      Fixed problem when user try to cd to shared repo root directory.
      
      In this case there is branch but no working tree.
      TODO: This fix is simple and in the future should more smart processing
            (at least 'bzr info' is working for shared repo)
    modified:
      olive/__init__.py
    ------------------------------------------------------------
    revno: 0.14.11
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 10:28:45 +0300
    message:
      Make change of drive letter on win32 is actually workable
    modified:
      olive/__init__.py
    ------------------------------------------------------------
    revno: 0.14.12
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 11:04:07 +0300
    message:
      updir link (..) added always to the top of directories list
      also this link added only if we not in the root directory
    modified:
      olive/__init__.py
    ------------------------------------------------------------
    revno: 0.14.13
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 11:07:27 +0300
    message:
      minor fix: line endings
    modified:
      .bzrignore
      Makefile
    ------------------------------------------------------------
    revno: 0.14.14
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: olive.bialix
    timestamp: Tue 2006-10-10 13:19:52 +0300
    message:
      get number of pulled revision: it's return value of branch.pull() method
    modified:
      olive/__init__.py
    ------------------------------------------------------------
    revno: 93.1.1
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: win32.bialix
    timestamp: Sat 2006-10-14 13:26:00 +0300
    message:
      merge win32 fixes from my olive branch
    added:
      Makefile
    modified:
      .bzrignore
      olive-gtk
      olive.glade
      olive/__init__.py
      olive/menu.py
      olive/push.py
      setup.py
    ------------------------------------------------------------
    revno: 93.1.2
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: win32.bialix
    timestamp: Sat 2006-10-14 13:30:15 +0300
    message:
      merge from bzr-gtk trunk
    removed:
      debian/
      debian/changelog
      debian/compat
      debian/control
      debian/copyright
      debian/docs
      debian/olive-gtk.1
      debian/pycompat
      debian/rules
    ------------------------------------------------------------
    revno: 93.1.3
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: bzr-gtk.win32.bialix
    timestamp: Sat 2006-10-14 14:44:16 +0300
    message:
      olive is able to successfully work without installation
    modified:
      olive/__init__.py
      olive/menu.py
    ------------------------------------------------------------
    revno: 93.1.4
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: bzr-gtk.win32.bialix
    timestamp: Thu 2006-10-19 16:06:30 +0300
    message:
      merge with main branches
    modified:
      AUTHORS
      nautilus-bzr.py
      olive.glade
      olive/__init__.py
      olive/commit.py
      olive/merge.py
    ------------------------------------------------------------
    revno: 93.1.5
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: bzr-gtk.win32.bialix
    timestamp: Tue 2006-10-24 09:38:50 +0300
    message:
      merged integration (Szilveszter)
    modified:
      TODO
      olive/__init__.py
      olive/push.py
-------------- next part --------------
=== modified file '.bzrignore'
--- a/.bzrignore	2006-10-09 16:47:57 +0000
+++ b/.bzrignore	2006-10-14 10:26:00 +0000
@@ -4,3 +4,4 @@
 *.pyc
 *.bak
 *.gladep
+dist

=== added file 'Makefile'
--- a/Makefile	1970-01-01 00:00:00 +0000
+++ b/Makefile	2006-10-10 08:07:27 +0000
@@ -0,0 +1,5 @@
+python-installer:
+	python setup.py bdist_wininst
+
+clean:
+	python -c "import shutil; shutil.rmtree('build'); shutil.rmtree('dist')"

=== modified file 'olive-gtk'
--- a/olive-gtk	2006-09-06 00:23:46 +0000
+++ b/olive-gtk	2006-10-05 13:44:08 +0000
@@ -56,6 +56,29 @@
 import gettext
 gettext.install('olive-gtk')
 
+
+# make sure we could import bzrlib
+try:
+    import bzrlib
+except ImportError:
+    # try to find bzr if it exist in $PATH
+    p = os.popen('bzr version')
+    s = p.read()
+    r = p.close()
+    if r not in (None, 0):
+        print >>sys.stderr, "bzr not found"
+        sys.exit(1)
+    else:
+        for i in s.splitlines():
+            if i.startswith("Using bzrlib: "):
+                path = os.path.split(i[14:])[0]
+                sys.path.append(path)
+                break
+        else:
+            print >>sys.stderr, "Can't find bzrlib location"
+            sys.exit(1)
+
+
 from olive import OliveGtk
 from bzrlib.plugin import load_plugins
 load_plugins()

=== modified file 'olive.glade'
--- a/olive.glade	2006-10-15 17:47:36 +0000
+++ b/olive.glade	2006-10-19 13:06:30 +0000
@@ -235,7 +235,7 @@
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image243">
 			  <property name="visible">True</property>
-			  <property name="pixbuf">pull16.png</property>
+			  <property name="pixbuf">icons/pull16.png</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
@@ -255,7 +255,7 @@
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image244">
 			  <property name="visible">True</property>
-			  <property name="pixbuf">push16.png</property>
+			  <property name="pixbuf">icons/push16.png</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
@@ -290,7 +290,7 @@
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image245">
 			  <property name="visible">True</property>
-			  <property name="pixbuf">commit16.png</property>
+			  <property name="pixbuf">icons/commit16.png</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
@@ -347,7 +347,7 @@
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image246">
 			  <property name="visible">True</property>
-			  <property name="pixbuf">diff16.png</property>
+			  <property name="pixbuf">icons/diff16.png</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
@@ -367,7 +367,7 @@
 		      <child internal-child="image">
 			<widget class="GtkImage" id="image247">
 			  <property name="visible">True</property>
-			  <property name="pixbuf">log16.png</property>
+			  <property name="pixbuf">icons/log16.png</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
@@ -432,7 +432,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Refresh</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">refresh.png</property>
+	      <property name="icon">icons/refresh.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
@@ -449,7 +449,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Diff</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">diff.png</property>
+	      <property name="icon">icons/diff.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
@@ -466,7 +466,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Log</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">log.png</property>
+	      <property name="icon">icons/log.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
@@ -496,7 +496,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Commit</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">commit.png</property>
+	      <property name="icon">icons/commit.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
@@ -526,7 +526,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Pull</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">pull.png</property>
+	      <property name="icon">icons/pull.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>
@@ -543,7 +543,7 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Push</property>
 	      <property name="use_underline">True</property>
-	      <property name="icon">push.png</property>
+	      <property name="icon">icons/push.png</property>
 	      <property name="visible_horizontal">True</property>
 	      <property name="visible_vertical">True</property>
 	      <property name="is_important">False</property>

=== modified file 'olive/__init__.py'
--- a/olive/__init__.py	2006-10-20 11:59:27 +0000
+++ b/olive/__init__.py	2006-10-24 06:38:50 +0000
@@ -45,8 +45,9 @@
     gladefile = "/usr/share/olive/olive.glade"
 
 if not os.path.exists(gladefile):
-    # Load from current directory if not installed
-    gladefile = "olive.glade"
+    # Load from sources directory if not installed
+    dir_ = os.path.split(os.path.dirname(__file__))[0]
+    gladefile = os.path.join(dir_, "olive.glade")
     # Check again
     if not os.path.exists(gladefile):
         # Fail
@@ -55,6 +56,19 @@
 
 from dialog import error_dialog, info_dialog
 
+# import this classes only once
+try:
+    from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
+    from bzrlib.plugins.gtk.viz.branchwin import BranchWindow
+except ImportError:
+    # olive+bzr-gtk not installed. try to import from sources
+    path = os.path.dirname(os.path.dirname(__file__))
+    if path not in sys.path:
+        sys.path.append(path)
+    from viz.diffwin import DiffWindow
+    from viz.branchwin import BranchWindow
+
+
 class OliveGtk:
     """ The main Olive GTK frontend class. This is called when launching the
     program. """
@@ -191,7 +205,7 @@
         
         try:
             self.wt, self.wtpath = WorkingTree.open_containing(self.path)
-        except errors.NotBranchError:
+        except (errors.NotBranchError, errors.NoWorkingTree):
             self.notbranch = True
         
         self.statusbar.push(self.context_id, path)
@@ -281,10 +295,7 @@
         #    tree_to.pull(branch_from)
         #else:
         #    branch_to.pull(branch_from)
-        branch_to.pull(branch_from)
-        
-        # TODO: get the number of pulled revisions
-        ret = 0
+        ret = branch_to.pull(branch_from)
         
         info_dialog(_('Pull successful'), _('%d revision(s) pulled.') % ret)
     
@@ -358,7 +369,6 @@
     
     def on_menuitem_stats_diff_activate(self, widget):
         """ Statistics/Differences... menu handler. """
-        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
         window = DiffWindow()
         parent_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
         window.set_diff(self.wt.branch.nick, self.wt, parent_tree)
@@ -372,7 +382,6 @@
     
     def on_menuitem_stats_log_activate(self, widget):
         """ Statistics/Log... menu handler. """
-        from bzrlib.plugins.gtk.viz.branchwin import BranchWindow
         window = BranchWindow()
         window.set_branch(self.wt.branch, self.wt.branch.last_revision(), None)
         window.show()
@@ -446,8 +455,6 @@
     def on_treeview_right_row_activated(self, treeview, path, view_column):
         """ Occurs when somebody double-clicks or enters an item in the
         file list. """
-        import os.path
-        
         from launch import launch
         
         newdir = self.get_selected_right()
@@ -455,7 +462,7 @@
         if newdir == '..':
             self.set_path(os.path.split(self.get_path())[0])
         else:
-            fullpath = self.get_path() + os.sep + newdir
+            fullpath = os.path.join(self.get_path(), newdir)
             if os.path.isdir(fullpath):
                 # selected item is an existant directory
                 self.set_path(fullpath)
@@ -505,12 +512,33 @@
         # Expand the tree
         self.treeview_left.expand_all()
 
+    def _add_updir_to_dirlist(self, dirlist, curdir):
+        """Add .. to the top of directories list if we not in root directory
+
+        @param  dirlist:    list of directories (modified in place)
+        @param  curdir:     current directory
+        @return:            nothing
+        """
+        if curdir is None:
+            curdir = self.path
+
+        if sys.platform == 'win32':
+            drive, tail = os.path.splitdrive(curdir)
+            if tail in ('', '/', '\\'):
+                return
+        else:
+            if curdir == '/':
+                return
+
+        # insert always as first element
+        dirlist.insert(0, '..')
+
     def _load_right(self):
         """ Load data into the right panel. (Filelist) """
         # Create ListStore
         liststore = gtk.ListStore(str, str, str)
         
-        dirs = ['..']
+        dirs = []
         files = []
         
         # Fill the appropriate lists
@@ -526,6 +554,9 @@
         # Sort'em
         dirs.sort()
         files.sort()
+
+        # add updir link to dirs
+        self._add_updir_to_dirlist(dirs, self.path)
         
         if not self.notbranch:
             branch = self.wt.branch
@@ -688,7 +719,7 @@
         liststore = self.treeview_right.get_model()
         liststore.clear()
 
-        dirs = ['..']
+        dirs = []
         files = []
 
         # Fill the appropriate lists
@@ -704,12 +735,15 @@
         # Sort'em
         dirs.sort()
         files.sort()
-        
+
+        # add updir link to dirs
+        self._add_updir_to_dirlist(dirs, path)
+
         # Try to open the working tree
         notbranch = False
         try:
             tree1 = WorkingTree.open_containing(path)[0]
-        except errors.NotBranchError:
+        except (errors.NotBranchError, errors.NoWorkingTree):
             notbranch = True
         except errors.PermissionDenied:
             print "DEBUG: permission denied."
@@ -798,6 +832,7 @@
         active = combobox.get_active()
         if active >= 0:
             drive = model[active][0]
+            self.set_path(drive + '\\')
             self.refresh_right(drive + '\\')
 
 import ConfigParser

=== modified file 'olive/menu.py'
--- a/olive/menu.py	2006-10-04 19:11:46 +0000
+++ b/olive/menu.py	2006-10-14 11:44:16 +0000
@@ -30,7 +30,7 @@
 
 from dialog import error_dialog, info_dialog, warning_dialog
 from launch import launch
-from olive import OlivePreferences
+from olive import OlivePreferences, DiffWindow
 
 class OliveMenu:
     """ This class is responsible for building the context menus. """
@@ -149,7 +149,7 @@
             return
         
         try:
-            bzrlib.add.smart_add([directory + '/' + filename])
+            bzrlib.add.smart_add([os.path.join(directory, filename)])
         except errors.NotBranchError:
             error_dialog(_('Directory is not a branch'),
                          _('You can perform this action only in a branch.'))
@@ -210,8 +210,6 @@
     
     def diff(self, action):
         """ Right context menu -> Diff """
-        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
-        
         try:
             wt = WorkingTree.open_containing(self.path)[0]
         except errors.NotBranchError:

=== modified file 'olive/push.py'
--- a/olive/push.py	2006-10-19 14:40:47 +0000
+++ b/olive/push.py	2006-10-24 06:38:50 +0000
@@ -65,7 +65,7 @@
         self.check_remember.set_sensitive(0)
         self.check_create.set_sensitive(0)
         
-        self.entry_stored.set_text(branch.get_push_location())
+        self.entry_stored.set_text(branch.get_push_location() or '')
     
     def display(self):
         """ Display the Push dialog. """

=== modified file 'setup.py'
--- a/setup.py	2006-09-30 10:21:43 +0000
+++ b/setup.py	2006-10-14 10:26:00 +0000
@@ -69,6 +69,8 @@
       data_files=[('share/olive', ['olive.glade',
                                    'oliveicon2.png',
                                    'cmenu.ui',
+                                  ]),
+                  ('share/olive/icons', [\
                                    'icons/commit.png',
                                    'icons/commit16.png',
                                    'icons/diff.png',



More information about the Pkg-bazaar-commits mailing list