rpms/bzr-gtk/F-7 bzr-gtk-disable-nautilus-pull.patch, NONE, 1.1 bzr-gtk-nautilus-protocol.patch, NONE, 1.1 bzr-gtk-nautilus.patch, NONE, 1.1
Warren Togami (wtogami)
fedora-extras-commits at redhat.com
Tue Jul 3 14:33:54 UTC 2007
Author: wtogami
Update of /cvs/pkgs/rpms/bzr-gtk/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5989
Added Files:
bzr-gtk-disable-nautilus-pull.patch
bzr-gtk-nautilus-protocol.patch bzr-gtk-nautilus.patch
Log Message:
add patches
bzr-gtk-disable-nautilus-pull.patch:
--- NEW FILE bzr-gtk-disable-nautilus-pull.patch ---
Index: bzr-gtk-0.15.2/nautilus-bzr.py
===================================================================
--- bzr-gtk-0.15.2.orig/nautilus-bzr.py
+++ bzr-gtk-0.15.2/nautilus-bzr.py
@@ -165,24 +165,6 @@ class BzrExtension(nautilus.MenuProvider
return
- def pull_cb(self, menu, vfs_file):
- # We can only cope with local files
- if vfs_file.get_uri_scheme() != 'file':
- return
-
- file = vfs_file.get_uri()
-
- # We only want to continue here if we get a NotBranchError
- try:
- tree, path = WorkingTree.open_containing(file)
- except NotBranchError:
- return
-
- from bzrlib.plugins.gtk.pull import PullDialog
- dialog = PullDialog(tree, path)
- dialog.display()
- gtk.main()
-
def merge_cb(self, menu, vfs_file):
# We can only cope with local files
if vfs_file.get_uri_scheme() != 'file':
@@ -227,12 +209,6 @@ class BzrExtension(nautilus.MenuProvider
item.connect('activate', self.log_cb, vfs_file)
items.append(item)
- item = nautilus.MenuItem('BzrNautilus::pull',
- 'Pull',
- 'Pull from another branch')
- item.connect('activate', self.pull_cb, vfs_file)
- items.append(item)
-
item = nautilus.MenuItem('BzrNautilus::merge',
'Merge',
'Merge from another branch')
bzr-gtk-nautilus-protocol.patch:
--- NEW FILE bzr-gtk-nautilus-protocol.patch ---
Index: bzr-gtk-0.15.2/nautilus-bzr.py
===================================================================
--- bzr-gtk-0.15.2.orig/nautilus-bzr.py
+++ bzr-gtk-0.15.2/nautilus-bzr.py
@@ -12,6 +12,7 @@ import bzrlib
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NotBranchError
from bzrlib.errors import NoWorkingTree
+from bzrlib.errors import UnsupportedProtocol
from bzrlib.workingtree import WorkingTree
from bzrlib.branch import Branch
from bzrlib.tree import file_status
@@ -206,6 +207,8 @@ class BzrExtension(nautilus.MenuProvider
file = vfs_file.get_uri()
try:
tree, path = WorkingTree.open_containing(file)
+ except UnsupportedProtocol:
+ return
except NotBranchError:
item = nautilus.MenuItem('BzrNautilus::newtree',
'Make directory versioned',
bzr-gtk-nautilus.patch:
--- NEW FILE bzr-gtk-nautilus.patch ---
Index: bzr-gtk-0.15.2/nautilus-bzr.py
===================================================================
--- bzr-gtk-0.15.2.orig/nautilus-bzr.py
+++ bzr-gtk-0.15.2/nautilus-bzr.py
@@ -6,11 +6,14 @@
#
# Published under the GNU GPL
+import gtk
import nautilus
import bzrlib
from bzrlib.bzrdir import BzrDir
from bzrlib.errors import NotBranchError
+from bzrlib.errors import NoWorkingTree
from bzrlib.workingtree import WorkingTree
+from bzrlib.branch import Branch
from bzrlib.tree import file_status
from bzrlib.plugin import load_plugins
@@ -78,7 +81,7 @@ class BzrExtension(nautilus.MenuProvider
except NotBranchError:
return
- from bzrlib.plugins.gtk.viz.diff import DiffWindow
+ from bzrlib.plugins.gtk.diff import DiffWindow
window = DiffWindow()
window.set_diff(tree.branch.nick, tree, tree.branch.basis_tree())
window.show()
@@ -96,7 +99,7 @@ class BzrExtension(nautilus.MenuProvider
try:
tree, path = WorkingTree.open_containing(file)
except NotBranchError:
- BzrDir.create_branch_and_repo(file)
+ BzrDir.create_standalone_workingtree(file)
def remove_cb(self, menu, vfs_file):
# We can only cope with local files
@@ -129,7 +132,10 @@ class BzrExtension(nautilus.MenuProvider
from bzrlib.plugins.gtk.branch import BranchDialog
dialog = BranchDialog(vfs_file.get_name())
- dialog.display()
+ response = dialog.run()
+ if response != gtk.RESPONSE_NONE:
+ dialog.hide()
+ dialog.destroy()
def commit_cb(self, menu, vfs_file=None):
# We can only cope with local files
@@ -137,15 +143,27 @@ class BzrExtension(nautilus.MenuProvider
return
file = vfs_file.get_uri()
+ tree = None
+ branch = None
try:
tree, path = WorkingTree.open_containing(file)
- except NotBranchError:
- return
+ branch = tree.branch
+ except NotBranchError, e:
+ path = e.path
+ #return
+ except NoWorkingTree, e:
+ path = e.base
+ try:
+ (branch, path) = Branch.open_containing(path)
+ except NotBranchError, e:
+ path = e.path
from bzrlib.plugins.gtk.commit import CommitDialog
- dialog = CommitDialog(tree, path)
- dialog.display()
- gtk.main()
+ dialog = CommitDialog(tree, path, not branch)
+ response = dialog.run()
+ if response != gtk.RESPONSE_NONE:
+ dialog.hide()
+ dialog.destroy()
def log_cb(self, menu, vfs_file):
# We can only cope with local files
@@ -227,6 +245,7 @@ class BzrExtension(nautilus.MenuProvider
def get_file_items(self, window, files):
items = []
+ wtfiles = {}
for vfs_file in files:
# We can only cope with local files
if vfs_file.get_uri_scheme() != 'file':
@@ -243,10 +262,15 @@ class BzrExtension(nautilus.MenuProvider
'Create new Bazaar tree in %s' % vfs_file.get_name())
item.connect('activate', self.newtree_cb, vfs_file)
return item,
+ # Refresh the list of filestatuses in the working tree
+ if path not in wtfiles.keys():
+ tree.lock_read()
+ for rpath, file_class, kind, id, entry in tree.list_files():
+ wtfiles[rpath] = file_class
+ tree.unlock()
+ wtfiles[u''] = 'V'
- file_class = tree.file_class(path)
-
- if file_class == '?':
+ if wtfiles[path] == '?':
item = nautilus.MenuItem('BzrNautilus::add',
'Add',
'Add as versioned file')
@@ -258,13 +282,13 @@ class BzrExtension(nautilus.MenuProvider
'Ignore file for versioning')
item.connect('activate', self.ignore_cb, vfs_file)
items.append(item)
- elif file_class == 'I':
+ elif wtfiles[path] == 'I':
item = nautilus.MenuItem('BzrNautilus::unignore',
'Unignore',
'Unignore file for versioning')
item.connect('activate', self.unignore_cb, vfs_file)
items.append(item)
- elif file_class == 'V':
+ elif wtfiles[path] == 'V':
item = nautilus.MenuItem('BzrNautilus::log',
'Log',
'List changes')
More information about the scm-commits
mailing list