On 09/24/2010 01:34 PM, Gregory Jefferis wrote:

Non-interactive collaborative editing means that there can always be one
live version of a document to which anyone can apply changes that are
versioned, identified and much more likely.  Essentially it solves the
conflicting merge problem by automatically merging all the time so that you
are always looking at the latest version (and can be alerted to recent
changes).  You can try and do this with traditional version control
arrangements but you will always run into a conflict if the system isn't
designed for the possibility of interactive collaborative editing.

Surely the way this works could be mimicked with VC. What you need to have is some kind of push going on, so that, whenever a document is saved, it is /automatically/ VC'd. And then you need to have some kind of system for signalling when a new version has been committed. An even lower-tech solution would involve some kind of polling.

I think this would actually be relatively /easy/ to integrate into LyX. Here's the idea. When we have a version controlled file and "collaborative editing" is enabled, we run "svn up filename.lyx" in the background from time to time and see if we get anything back. This is not wholly trivial because we don't want to lose our local edits. But this could be handled by covertly saving the Buffer before doing svn up; we can backup the original and restore it if need be. Maybe the best way to do this would be to clone the local repository into LyX's temporary directory and do all the work there, only touching the "real" directory when the user saves the file. Anyway, something like that will work. What do we do, though, if there is a conflict between the newly saved file and the local edits? I guess we report the issue and give the user options, e.g., open both documents. In LyX 2.0, we could even use the new comparison feature to show the user the differences between them. Going the other way, we could commit all changes whenever they are saved, again reporting any issues we might run into. Then the most current version is always on the server.

This could almost be done without any changes to LyX. Here's how.
1. Set up a cron job that does "svn up filename.lyx" every two minutes.
2. Set up another cron job that watches filename.lyx and, if it changes, does "svn ci filename.lyx". If people aren't often editing the very same part of the document at the very same time, then this will work fine.

Richard

Reply via email to