bzr branch
http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
1 |
import nautilus |
2 |
import bzrlib |
|
3 |
from bzrlib.bzrdir import BzrDir |
|
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
4 |
from bzrlib.errors import NotBranchError |
5 |
from bzrlib.workingtree import WorkingTree |
|
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
6 |
|
0.7.1
by Wouter van Heyst
use the bzrlib method of loading plugins, takes care of ~/.bazaar/plugins |
7 |
from bzrlib.plugin import load_plugins |
8 |
load_plugins() |
|
9 |
||
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
10 |
from bzrlib.plugins.gtk import cmd_visualise, cmd_gannotate |
0.6.2
by Jelmer Vernooij
Add 'Annotate' menu entry that uses the gannotate bzr plugin |
11 |
|
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
12 |
class BzrExtension(nautilus.MenuProvider): |
13 |
def __init__(self): |
|
14 |
pass
|
|
15 |
||
0.5.4
by jbailey at ubuntu
Add 'add' function. Give framework for other callbacks. |
16 |
def add_cb(self, menu, vfs_file): |
17 |
# We can only cope with local files
|
|
18 |
if vfs_file.get_uri_scheme() != 'file': |
|
19 |
return
|
|
20 |
||
21 |
file = vfs_file.get_uri() |
|
22 |
try: |
|
23 |
tree, path = WorkingTree.open_containing(file) |
|
24 |
except NotBranchError: |
|
25 |
return
|
|
26 |
||
27 |
tree.add(path) |
|
28 |
||
29 |
return
|
|
30 |
||
31 |
def ignore_cb(self, menu, vfs_file): |
|
32 |
# We can only cope with local files
|
|
33 |
if vfs_file.get_uri_scheme() != 'file': |
|
34 |
return
|
|
35 |
||
36 |
file = vfs_file.get_uri() |
|
37 |
try: |
|
38 |
tree, path = WorkingTree.open_containing(file) |
|
39 |
except NotBranchError: |
|
40 |
return
|
|
41 |
||
0.5.16
by Jelmer Vernooij
Adapt to bzr-gtk's API changes, add 'Clone' dialog |
42 |
#FIXME
|
43 |
||
0.5.4
by jbailey at ubuntu
Add 'add' function. Give framework for other callbacks. |
44 |
return
|
45 |
||
46 |
def unignore_cb(self, menu, vfs_file): |
|
47 |
# We can only cope with local files
|
|
48 |
if vfs_file.get_uri_scheme() != 'file': |
|
49 |
return
|
|
50 |
||
51 |
file = vfs_file.get_uri() |
|
52 |
try: |
|
53 |
tree, path = WorkingTree.open_containing(file) |
|
54 |
except NotBranchError: |
|
55 |
return
|
|
56 |
||
0.5.16
by Jelmer Vernooij
Adapt to bzr-gtk's API changes, add 'Clone' dialog |
57 |
#FIXME
|
58 |
||
0.5.4
by jbailey at ubuntu
Add 'add' function. Give framework for other callbacks. |
59 |
return
|
60 |
||
61 |
def diff_cb(self, menu, vfs_file): |
|
62 |
# We can only cope with local files
|
|
63 |
if vfs_file.get_uri_scheme() != 'file': |
|
64 |
return
|
|
65 |
||
66 |
file = vfs_file.get_uri() |
|
67 |
try: |
|
68 |
tree, path = WorkingTree.open_containing(file) |
|
69 |
except NotBranchError: |
|
70 |
return
|
|
71 |
||
0.5.13
by Jelmer Vernooij
Use the gtk plugin rather than separate bzrk and gannotate |
72 |
from bzrlib.plugins.gtk.viz.diffwin import DiffWindow |
73 |
window = DiffWindow() |
|
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
74 |
window.set_diff(tree.branch, tree, tree.branch.revision_tree()) |
0.5.13
by Jelmer Vernooij
Use the gtk plugin rather than separate bzrk and gannotate |
75 |
window.show() |
76 |
||
0.5.4
by jbailey at ubuntu
Add 'add' function. Give framework for other callbacks. |
77 |
return
|
78 |
||
0.5.7
by jbailey at ubuntu
Add hook for creating new bzr trees. |
79 |
def newtree_cb(self, menu, vfs_file): |
80 |
# We can only cope with local files
|
|
81 |
if vfs_file.get_uri_scheme() != 'file': |
|
82 |
return
|
|
83 |
||
84 |
file = vfs_file.get_uri() |
|
85 |
||
86 |
# We only want to continue here if we get a NotBranchError
|
|
87 |
try: |
|
88 |
tree, path = WorkingTree.open_containing(file) |
|
89 |
except NotBranchError: |
|
0.5.9
by jbailey at ubuntu
Implement repository creation |
90 |
BzrDir.create_branch_and_repo(file) |
0.5.7
by jbailey at ubuntu
Add hook for creating new bzr trees. |
91 |
|
0.5.4
by jbailey at ubuntu
Add 'add' function. Give framework for other callbacks. |
92 |
def remove_cb(self, menu, vfs_file): |
93 |
# We can only cope with local files
|
|
94 |
if vfs_file.get_uri_scheme() != 'file': |
|
95 |
return
|
|
96 |
||
97 |
file = vfs_file.get_uri() |
|
98 |
try: |
|
99 |
tree, path = WorkingTree.open_containing(file) |
|
100 |
except NotBranchError: |
|
101 |
return
|
|
102 |
||
0.5.6
by jbailey at ubuntu
Implement remove |
103 |
tree.remove(path) |
104 |
||
0.6.2
by Jelmer Vernooij
Add 'Annotate' menu entry that uses the gannotate bzr plugin |
105 |
def annotate_cb(self, menu, vfs_file): |
106 |
# We can only cope with local files
|
|
107 |
if vfs_file.get_uri_scheme() != 'file': |
|
108 |
return
|
|
109 |
||
110 |
file = vfs_file.get_uri() |
|
111 |
||
112 |
vis = cmd_gannotate() |
|
113 |
vis.run(file) |
|
0.5.16
by Jelmer Vernooij
Adapt to bzr-gtk's API changes, add 'Clone' dialog |
114 |
|
115 |
def clone_cb(self, menu, vfs_file=None): |
|
116 |
# We can only cope with local files
|
|
117 |
if vfs_file.get_uri_scheme() != 'file': |
|
118 |
return
|
|
119 |
||
120 |
file = vfs_file.get_uri() |
|
121 |
try: |
|
122 |
tree, path = WorkingTree.open_containing(file) |
|
123 |
except NotBranchError: |
|
124 |
return
|
|
125 |
||
126 |
from bzrlib.plugins.gtk.clone import CloneDialog |
|
127 |
dialog = CloneDialog(file) |
|
128 |
if dialog.run() != gtk.RESPONSE_CANCEL: |
|
129 |
bzrdir = BzrDir.open(dialog.url) |
|
130 |
bzrdir.sprout(dialog.dest_path) |
|
0.6.2
by Jelmer Vernooij
Add 'Annotate' menu entry that uses the gannotate bzr plugin |
131 |
|
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
132 |
def commit_cb(self, menu, vfs_file=None): |
133 |
# We can only cope with local files
|
|
134 |
if vfs_file.get_uri_scheme() != 'file': |
|
135 |
return
|
|
136 |
||
137 |
file = vfs_file.get_uri() |
|
138 |
try: |
|
139 |
tree, path = WorkingTree.open_containing(file) |
|
140 |
except NotBranchError: |
|
141 |
return
|
|
142 |
||
0.5.16
by Jelmer Vernooij
Adapt to bzr-gtk's API changes, add 'Clone' dialog |
143 |
from bzrlib.plugins.gtk.commit import GCommitDialog |
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
144 |
dialog = GCommitDialog(tree) |
145 |
dialog.set_title(path + " - Commit") |
|
146 |
if dialog.run() != gtk.RESPONSE_CANCEL: |
|
147 |
Commit().commit(working_tree=wt,message=dialog.message, |
|
148 |
specific_files=dialog.specific_files) |
|
0.6.2
by Jelmer Vernooij
Add 'Annotate' menu entry that uses the gannotate bzr plugin |
149 |
|
0.5.12
by Jelmer Vernooij
Rename "Visualise Bazaar Branch" to "Log", which is a term |
150 |
def log_cb(self, menu, vfs_file): |
0.5.8
by jbailey at ubuntu
Add bzrk plugin |
151 |
# We can only cope with local files
|
152 |
if vfs_file.get_uri_scheme() != 'file': |
|
153 |
return
|
|
154 |
||
155 |
file = vfs_file.get_uri() |
|
156 |
||
157 |
# We only want to continue here if we get a NotBranchError
|
|
158 |
try: |
|
159 |
tree, path = WorkingTree.open_containing(file) |
|
160 |
except NotBranchError: |
|
161 |
return
|
|
162 |
||
163 |
vis = cmd_visualise() |
|
164 |
vis.run(file) |
|
165 |
||
166 |
return
|
|
167 |
||
0.5.7
by jbailey at ubuntu
Add hook for creating new bzr trees. |
168 |
def get_background_items(self, window, vfs_file): |
169 |
file = vfs_file.get_uri() |
|
170 |
try: |
|
171 |
tree, path = WorkingTree.open_containing(file) |
|
172 |
except NotBranchError: |
|
173 |
item = nautilus.MenuItem('BzrNautilus::newtree', |
|
174 |
'Create new Bazaar tree', |
|
175 |
'Create new Bazaar tree in this folder') |
|
176 |
item.connect('activate', self.newtree_cb, vfs_file) |
|
0.5.16
by Jelmer Vernooij
Adapt to bzr-gtk's API changes, add 'Clone' dialog |
177 |
items.append(item) |
178 |
||
179 |
item = nautilus.MenuItem('BzrNautilus::clone', |
|
180 |
'Checkout', |
|
181 |
'Checkout Existing Bazaar Branch') |
|
182 |
item.connect('activate', self.clone_cb, vfs_file) |
|
183 |
items.append(item) |
|
184 |
||
185 |
return items |
|
0.5.8
by jbailey at ubuntu
Add bzrk plugin |
186 |
|
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
187 |
items = [] |
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
188 |
item = nautilus.MenuItem('BzrNautilus::log', |
189 |
'Log', |
|
190 |
'Show Bazaar history') |
|
191 |
item.connect('activate', self.log_cb, vfs_file) |
|
192 |
items.append(item) |
|
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
193 |
|
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
194 |
item = nautilus.MenuItem('BzrNautilus::commit', |
195 |
'Commit', |
|
196 |
'Commit Changes') |
|
197 |
item.connect('activate', self.commit_cb, vfs_file) |
|
198 |
items.append(item) |
|
0.5.15
by Jelmer Vernooij
Add 'Commit' entries |
199 |
|
200 |
return items |
|
0.5.7
by jbailey at ubuntu
Add hook for creating new bzr trees. |
201 |
|
202 |
||
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
203 |
def get_file_items(self, window, files): |
204 |
items = [] |
|
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
205 |
|
206 |
for vfs_file in files: |
|
207 |
# We can only cope with local files
|
|
208 |
if vfs_file.get_uri_scheme() != 'file': |
|
209 |
return
|
|
210 |
||
211 |
file = vfs_file.get_uri() |
|
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
212 |
try: |
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
213 |
tree, path = WorkingTree.open_containing(file) |
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
214 |
except NotBranchError: |
0.5.7
by jbailey at ubuntu
Add hook for creating new bzr trees. |
215 |
if not vfs_file.is_directory(): |
216 |
return
|
|
217 |
item = nautilus.MenuItem('BzrNautilus::newtree', |
|
218 |
'Create new Bazaar tree', |
|
219 |
'Create new Bazaar tree in %s' % vfs_file.get_name()) |
|
220 |
item.connect('activate', self.newtree_cb, vfs_file) |
|
221 |
return item, |
|
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
222 |
|
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
223 |
file_class = tree.file_class(path) |
224 |
||
225 |
if file_class == '?': |
|
226 |
item = nautilus.MenuItem('BzrNautilus::add', |
|
227 |
'Add', |
|
228 |
'Add as versioned file') |
|
229 |
item.connect('activate', self.add_cb, vfs_file) |
|
230 |
items.append(item) |
|
231 |
||
232 |
item = nautilus.MenuItem('BzrNautilus::ignore', |
|
233 |
'Ignore', |
|
234 |
'Ignore file for versioning') |
|
235 |
item.connect('activate', self.ignore_cb, vfs_file) |
|
236 |
items.append(item) |
|
237 |
elif file_class == 'I': |
|
238 |
item = nautilus.MenuItem('BzrNautilus::unignore', |
|
239 |
'Unignore', |
|
240 |
'Unignore file for versioning') |
|
241 |
item.connect('activate', self.unignore_cb, vfs_file) |
|
242 |
items.append(item) |
|
243 |
elif file_class == 'V': |
|
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
244 |
item = nautilus.MenuItem('BzrNautilus::log', |
245 |
'Log', |
|
246 |
'List changes') |
|
247 |
item.connect('activate', self.log_cb, vfs_file) |
|
248 |
items.append(item) |
|
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
249 |
|
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
250 |
item = nautilus.MenuItem('BzrNautilus::diff', |
251 |
'Diff', |
|
252 |
'Show differences') |
|
253 |
item.connect('activate', self.diff_cb, vfs_file) |
|
254 |
items.append(item) |
|
0.5.2
by jbailey at ubuntu
Bring this to a state where it actually works. Specifically: |
255 |
|
256 |
item = nautilus.MenuItem('BzrNautilus::remove', |
|
257 |
'Remove', |
|
258 |
'Remove this file from versioning') |
|
259 |
item.connect('activate', self.remove_cb, vfs_file) |
|
260 |
items.append(item) |
|
0.6.2
by Jelmer Vernooij
Add 'Annotate' menu entry that uses the gannotate bzr plugin |
261 |
|
81
by Jelmer Vernooij
Remove unnecessary "#!/usr/bin/python" shebang lines (fixes #59125). |
262 |
item = nautilus.MenuItem('BzrNautilus::annotate', |
263 |
'Annotate', |
|
264 |
'Annotate File Data') |
|
265 |
item.connect('activate', self.annotate_cb, vfs_file) |
|
266 |
items.append(item) |
|
267 |
||
268 |
item = nautilus.MenuItem('BzrNautilus::commit', |
|
269 |
'Commit', |
|
270 |
'Commit Changes') |
|
271 |
item.connect('activate', self.commit_cb, vfs_file) |
|
272 |
items.append(item) |
|
273 |
||
0.5.1
by Jelmer Vernooij
Start working on bzr integration plugin for nautilus |
274 |
return items |