GSoC Project: Instantaneous status on Mac OS X

Michael Dippery mdippery at
Sun Mar 30 00:31:25 CDT 2008

Thank you! I have written a quick proposal that I'd like to share  
with the list, in order to get feedback. This is a "rough draft" so  
any feedback is much appreciated!

Michael Dippery
mdippery at


"Instantaneous status for Mercurial on Mac OS X"

Mercurial is a distributed version control system (VCS). Like any  
VCS, Mercurial manages changes to files. It does this by committing  
changes to a database, allowing the software to track changes,  
branches, and other information about files. To determine if a file  
has changed, Mercurial currently must traverse the entire directory  
tree (that is under version control), and compare each file to the  
"snapshot" stored in the database. However, when running on Linux,  
Mercurial has the ability to be informed of file system changes by  
the operating system, negating the need to traverse the entire  
directory tree when looking for changes. A similar feature will be  
implemented for Mac OS X.

Detailed description:
Mercurial currently includes an "inotify" extension, whose  
documentation is available at < 
index.cgi/InotifyExtension> This extension hooks into the inotify API  
on Linux-based systems. The extension consists of a daemon that  
registers for file system change notifications with the kernel. This  
daemon keeps track of any files that have changed since the last  
commit. When checking for the status of files under version control,  
Mercurial queries this daemon for file changes, instead of checking  
recursively for each file in the directory tree.

I plan to implement a similar extension for Mac OS X. Mac OS X also  
includes a way to listen to file system changes from the operating  
system. The extension for Mac OS X will be implented similarly to the  
inotify extension for Linux. It will consist of a daemon that  
registers for file system notifications from the operating system,  
then supplies that information to the Mercurial software when  
queried. Like the Linux extension, the Mac OS X daemon will be  
started manually, unless configured to start up automatically.

Since OS X's low-level file system information is written in C, I  
plan to implement this extension using C, and then use Python's  
bridging mechanism to allow the C functions to be called from Python  

When completed, this extension will greatly improve the run-time  
efficiency of Mercurial on Mac OS X. When looking for changed files,  
Mercurial will be able to quickly query the daemon, rather than  
traverse the entire directory tree to find files that have been  
changed since the last commit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : 

More information about the Mercurial-devel mailing list