Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have several virtual hosts setup, three of them pull files via SVN when needed(though only the trunk folder actually needs this), using SVN for other versions make for easy patch creation, or easy file replacement if i hack a core file.

enter image description here

My question is whether i can checkin a plugin from directly inside the plugins directory?

So take this plugin located in wp-content/plugins/post-ui-tabs for example.

enter image description here

Can i use that folder to house my WordPress.org plugin or does my plugin's folder need to mimic the directory structure of the SVN, eg..

  • brances/
  • tags/
  • trunk/

UPDATE:

Thanks for the feedback guys! All helpful in getting to understand local vs remote directory structure.

I've got my plugin up in the repo now, see here.
Post UI Tabs

Direct answer to my question, was Yes, i can do commits directly from my plugins folder, i simply have a typical local structure of wp-content/plugins/myplugin which is just a checkout of http://svn.wp-plugins.org/myplugin/trunk. I commit directly to trunk, then when i want to push a new version, i branch onto a tag(do that directly in Tortoise) and update the readme.txt stable tag to reference the new tag, ie. the operation creates the remote http://svn.wp-plugins.org/myplugin/tag/VER with all my files, and makes that available to uses, whilst my local working copy remains on trunk(i'll blog about it in the future when i've had more practice).

Easier then i thought!... thanks for all the advice guys.. all valuable pieces of information, Andy i felt your answer helped the most, so i'm giving you the accept, everyone else i still really appreciate your help, unfortunately i can only accept one answer... but thank you all the same.

share|improve this question
    
Hi Mark, did you ever write a blog post on that bit regarding tortoise & tagging? Just curious as I'm having the same questions here (win7/tortoisesvn), cheers :) –  Noel Tock Jan 23 '12 at 7:48
add comment

4 Answers

up vote 3 down vote accepted

I run a WordPress checkout of trunk, a branch, or a tag. This way I can switch WordPress versions easily:

svn sw http://svn.automattic.com/wordpress/trunk
svn sw http://svn.automattic.com/wordpress/tags/3.1

In wp-content/plugins I have a trunk checkout for each of my plugins:

cd wp-content/plugins
svn co http://plugins.svn.wordpress.org/stats/trunk/ stats

I do my work on the stats plugin (updating the changelog in the readme), then I commit directly from there:

emacs stats.php readme.txt
svn di stats.php readme.txt
svn ci stats.php readme.txt -m "stats: fixed issue with SSL"

When it's time to push a new version, I copy from trunk to the new tag:

svn cp http://plugins.svn.wordpress.org/stats/trunk/ http://plugins.svn.wordpress.org/stats/tags/4.2.1/ -m "stats: tag 4.2.1"

Finally I bump the stable tag in the readme and commit that to trunk.

emacs readme.txt
svn di readme.txt
svn ci readme.txt -m "stats: bump stable tag to 4.2.1"

I do all of this in Linux or Mac. In my former life as a Windows user, I'd SSH (PuTTY) into a Linux box or (last resort) virtualize Linux.

share|improve this answer
add comment

First of all, I'm also a beginner in SVN. I'm happy when it's working ;)

I'm not completely sure if I understand your question correctly. You have checked out the WordPress trunk and inside this working copy, you want to checkout a plugin from the WordPress plugin directory?

Well, I don't know if this is going to work - But you could store your wp-config.php and wp-content directory outside of your WordPress directory as explained by Otto in his article.

For example

Document Root: /var/www/

site1/
     wp-config.php
     wp-content/
         pluginA/ (svn-external to WordPress plugin repo)
         pluginB/ (svn-external to WordPress plugin repo)
         pluginC/ (local copy)
     wp-trunk/ (svn-external to WordPress trunk repo)
     wp-31/ (svn-external to WordPress branches repo)

This way you could checkout multiple versions of WordPress and all your desired plugins with svn-externals. The hole site1 could then also be stored in your own site1 svn repo so that your buddy only have to checkout this repo from your svn server.

share|improve this answer
add comment

Disclaimer - I am also beginner with SVN.

Is this possible?

Should be. I am using similar setup, just with WP checked out not from official repository.

Are externals what i'm looking for?

Nope. Externals are links between repositories. WP plugin repository ignores them for packaging downloads (so they are useless with it). And as I understand you are not going to need your plugin in multiple repositories.

Can i have an plugin repo inside an SVN'ed folder?

The folders are "SVNed" individually. Every folder has its own SVN meta info and there is no obligation for sub-folders to belong to one SVN with tree root. Just be attentive so that new files are added to repository they should be and such.

or does my plugin's folder need to mimic the directory structure of the SVN, eg..

Nope. You just commit your folder to trunk, then tag/branch trunk into tagged version when you have new release. That is of course if you don't need to retain older version of plugin on local computer.

I wish this were a simple case of reading the manual, but SVN does seem more geared toward non-windows users, and i'm struggling to find relevant info on anything that isn't clear.

I recently asked this question Any guides on using WP SVN with IDE clients? and from answers and poking around best manual type of thing that I found is documentation that comes with TortoiseSVN. It is for Windows and exactly for people who are not very much into command line SVN commands.

share|improve this answer
add comment

My question is whether i can checkin a plugin from directly inside the plugins directory?

By 'checkin' do you mean updating the plugin on wp.org (svn commit) or downloading the plugin from wp.org (svn checkout) ?

Plugins on wp.org do require the traditional trunk branches tags structure.

If you want to work on an svn checkout of a plugin within an svn checkout of wp core, you can checkout just the trunk folder:

svn checkout http://plugins.svn.wordpress.org/your-plugin-name/trunk/ wp-content/plugins/your-plugin-name/
share|improve this answer
    
do require the traditional [...] structure but it doesn't mean you need to replicate that structure locally (which is part of original question). Just commit arbitrary folder to repository trunk and then copy trunk to tag/version. Works for me so far (for whole one plugin and two tags at moment :) –  Rarst Apr 4 '11 at 16:43
    
Yeah, looking at the question again, I could have just answered "No, it's not necessary". :) –  scribu Apr 4 '11 at 16:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.