Merge lp:~ubuntuone-control-tower/ubuntu/lucid/ubuntuone-client/trunk into lp:ubuntu/lucid/ubuntuone-client
- Lucid (10.04)
- trunk
- Merge into lucid
Proposed by
dobey
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~ubuntuone-control-tower/ubuntu/lucid/ubuntuone-client/trunk |
Merge into: | lp:ubuntu/lucid/ubuntuone-client |
Diff against target: |
486 lines (+151/-63) 12 files modified
bin/ubuntuone-preferences (+4/-3) configure (+10/-10) configure.ac (+1/-1) debian/changelog (+11/-0) debian/patches/revert_string_change.patch (+0/-25) debian/rules (+0/-1) nautilus/contacts-view.c (+30/-8) nautilus/contacts-view.h (+3/-0) nautilus/u1-contacts-picker.c (+1/-1) nautilus/ubuntuone-nautilus.c (+52/-8) tests/syncdaemon/test_localrescan.py (+25/-0) ubuntuone/syncdaemon/local_rescan.py (+14/-6) |
To merge this branch: | bzr merge lp:~ubuntuone-control-tower/ubuntu/lucid/ubuntuone-client/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu branches | Pending | ||
Review via email: mp+23710@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 29. By Ken VanDine
-
releasing version 1.2.1-0ubuntu1
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/ubuntuone-preferences' |
2 | --- bin/ubuntuone-preferences 2010-04-15 15:20:43 +0000 |
3 | +++ bin/ubuntuone-preferences 2010-04-19 21:29:17 +0000 |
4 | @@ -210,8 +210,9 @@ |
5 | self.status_label = gtk.Label("") |
6 | self.attach(self.status_label, 0, 3, 2, 3) |
7 | |
8 | - self.description = gtk.Label(_("The following devices synchronize" |
9 | - " with your Ubuntu One account.")) |
10 | + self.description = gtk.Label(_("The devices connected to with your" |
11 | + " personal cloud network" |
12 | + " are listed below")) |
13 | self.description.set_alignment(0., .5) |
14 | self.description.set_line_wrap(True) |
15 | self.attach(self.description, 0, 3, 0, 1, xpadding=12, ypadding=12) |
16 | @@ -991,7 +992,7 @@ |
17 | services.pack_start(label, False, False) |
18 | label.show() |
19 | |
20 | - self.bookmarks_check = gtk.CheckButton(_("_Bookmarks (Firefox)")) |
21 | + self.bookmarks_check = gtk.CheckButton(_("_Bookmarks")) |
22 | self.bookmarks_check.set_data('dbname', 'bookmarks') |
23 | self.bookmarks_check.connect('toggled', self.__db_check_toggled) |
24 | services.pack_start(self.bookmarks_check, False, False) |
25 | |
26 | === modified file 'configure' |
27 | --- configure 2010-04-15 15:20:43 +0000 |
28 | +++ configure 2010-04-19 21:29:17 +0000 |
29 | @@ -1,6 +1,6 @@ |
30 | #! /bin/sh |
31 | # Guess values for system-dependent variables and create Makefiles. |
32 | -# Generated by GNU Autoconf 2.65 for ubuntuone-client 1.2.0. |
33 | +# Generated by GNU Autoconf 2.65 for ubuntuone-client 1.2.1. |
34 | # |
35 | # |
36 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
37 | @@ -698,8 +698,8 @@ |
38 | # Identity of this package. |
39 | PACKAGE_NAME='ubuntuone-client' |
40 | PACKAGE_TARNAME='ubuntuone-client' |
41 | -PACKAGE_VERSION='1.2.0' |
42 | -PACKAGE_STRING='ubuntuone-client 1.2.0' |
43 | +PACKAGE_VERSION='1.2.1' |
44 | +PACKAGE_STRING='ubuntuone-client 1.2.1' |
45 | PACKAGE_BUGREPORT='' |
46 | PACKAGE_URL='' |
47 | |
48 | @@ -1476,7 +1476,7 @@ |
49 | # Omit some internal or obsolete options to make the list less imposing. |
50 | # This message is too long to be a string in the A/UX 3.1 sh. |
51 | cat <<_ACEOF |
52 | -\`configure' configures ubuntuone-client 1.2.0 to adapt to many kinds of systems. |
53 | +\`configure' configures ubuntuone-client 1.2.1 to adapt to many kinds of systems. |
54 | |
55 | Usage: $0 [OPTION]... [VAR=VALUE]... |
56 | |
57 | @@ -1547,7 +1547,7 @@ |
58 | |
59 | if test -n "$ac_init_help"; then |
60 | case $ac_init_help in |
61 | - short | recursive ) echo "Configuration of ubuntuone-client 1.2.0:";; |
62 | + short | recursive ) echo "Configuration of ubuntuone-client 1.2.1:";; |
63 | esac |
64 | cat <<\_ACEOF |
65 | |
66 | @@ -1660,7 +1660,7 @@ |
67 | test -n "$ac_init_help" && exit $ac_status |
68 | if $ac_init_version; then |
69 | cat <<\_ACEOF |
70 | -ubuntuone-client configure 1.2.0 |
71 | +ubuntuone-client configure 1.2.1 |
72 | generated by GNU Autoconf 2.65 |
73 | |
74 | Copyright (C) 2009 Free Software Foundation, Inc. |
75 | @@ -1938,7 +1938,7 @@ |
76 | This file contains any messages produced by compilers while |
77 | running configure, to aid debugging if configure makes a mistake. |
78 | |
79 | -It was created by ubuntuone-client $as_me 1.2.0, which was |
80 | +It was created by ubuntuone-client $as_me 1.2.1, which was |
81 | generated by GNU Autoconf 2.65. Invocation command line was |
82 | |
83 | $ $0 $@ |
84 | @@ -2748,7 +2748,7 @@ |
85 | |
86 | # Define the identity of the package. |
87 | PACKAGE='ubuntuone-client' |
88 | - VERSION='1.2.0' |
89 | + VERSION='1.2.1' |
90 | |
91 | |
92 | cat >>confdefs.h <<_ACEOF |
93 | @@ -12972,7 +12972,7 @@ |
94 | # report actual input values of CONFIG_FILES etc. instead of their |
95 | # values after options handling. |
96 | ac_log=" |
97 | -This file was extended by ubuntuone-client $as_me 1.2.0, which was |
98 | +This file was extended by ubuntuone-client $as_me 1.2.1, which was |
99 | generated by GNU Autoconf 2.65. Invocation command line was |
100 | |
101 | CONFIG_FILES = $CONFIG_FILES |
102 | @@ -13038,7 +13038,7 @@ |
103 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
104 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
105 | ac_cs_version="\\ |
106 | -ubuntuone-client config.status 1.2.0 |
107 | +ubuntuone-client config.status 1.2.1 |
108 | configured by $0, generated by GNU Autoconf 2.65, |
109 | with options \\"\$ac_cs_config\\" |
110 | |
111 | |
112 | === modified file 'configure.ac' |
113 | --- configure.ac 2010-04-15 15:20:43 +0000 |
114 | +++ configure.ac 2010-04-19 21:29:17 +0000 |
115 | @@ -1,7 +1,7 @@ |
116 | dnl Process this file with autoconf to produce a configure script. |
117 | AC_PREREQ(2.53) |
118 | |
119 | -AC_INIT([ubuntuone-client], [1.2.0]) |
120 | +AC_INIT([ubuntuone-client], [1.2.1]) |
121 | AC_CONFIG_SRCDIR([config.h.in]) |
122 | |
123 | AM_INIT_AUTOMAKE([1.10 foreign]) |
124 | |
125 | === modified file 'contrib/__init__.pyc' |
126 | Binary files contrib/__init__.pyc 2010-04-15 15:20:43 +0000 and contrib/__init__.pyc 2010-04-19 21:29:17 +0000 differ |
127 | === modified file 'contrib/dbus_util.pyc' |
128 | Binary files contrib/dbus_util.pyc 2010-04-15 15:20:43 +0000 and contrib/dbus_util.pyc 2010-04-19 21:29:17 +0000 differ |
129 | === modified file 'contrib/testing/__init__.pyc' |
130 | Binary files contrib/testing/__init__.pyc 2010-04-15 15:20:43 +0000 and contrib/testing/__init__.pyc 2010-04-19 21:29:17 +0000 differ |
131 | === modified file 'contrib/testing/testcase.pyc' |
132 | Binary files contrib/testing/testcase.pyc 2010-04-15 15:20:43 +0000 and contrib/testing/testcase.pyc 2010-04-19 21:29:17 +0000 differ |
133 | === modified file 'debian/changelog' |
134 | --- debian/changelog 2010-04-16 17:54:41 +0000 |
135 | +++ debian/changelog 2010-04-19 21:29:17 +0000 |
136 | @@ -1,3 +1,14 @@ |
137 | +ubuntuone-client (1.2.1-0ubuntu1) UNRELEASED; urgency=low |
138 | + |
139 | + * New upstream release. |
140 | + - GetPublicFiles loop when unsuccessful (LP: #562443) |
141 | + - Local rescan deletse file on interrupted downloads (LP: #564774) |
142 | + - Unable to share with both existing and new contacts (LP: #563677) |
143 | + - Nautilus crash when contact has no name (LP: #566747) |
144 | + * Remove the string change reversion patch; merged upstream. |
145 | + |
146 | + -- Rodney Dawes <rodney.dawes@canonical.com> Mon, 19 Apr 2010 17:16:50 -0400 |
147 | + |
148 | ubuntuone-client (1.2.0-0ubuntu1) lucid; urgency=low |
149 | |
150 | * New upstream release. |
151 | |
152 | === removed directory 'debian/patches' |
153 | === removed file 'debian/patches/revert_string_change.patch' |
154 | --- debian/patches/revert_string_change.patch 2010-04-16 17:54:41 +0000 |
155 | +++ debian/patches/revert_string_change.patch 1970-01-01 00:00:00 +0000 |
156 | @@ -1,25 +0,0 @@ |
157 | -=== modified file 'bin/ubuntuone-preferences' |
158 | ---- old/bin/ubuntuone-preferences 2010-04-09 15:09:21 +0000 |
159 | -+++ new/bin/ubuntuone-preferences 2010-04-05 14:51:51 +0000 |
160 | -@@ -210,8 +210,9 @@ |
161 | - self.status_label = gtk.Label("") |
162 | - self.attach(self.status_label, 0, 3, 2, 3) |
163 | - |
164 | -- self.description = gtk.Label(_("The following devices synchronize" |
165 | -- " with your Ubuntu One account.")) |
166 | -+ self.description = gtk.Label(_("The devices connected to with your" |
167 | -+ " personal cloud network" |
168 | -+ " are listed below")) |
169 | - self.description.set_alignment(0., .5) |
170 | - self.description.set_line_wrap(True) |
171 | - self.attach(self.description, 0, 3, 0, 1, xpadding=12, ypadding=12) |
172 | -@@ -977,7 +978,7 @@ |
173 | - services.pack_start(label, False, False) |
174 | - label.show() |
175 | - |
176 | -- self.bookmarks_check = gtk.CheckButton(_("_Bookmarks (Firefox)")) |
177 | -+ self.bookmarks_check = gtk.CheckButton(_("_Bookmarks")) |
178 | - self.bookmarks_check.set_data('dbname', 'bookmarks') |
179 | - self.bookmarks_check.connect('toggled', self.__db_check_toggled) |
180 | - services.pack_start(self.bookmarks_check, False, False) |
181 | - |
182 | |
183 | === modified file 'debian/rules' |
184 | --- debian/rules 2010-04-16 17:54:41 +0000 |
185 | +++ debian/rules 2010-04-19 21:29:17 +0000 |
186 | @@ -3,7 +3,6 @@ |
187 | DEB_PYTHON_SYSTEM = pycentral |
188 | |
189 | include /usr/share/cdbs/1/rules/debhelper.mk |
190 | -include /usr/share/cdbs/1/rules/simple-patchsys.mk |
191 | include /usr/share/cdbs/1/rules/utils.mk |
192 | include /usr/share/cdbs/1/class/gnome.mk |
193 | |
194 | |
195 | === modified file 'nautilus/contacts-view.c' |
196 | --- nautilus/contacts-view.c 2010-04-15 15:20:43 +0000 |
197 | +++ nautilus/contacts-view.c 2010-04-19 21:29:17 +0000 |
198 | @@ -315,10 +315,12 @@ |
199 | EContact *contact = l->data; |
200 | const gchar *email = NULL; |
201 | GList *emails_list, *al; |
202 | + EContactName *contact_name; |
203 | + gchar *full_name = NULL; |
204 | |
205 | - /* We add the selected items when searching, so ignore them here */ |
206 | - if (g_hash_table_lookup (selection_hash, (gconstpointer) e_contact_get_const (contact, E_CONTACT_FULL_NAME))) |
207 | - continue; |
208 | + contact_name = (EContactName *) e_contact_get (contact, E_CONTACT_NAME); |
209 | + if (contact_name != NULL) |
210 | + full_name = e_contact_name_to_string (contact_name); |
211 | |
212 | emails_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); |
213 | for (al = emails_list; al != NULL; al = al->next) { |
214 | @@ -329,16 +331,28 @@ |
215 | break; |
216 | } |
217 | |
218 | + if (full_name == NULL) { |
219 | + if (email != NULL) |
220 | + full_name = g_strdup (email); |
221 | + else { |
222 | + g_warning ("Contact without name or email addresses"); |
223 | + continue; |
224 | + } |
225 | + } |
226 | + |
227 | + /* We add the selected items when searching, so ignore them here */ |
228 | + if (g_hash_table_lookup (selection_hash, (gconstpointer) full_name)) |
229 | + continue; |
230 | + |
231 | if (email != NULL) { |
232 | - add_one_contact (cv, |
233 | - e_contact_get_const (contact, E_CONTACT_FULL_NAME), |
234 | - e_contact_get_const (contact, E_CONTACT_FULL_NAME), |
235 | - email, |
236 | - contact); |
237 | + add_one_contact (cv, full_name, full_name, email, contact); |
238 | + cv->matched_contacts += 1; |
239 | } |
240 | |
241 | g_list_foreach (emails_list, (GFunc) e_vcard_attribute_free, NULL); |
242 | g_list_free (emails_list); |
243 | + e_contact_name_free (contact_name); |
244 | + g_free (full_name); |
245 | } |
246 | |
247 | g_signal_emit_by_name (cv, "contacts-count-changed", |
248 | @@ -396,6 +410,7 @@ |
249 | GError *error = NULL; |
250 | GSList *gl; |
251 | |
252 | + cv->matched_contacts = 0; |
253 | cv->selection = g_hash_table_new_full (g_str_hash, g_str_equal, |
254 | (GDestroyNotify) g_free, |
255 | (GDestroyNotify) free_selected_contact_info); |
256 | @@ -549,6 +564,7 @@ |
257 | /* Reset the icon views */ |
258 | gtk_list_store_clear (GTK_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (cv->recently_used_view)))); |
259 | gtk_list_store_clear (GTK_LIST_STORE (gtk_icon_view_get_model (GTK_ICON_VIEW (cv->alphabetical_view)))); |
260 | + cv->matched_contacts = 0; |
261 | |
262 | g_signal_emit_by_name (cv, "contacts-count-changed", |
263 | gtk_tree_model_iter_n_children (gtk_icon_view_get_model (GTK_ICON_VIEW (cv->alphabetical_view)), |
264 | @@ -600,6 +616,12 @@ |
265 | NULL); |
266 | } |
267 | |
268 | +guint |
269 | +contacts_view_get_matched_contacts_count (ContactsView *cv) |
270 | +{ |
271 | + return cv->matched_contacts; |
272 | +} |
273 | + |
274 | void |
275 | contacts_view_add_contact (ContactsView *cv, const gchar *contact_name, const gchar *contact_email) |
276 | { |
277 | |
278 | === modified file 'nautilus/contacts-view.h' |
279 | --- nautilus/contacts-view.h 2010-03-31 23:46:58 +0000 |
280 | +++ nautilus/contacts-view.h 2010-04-19 21:29:17 +0000 |
281 | @@ -48,6 +48,8 @@ |
282 | /* Widgets */ |
283 | GtkWidget *recently_used_view; |
284 | GtkWidget *alphabetical_view; |
285 | + |
286 | + guint matched_contacts; |
287 | } ContactsView; |
288 | |
289 | typedef struct { |
290 | @@ -64,6 +66,7 @@ |
291 | void contacts_view_search (ContactsView *cv, const gchar *search_string); |
292 | GSList *contacts_view_get_selected_emails (ContactsView *cv); |
293 | guint contacts_view_get_contacts_count (ContactsView *cv); |
294 | +guint contacts_view_get_matched_contacts_count (ContactsView *cv); |
295 | void contacts_view_add_contact (ContactsView *cv, const gchar *contact_name, const gchar *contact_email); |
296 | |
297 | #endif |
298 | |
299 | === modified file 'nautilus/u1-contacts-picker.c' |
300 | --- nautilus/u1-contacts-picker.c 2010-03-31 23:46:58 +0000 |
301 | +++ nautilus/u1-contacts-picker.c 2010-04-19 21:29:17 +0000 |
302 | @@ -84,7 +84,7 @@ |
303 | contacts_view_search (CONTACTS_VIEW (picker->priv->contacts_view), text); |
304 | |
305 | /* If no contacts offer the user to add it to the contacts database */ |
306 | - if (contacts_view_get_contacts_count (CONTACTS_VIEW (picker->priv->contacts_view)) == 0) |
307 | + if (contacts_view_get_matched_contacts_count (CONTACTS_VIEW (picker->priv->contacts_view)) == 0) |
308 | gtk_widget_show (picker->priv->add_contact_button); |
309 | else |
310 | gtk_widget_hide (picker->priv->add_contact_button); |
311 | |
312 | === modified file 'nautilus/ubuntuone-nautilus.c' |
313 | --- nautilus/ubuntuone-nautilus.c 2010-04-15 15:20:43 +0000 |
314 | +++ nautilus/ubuntuone-nautilus.c 2010-04-19 21:29:17 +0000 |
315 | @@ -164,6 +164,12 @@ |
316 | GHashTable * hash, |
317 | gchar * error, |
318 | gpointer user_data); |
319 | +static void ubuntuone_nautilus_got_public_files (DBusGProxy * proxy, |
320 | + GPtrArray * files, |
321 | + gpointer user_data); |
322 | +static void ubuntuone_nautilus_public_files_list_error (DBusGProxy * proxy, |
323 | + gchar * error, |
324 | + gpointer user_data); |
325 | static void ubuntuone_nautilus_share_created (DBusGProxy * proxy, |
326 | GHashTable * hash, |
327 | gpointer user_data); |
328 | @@ -1083,6 +1089,25 @@ |
329 | dbus_g_proxy_connect_signal (uon->u1_public, "PublicAccessChangeError", |
330 | G_CALLBACK (ubuntuone_nautilus_publish_error), |
331 | uon, NULL); |
332 | + |
333 | + dbus_g_proxy_add_signal (uon->u1_public, "PublicFilesList", |
334 | + dbus_g_type_get_collection ("GPtrArray", |
335 | + dbus_g_type_get_map |
336 | + ("GHashTable", |
337 | + G_TYPE_STRING, |
338 | + G_TYPE_STRING)), |
339 | + G_TYPE_INVALID); |
340 | + dbus_g_proxy_connect_signal (uon->u1_public, "PublicFilesList", |
341 | + G_CALLBACK (ubuntuone_nautilus_got_public_files), |
342 | + uon, NULL); |
343 | + |
344 | + dbus_g_proxy_add_signal (uon->u1_public, "PublicFilesListError", |
345 | + G_TYPE_STRING, |
346 | + G_TYPE_INVALID); |
347 | + dbus_g_proxy_connect_signal (uon->u1_public, "PublicFilesListError", |
348 | + G_CALLBACK (ubuntuone_nautilus_public_files_list_error), |
349 | + uon, NULL); |
350 | + |
351 | } |
352 | |
353 | static void ubuntuone_nautilus_class_init (UbuntuOneNautilusClass * klass) { |
354 | @@ -1343,11 +1368,9 @@ |
355 | gpointer user_data) { |
356 | UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS (user_data); |
357 | gchar * status; |
358 | - gchar * is_online; |
359 | - gchar * is_connected; |
360 | + gboolean is_online; |
361 | |
362 | - is_online = g_hash_table_lookup (hash, "is_online"); |
363 | - is_connected = g_hash_table_lookup (hash, "is_connected"); |
364 | + is_online = g_strcmp0(g_hash_table_lookup (hash, "is_online"), "True") == 0; |
365 | status = g_hash_table_lookup (hash, "name"); |
366 | |
367 | /* Get the root when we get a status change signal, if we haven't yet */ |
368 | @@ -1362,14 +1385,13 @@ |
369 | ubuntuone_nautilus_got_udfs, uon, |
370 | NULL, G_TYPE_INVALID); |
371 | |
372 | -#if 0 |
373 | - /* The following code is disabled, for the time being. lp:562443 */ |
374 | /* Get the list of public files if we haven't already */ |
375 | - if (!uon->gotpubs) |
376 | + if (is_online && !uon->gotpubs) { |
377 | dbus_g_proxy_begin_call (uon->u1_public, "get_public_files", |
378 | ubuntuone_nautilus_end_dbus_call, uon, |
379 | NULL, G_TYPE_INVALID); |
380 | -#endif |
381 | + uon->gotpubs = TRUE; |
382 | + } |
383 | } |
384 | |
385 | static void ubuntuone_nautilus_upload_started (DBusGProxy * proxy, |
386 | @@ -1505,6 +1527,28 @@ |
387 | ubuntuone_nautilus_file_published (proxy, hash, user_data); |
388 | } |
389 | |
390 | +static void ubuntuone_nautilus_got_public_files (DBusGProxy * proxy, |
391 | + GPtrArray * files, |
392 | + gpointer user_data) { |
393 | + UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS (user_data); |
394 | + int i; |
395 | + |
396 | + g_hash_table_remove_all (uon->public); |
397 | + for (i = 0; i < files->len; i++) |
398 | + g_hash_table_insert (uon->public, |
399 | + g_strdup (g_hash_table_lookup (files->pdata[i], "path")), |
400 | + g_strdup (g_hash_table_lookup (files->pdata[i], "public_url"))); |
401 | +} |
402 | + |
403 | +static void ubuntuone_nautilus_public_files_list_error (DBusGProxy * proxy, |
404 | + gchar * error, |
405 | + gpointer user_data) { |
406 | + UbuntuOneNautilus * uon = UBUNTUONE_NAUTILUS (user_data); |
407 | + /* the get_public_files call failed. We unset gotpubs, so the call |
408 | + is retried when the syncdaemon next tells us it's online */ |
409 | + uon->gotpubs = FALSE; |
410 | +} |
411 | + |
412 | static void ubuntuone_nautilus_share_created (DBusGProxy * proxy, |
413 | GHashTable * hash, |
414 | gpointer user_data) { |
415 | |
416 | === modified file 'tests/syncdaemon/test_localrescan.py' |
417 | --- tests/syncdaemon/test_localrescan.py 2010-04-15 15:20:43 +0000 |
418 | +++ tests/syncdaemon/test_localrescan.py 2010-04-19 21:29:17 +0000 |
419 | @@ -1484,6 +1484,31 @@ |
420 | self.startTest(check) |
421 | return self.deferred |
422 | |
423 | + def test_SERVER_no_file(self): |
424 | + """We just queued the Download, and it was interrupted.""" |
425 | + # create the file in metadata |
426 | + path = os.path.join(self.share.path, "a") |
427 | + mdid = self.fsm.create(path, self.share.volume_id, is_dir=False, node_id="uuid") |
428 | + partial_path = os.path.join(self.fsm.partials_dir, |
429 | + mdid + ".u1partial." + os.path.basename(path)) |
430 | + |
431 | + # this mimic Sync.get_file |
432 | + self.fsm.set_by_mdid(mdid, server_hash="blah-hash-blah") |
433 | + self.fsm.create_partial("uuid", self.share.volume_id) |
434 | + |
435 | + # now, for some reason, we lose the partial file |
436 | + os.remove(partial_path) |
437 | + |
438 | + def check(_): |
439 | + """arrange the metadata so later server_rescan will do ok""" |
440 | + self.assertEqual(self.eq.pushed, []) |
441 | + mdobj = self.fsm.get_by_mdid(mdid) |
442 | + self.assertFalse(mdobj.info.is_partial) |
443 | + self.assertEqual(mdobj.server_hash, mdobj.local_hash) |
444 | + |
445 | + self.startTest(check) |
446 | + return self.deferred |
447 | + |
448 | def test_SERVER_file_content(self): |
449 | """We were downloading the file, but it was interrupted, and changed""" |
450 | # create the file in metadata |
451 | |
452 | === modified file 'ubuntuone/syncdaemon/local_rescan.py' |
453 | --- ubuntuone/syncdaemon/local_rescan.py 2010-04-15 15:20:43 +0000 |
454 | +++ ubuntuone/syncdaemon/local_rescan.py 2010-04-19 21:29:17 +0000 |
455 | @@ -507,17 +507,25 @@ |
456 | else: |
457 | events.append(('FS_FILE_DELETE', fullname)) |
458 | else: |
459 | - if changed not in ("SERVER", "NONE", "LOCAL"): |
460 | + if changed == 'SERVER': |
461 | + # download interruped and partial lost |
462 | + log_debug("comp yield: file %r not in disk, in SERVER " |
463 | + "state, without partial!", fullname) |
464 | + mdobj = self.fsm.get_by_path(fullname) |
465 | + self.fsm.set_by_mdid(mdobj.mdid, |
466 | + server_hash=mdobj.local_hash) |
467 | + self.fsm.remove_partial(mdobj.node_id, mdobj.share_id) |
468 | + elif changed in ('NONE', 'LOCAL'): |
469 | + # if it had content somewhen, now is really gone (otherwise |
470 | + # it was never really created in the disk) |
471 | + log_info("comp yield: file %r is gone!", fullname) |
472 | + events.append(('FS_FILE_DELETE', fullname)) |
473 | + else: |
474 | # bad metadata |
475 | m = "Bad 'changed': removing MD from file %r" |
476 | log_debug(m, fullname) |
477 | self.fsm.delete_metadata(fullname) |
478 | - continue |
479 | |
480 | - # if it had content somewhen, now is gone (otherwise it was |
481 | - # never really created in the disk) |
482 | - log_info("comp yield: file %r is gone!", fullname) |
483 | - events.append(('FS_FILE_DELETE', fullname)) |
484 | return events, to_scan_later |
485 | |
486 | def _paths_filter(self, shrinfo, dirpath, len_shr_path): |