Bugzilla – Attachment 49550 Details for
Bug 116240
beagle can lose track of copied files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
yet another patch
10-bnc-116240-better-handling-of-copied-files.patch (text/x-patch), 2.20 KB, created by
Jon Trowbridge
on 2005-09-11 21:55:02 UTC
(
hide
)
Description:
yet another patch
Filename:
MIME Type:
Creator:
Jon Trowbridge
Created:
2005-09-11 21:55:02 UTC
Size:
2.20 KB
patch
obsolete
>? beagled/ps >Index: beagled/FileSystemQueryable/FileSystemQueryable.cs >=================================================================== >RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/FileSystemQueryable.cs,v >retrieving revision 1.85 >diff -u -p -r1.85 FileSystemQueryable.cs >--- beagled/FileSystemQueryable/FileSystemQueryable.cs 9 Sep 2005 19:47:28 -0000 1.85 >+++ beagled/FileSystemQueryable/FileSystemQueryable.cs 11 Sep 2005 21:53:17 -0000 >@@ -967,11 +967,25 @@ namespace Beagle.Daemon.FileSystemQuerya > if (filter.Ignore (dir, name, false)) > return; > >- // 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 = Guid.NewGuid (); >+ // If this file already has extended attributes, >+ // make sure that the name matches the file >+ // that is in the index. If not, it could be >+ // a copy of an already-indexed file and should >+ // be assigned a new unique id. >+ Guid unique_id = Guid.Empty; >+ FileAttributes attr; >+ attr = FileAttributesStore.Read (path); >+ if (attr != null) { >+ LuceneNameResolver.NameInfo info; >+ info = name_resolver.GetNameInfoById (attr.UniqueId); >+ if (info != null >+ && info.Name == name >+ && info.ParentId == dir.UniqueId) >+ unique_id = attr.UniqueId; >+ } >+ >+ if (unique_id == Guid.Empty) >+ unique_id = Guid.NewGuid (); > > RegisterId (name, dir, unique_id); > >Index: beagled/FileSystemQueryable/LuceneNameResolver.cs >=================================================================== >RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/LuceneNameResolver.cs,v >retrieving revision 1.2 >diff -u -p -r1.2 LuceneNameResolver.cs >--- beagled/FileSystemQueryable/LuceneNameResolver.cs 10 Aug 2005 19:22:41 -0000 1.2 >+++ beagled/FileSystemQueryable/LuceneNameResolver.cs 11 Sep 2005 21:53:17 -0000 >@@ -116,7 +116,8 @@ namespace Beagle.Daemon.FileSystemQuerya > public override void Collect (int id, float score) > { > if (MatchId != -1) >- throw new Exception ("What you talkin' about Willis?"); >+ Logger.Log.Error ("Duplicate name found: replacing MatchId {0} with {1}", >+ MatchId, id); > > MatchId = 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
Attachments on
bug 116240
:
49463
| 49550