views:

548

answers:

2

I'm working on building a website using Magento eCommerce. I set up a subversion repo on the server for the website including all Magento PHP files and checked out a copy to my local system using svn/webdav. I've added magento to the repo and committed. Now, any svn opearation, even an svn status or svn commit, building the list of files so I can enter a commit message, takes forever. I mean upwards of 10 minutes, even if I only changed one file. Any ideas on what could be wrong/how to troubleshoot/how to fix/suggestions? Thanks!

+5  A: 

I've been working with Magento + SVN(not WebDAV however) myself and didn't have those kind of problems so far. It takes long(as in 2 min) to commit changes to the repository but by no means more than 5 min.

I don't really know the cause of your problem, I just more or less wanted to say that it's usually not like that(or that it might be WebDAV's fault).

Workaround 1:

Assuming that you won't be making changes to the core of Magento, have you considered only versioning those parts of your Magento installation that will be changed by you? i.e. the app/code/local folder where your modules will reside and maybe your template folder. This would drastically reduce the total number of versioned files/folders and thereby significantly increase the synchonizing speed.

Workaround 2:

Always commit only the downmost folder that contains all the updates.

cd app/code 
svn commit -m ".." local

Workaround 3:

Similar to number 1: Try to add everything that doesn't need to be stored in the repo to the ignore list. Things like the var/ folder don't need to be versioned and contain a lot of files, so it might be a good idea not to include them to your repository.

Workaround 4:

Use git instead of SVN if that is an option for you.

eZ Components had the same problems with SVN + WebDAV and someone compared the checkout times between SVN+DAV with git. The results can be seen here.

After seeing those numbers, I think switching is your best available option in the long run.

André Hoffmann
@Andre, thanks! That's helpful. Do you have the whole magento install under svn or just the app/code/local folder? I'm not sure what parts of the core I'll be changing yet...
Josh
I have everything versioned. I'd recommend not changing anything in the core as it makes updating very hard.Then again you'll sometimes come into situations where no Magento event can help you and you have to introduce a new event to the Magento core and there's no other way to do this but to do it manually.
André Hoffmann
I've tried not to modify the core as I want to avoid updating headaches. But I have it versioned so that if I do modify the core, svn will help me merge my changes into the next version.
Josh
André Hoffmann
+1, You're right, and that does help when I can do that. Sadly I have about 5 directories on the root level and often I need to commit from all at once. (Or, not "need to" but "want to" :-)
Josh
Could you elaborate on what those directories are? Because personally I only make changes to the app folder. And also: Did you try it without WebDAV? Do you need WebDAV?
André Hoffmann
The directories are for custom parts of the app I'm developing. an ajax/ directory, an inc/ directory, a tools/ directory, and a data/ directory. I've also added custom JS and CSS files under app/. I haven't tried without webdav but I believe I need webdav -- the repo is hosted remotely and my team and I collaborate. (My team is remote)
Josh
How about using git? It can also be used with WebDAV: http://kaeso.wordpress.com/2008/02/02/git-repository-with-apache-via-webdav-and-gitweb/
André Hoffmann
I tried using git for this just now and it essentially doubles the file size of the installation folder. Although it is slower than other projects because of the large file size, initial commits took maybe 30 seconds and the initial push took about a minute.
jimiyash
+1  A: 

All Magento work can be done without touching a single core file which is the way you should do it (except perhaps for the locale files since those are easy to merge).

I have written a script which lets you scatter your project files all over Magento's installation root without increasing the difficulty of managing your source code (and without checking in a single Magento core file). How does it work? Soft links. You could actually accomplish the same without my script by creating soft links by hand, but this just makes it easier (deployment/update to a live server is always one command).

I'm not sure about Windows support, it could work within cygwin but I haven't tested. I do development on Windows but run a virual machine (VirtualBox) with my LAMP stack on it sharing the files with the Windows via Samba so I run the script via command line on the Linux guest and edit my files with Netbeans via the Samba share (and I can commit changes via Netbeans' subversion module).

See my blog post for further info: Module Manager
Go straight to the source: Module Manager (via gist)

ColinM