integrating svn (subversion) with vi editor

hi,

I have installed subversion in my debian system.and is working properly with authentication.

my repository has only one workspace. and many authenticated users edit files in this.

my question is simple.

can we integrate svn with vi ,so that if anyone edits the file and make any changes to that & as soon as he exits vi , that file has to get comited automatically (with svn authentication). and if authentication fails. the file should not change..

is there any way we can do this..?

any suggestion would help..

:slight_smile:

There are three possibilities: 1. Create a wrapper script around vi. 2. Write autoload scripts and trigger scripts for vim. 3. Use the Linux iNotify feature.

1 is the most basic, but requires that all instances of vi (that users have access to) are moved to a special folder and replaced with soft-links to their new locations. It will still be (almost) impossible to prevent users from using the real editor, so you might be prepared for that.

2 requires everyone use and work with vim, which might be okay for you. The vim scripting language is powerful and you can benefit from complete control of the vim editor.

3 demands you use Linux or another OS with something like "inotify" which is a kernel feature. Processes can essentially tell the kernel "notify me if a file changes", and that process can for instance, so the svn commit. However, I don't know if you can control the aspect of user's login to svn.