Bugzilla – Attachment 49463 Details for
Bug 116240
beagle can lose track of copied files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
a fix for this bug
bnc-116240-dont-lose-copied-files.patch (text/plain), 2.02 KB, created by
Jon Trowbridge
on 2005-09-09 19:48:41 UTC
(
hide
)
Description:
a fix for this bug
Filename:
MIME Type:
Creator:
Jon Trowbridge
Created:
2005-09-09 19:48:41 UTC
Size:
2.02 KB
patch
obsolete
>Index: beagled/FileAttributesStore.cs >=================================================================== >RCS file: /cvs/gnome/beagle/beagled/FileAttributesStore.cs,v >retrieving revision 1.7 >diff -u -p -r1.7 FileAttributesStore.cs >--- beagled/FileAttributesStore.cs 10 Aug 2005 19:22:34 -0000 1.7 >+++ beagled/FileAttributesStore.cs 9 Sep 2005 19:44:06 -0000 >@@ -52,17 +52,16 @@ namespace Beagle.Daemon { > created = false; > > FileAttributes attr = ifas.Read (path); >- if (attr == null) { >+ // If we pass in a Guid that doesn't match the one we found in the >+ // the attributes, clobber the old attributes and the old unique Guid. >+ if (attr == null >+ || (unique_id != Guid.Empty && unique_id != attr.UniqueId)) { > attr = new FileAttributes (); > attr.UniqueId = unique_id; > attr.Path = path; > ifas.Write (attr); > created = true; > } >- // FIXME: If we were able to successfully read attributes, >- // and if attr.UniqueId != unique_id, it probably means >- // that something bad happened. Right? Should we throw >- // an exception? > return attr; > } > } >Index: beagled/FileSystemQueryable/FileSystemQueryable.cs >=================================================================== >RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/FileSystemQueryable.cs,v >retrieving revision 1.84 >diff -u -p -r1.84 FileSystemQueryable.cs >--- beagled/FileSystemQueryable/FileSystemQueryable.cs 7 Sep 2005 03:20:11 -0000 1.84 >+++ beagled/FileSystemQueryable/FileSystemQueryable.cs 9 Sep 2005 19:44:06 -0000 >@@ -967,11 +967,11 @@ namespace Beagle.Daemon.FileSystemQuerya > if (filter.Ignore (dir, name, false)) > return; > >- FileAttributes attr; >- attr = FileAttributesStore.Read (path); >- >+ // We unconditionally assign this file a new Guid. >+ // (If it is a copy of an already-indexed file, >+ // we need to clobber the old Guid.) > Guid unique_id; >- unique_id = (attr != null) ? attr.UniqueId : Guid.NewGuid (); >+ unique_id = Guid.NewGuid (); > > RegisterId (name, dir, unique_id); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 116240
: 49463 |
49550