Having recently taken the plunge in to WordPress plugin development, I decided to offer one to the community and become ‘official’. To do so one must be at least somewhat familiar with the idea of version control, but then I needed to dig in to the system WP uses, Apache Subversion.
Not even being acquainted I first needed to find out about it and could I run it on a Mac. In short order I discovered that Apple installs Subversion on every Mac. Wonderful! Or. . . not. Maybe they used to, but today it’s part of the Xcode library which is not automatically installed on Macs, but it is a free developer library. Okay no prob. Except, ummmm, I’m still using Mountain Lion (yeah, yeah, I know) for my main production machine and Apple no longer makes Xcode available for that OS. After some digging I discovered it’s possible to install Subversion on a Mac via a number of different methods of which I chose to install Homebrew to handle this task. Done!
Time to read up on how Subversion works and what it does.
Subversion is a command line tool. I can do command line stuff but much prefer a GUI when ever possible. More digging, and I discover the awesome Mac community comes through with an open source offering (among the many purchase-able options) in SvnX, which is also pretty highly rated to boot. After downloading and installing, I then poke around at SvnX for a while to get a feel for how it works in relation to Subversion.
There was also reading to do on what WP has to say about how they use Subversion.
After hours of careful reading and research it was finally time to give it a shot. Using my WP credentials and the location of my newly attained plugin repository, I was able to log in and ‘check out’ the empty project. Worked like a charm, creating the necessary folders where I directed. Then per WP instructions I needed to copy my files in to the ‘working copy’ trunk folder and then commit the changes (or, upload the files). But, I kept getting an authentication error, which was completely unexpected since I just used those same credentials to log in and initiate all of this. Back to searching.
After an hour and numerous attempts to get it york I came up empty handed. So I opted to quit SvnX and restart in hopes that for some reason my credentials I had entered were not getting written to a config file somewhere which was affecting this. That did seem to be what was happening. But when I opened the working files window again, this time I got an error that the current version of Subversion wasn’t high enough to work on those files. The very files it had created not an hour earlier. Back to searching.
All I could find was something indicating this error was caused by trying out a newer version of Subversion, and then going back to a previous version, which I had not done. I checked and had the absolute latest version installed. So forget that, I’ll ‘check out’ the project again and let it work with a fresh copy. None doing. There was a hidden project file that wouldn’t allow that. Grrrrr. . . . So I delete the entire folder structure, recreate the base folder, then ‘check out’ the project again. This time it worked. I re-copied my files in to the trunk folder.
I need to mention during all of my searching I read that there are 2 ‘commit’ buttons in SvnX, one on the ‘working copy’ main window, and then another on the review window, which is the method someone associated with SvnX said to use.
So time to try it again and this time with the review button. Success!
Hopefully something here will help someone struggling with this same problem.
Leave a comment, or trackback from your own site.