ASP.NET - SVN web upload front ent?
I'd like to add an area/page that allows users to upload files to SVN. I've seen SharpSVN, which looks promising, but I'm wondering how well it handles conflicts, etc.
One approach would be to use SharpSVN to update the site's local copy of the repo, save the uploaded file received from the browser, and then commit, however I'm wondering how stable this will be when multiple users try to access the same file at (approximately) the same time. Other than manua开发者_如何学编程lly implementing some sort of locking mechanism, what's a good way to solve this problem?
Oh, and if anyone has a pre-existing solution or a good tutorial, I'd love to see it.
Note: I'm not looking for a Visual Studio plugin; this needs to be entirely web based as we're using svn for document sharing, and I prefer not to require each user to install Tortoise or the command line svn client.
The best thing might be to create a WebDav Configuration for Subversion which supports auto commit of documents which are stored on the appropriate drives. In Windows this means to have a supplemental drive which is the WebDav store and in the back-end a Subversion directory. Every time someone stores something on that drive it will do automatically a commit. But thy not installing TortoiseSVN on the machines...that's the better solution in my opinion.
To answer directly, you're not going to get a web upload front-end.
SVN acts on sub-portions of file systems (directory trees), and not on files. HTTP upload acts on files, and not directory trees.
If a SVN web front end existed, it would be limited to a subset of SVN functionality. Unfortunately, that subset is so small it robs SVN of most of it's power. How are you going to capture permission changes? How are you going to associate the change in this file with the set of changes needed for this file to integrate into the project? I'm sure a solution could be found with enough web development time; however, better solutions than those which could be built already exist. Use them.
TortiseSVN will bind a windows folder hierarchy to a SVN project. WebDav will bind a WebDav client to a SVN project. The svn (client) command line tools will bind a directory tree to a SVN project. Plug-ins for nearly every major IDE exist.
Choose the solution that best fits your working environment; as they all integrate with SVN as it was meant to be used. HTTP was designed far before SVN, and it is limited in it's ability to push information to the web server. Trying to "submit" a diff of the directory tree and all of it's contents is one item where HTTP just lacks sufficient framework to do the job without a lot of workarounds (which means instability and oddness as it doesn't act like HTTP).
I managed to get this to work using a pretty standard file upload page and a db-resident semaphore.
精彩评论