MYDirectoryWatcher exception for repository in /tmp

Issue #28 resolved
Olivier Scherler
created an issue

When a repository that is located in /tmp is open in Murky, the following exception is thrown after a while (i.e. when Murky detects a directory change):

{{{ Uncaught exception: NSInvalidArgumentException *** -[NSCFSet addObject:]: attempt to insert nil

_NSSetRaiseInsertNilException (in Foundation) + 80
-[NSCFSet addObject:] (in Foundation) + 170
-[HgRepository _dirChanged:] (in Murky) (HgRepository.m:179)
-[MYDirectoryWatcher _notifyEvents:paths:flags:eventIDs:] (in Murky) (MYDirectoryWatcher.m:140)
directoryWatcherCallback (in Murky) (MYDirectoryWatcher.m:158)
implementation_callback_rpc (in CarbonCore) + 1607
_Xcallback_rpc (in CarbonCore) + 344
FSEventsD2F_server (in CarbonCore) + 109
FSEventsClientProcessMessageCallback (in CarbonCore) + 30
__CFMachPortPerform (in CoreFoundation) + 117
CFRunLoopRunSpecific (in CoreFoundation) + 3896
CFRunLoopRunInMode (in CoreFoundation) + 88

Please report this bug (you can copy & paste the text). }}}

Steps to reproduce:

{{{ cd /tmp mkdir test cd test hg init [open repository in Murky] touch dirchanged }}}

After a few seconds an alert with the exception above pops up.

Aparently it happens because {{{[path hasPrefix: base]}}} in {{{event.relativePath}}} (in {{{-[HgRepository _dirChanged:]}}}) returns false, because {{{watcher.path}}} is /tmp/test/ whereas {{{path}}} is /private/tmp/test/.hg/.

I guess it could happen in other situations where a symlinked directory is involved in the repository path.

Comments (3)

  1. Log in to comment