Forum: IronRuby Codeplex workitem 6118: Requesting Code Review

95ca4d50eb621775a70d75de79c5df33?d=identicon&s=25 Orion Edwards (Guest)
on 2011-05-25 06:07
(Received via mailing list)
As mentioned in the bug http://ironruby.codeplex.com/workitem/6118 ,
IronRuby .rbproj files have some severe problems when working with
source-controlled projects.

I discovered that one of the major causes of this was the way that the
DLR's DirectoryBasedProjectNode was handling add/rename/delete
operations
from the filesystem.
When it would get one of these notifications, it would immediately
add/remove/rename the file. If the project was bound to source control,
this would pend a correpsonding add/remove/rename change to the source
control provider.

Unfortunately, some external editors, diff/merge tools, and source
control
providers (in particular the Team Foundation Server one) implement
"atomic
saves" by writing to a .tmp file, deleting the original file, and then
moving the .tmp file into place.
This causes visual studio to pend an "add" on a .tmp file which doesn't
exist, pend a "rename" on that file, and then pend a "delete" on the
original file. The first two operations seem to get ignored by the TFS
source control provider, but the delete does not.

This leads to the bizarre circumstance where performing a TFS
"get-latest"
operation will pend deletes on any files that have been updated.

The following commit fixes this issue by implementing a "throttle"
mechanism.
 - When a file system operation occurs, it queues a "file update"
operation keyed by the file path and kicks an 0.2 second dispatcher
timer.

 - Subsequent operations push back this timer so it will only fire after
0.2 seconds of idle time
 - When the timer fires, it runs each "file update" operation, but only
if
it would still be valid
      (eg: an "add" operation will only be run if the file still
actually
exists after the 0.2 seconds)

I have been using this modified code for a week now and while it
certainly
doesn't fix all the issues with .rbproj files, it does fix the "pend
deletes" problem, and overall the project is much more stable. It does
not
seem to have caused any adverse effects.

Link:

https://github.com/gglresearchanddevelopment/ironl...
###########################################################################
This e-mail is confidential and may contain information subject to legal
privilege.  If you are not the intended recipient please advise us of
our
error by return e-mail then delete this e-mail and any attached files.
You may not copy, disclose or use the contents in any way.

The views expressed in this e-mail may not be those of Gallagher Group
Ltd or subsidiary companies thereof.
###########################################################################
959b1c9d700abfc065f5f40bf5a966a2?d=identicon&s=25 James Schementi (jschementi)
on 2011-05-25 16:29
(Received via mailing list)
Orion,

I'll review this change shortly and let you know if I have any feedback.

~Jimmy
This topic is locked and can not be replied to.