View | Details | Raw Unified | Return to bug 116240
Collapse All | Expand All

(-)beagled/FileAttributesStore.cs (-5 / +4 lines)
Lines 52-68 namespace Beagle.Daemon { Link Here
52
				created = false;
52
				created = false;
53
53
54
				FileAttributes attr = ifas.Read (path);
54
				FileAttributes attr = ifas.Read (path);
55
				if (attr == null) {
55
				// If we pass in a Guid that doesn't match the one we found in the
56
				// the attributes, clobber the old attributes and the old unique Guid.
57
				if (attr == null
58
				    || (unique_id != Guid.Empty && unique_id != attr.UniqueId)) {
56
					attr = new FileAttributes ();
59
					attr = new FileAttributes ();
57
					attr.UniqueId = unique_id;
60
					attr.UniqueId = unique_id;
58
					attr.Path = path;
61
					attr.Path = path;
59
					ifas.Write (attr);
62
					ifas.Write (attr);
60
					created = true;
63
					created = true;
61
				}
64
				}
62
				// FIXME: If we were able to successfully read attributes,
63
				// and if attr.UniqueId != unique_id, it probably means
64
				// that something bad happened.  Right?  Should we throw
65
				// an exception?
66
				return attr;
65
				return attr;
67
			}
66
			}
68
		}
67
		}
(-)beagled/FileSystemQueryable/FileSystemQueryable.cs (-4 / +4 lines)
Lines 967-977 namespace Beagle.Daemon.FileSystemQuerya Link Here
967
			if (filter.Ignore (dir, name, false))
967
			if (filter.Ignore (dir, name, false))
968
				return;
968
				return;
969
969
970
			FileAttributes attr;
970
			// We unconditionally assign this file a new Guid.
971
			attr = FileAttributesStore.Read (path);
971
			// (If it is a copy of an already-indexed file,
972
972
			// we need to clobber the old Guid.)
973
			Guid unique_id;
973
			Guid unique_id;
974
			unique_id = (attr != null) ? attr.UniqueId : Guid.NewGuid ();
974
			unique_id = Guid.NewGuid ();
975
975
976
			RegisterId (name, dir, unique_id);
976
			RegisterId (name, dir, unique_id);
977
977

Return to bug 116240