When "drush rsync" is run, the rsync flag --exclude=".svn" is added. May I ask why Subversion files were specifically excluded?

I can't seem to find a way to override this flag. Unless there is a really good reason, I need to have those subdirectories copied over also. How can I include them?

(In my particular case, I can't do an 'svn up' on the target server.)

Comments

jonhattan’s picture

The really good reason is to not expose .svn in a production server. So we asume the usecase for rsync @dev @prod. Haven't tested but perhaps --include-paths does an override.

greg.1.anderson’s picture

vcs files are excluded from rsync by default because it would be a Really Bad Thing to copy them over if the files were stored in a different repository on each machine. Copying the vcs files only makes sense if the files are stored in the same repository, but if that is the case, then usually one would use the vcs to transfer the files.

There is something odd about your use case. You say that you can't do an svn up on the target server; if that is the case, then why do you need to transfer the vcs files as part of the rsync operation? If you can't use the vcs, seems you wouldn't need them.

Perhaps this is why there is no option to suppress the --exclude=".svn" etc. in drush rsync.

dpearcefl’s picture

In our case, yes they are pointed at the same repository.

Yes, I suppose I could use SVN to update the taget server, except we don't have the entire site in SVN. "drush rsync" does such a marvelous job I was hoping to use it, rather than struggle to make rsync work over SSH (I'm not a Linux super-pro). This is the only reason I can't use rsync to the target server.

--include-path (or --include-paths) does not override the hardcoded rsync --exclude=".svn" command.

Our SVN server is a public purchased account so the source and target are "exposed" already.

If a flag in Drush to override the --exclude is not safe or feasible, I guess I'll have to see how to make rsync work over SSH.

greg.1.anderson’s picture

rsync already works over ssh. Run your rsync command with -s and look at the shell command it prints out. You can copy and modify this command to make it do a remote svn up on your remote server if you want.

greg.1.anderson’s picture

Oh, and it would be feasible -- easy, even, to add --include-vcs as a flag to drush rsync. I'm just not sure why you want to transfer the vcs files if you are using rsync instead of svn on the remote server.

dpearcefl’s picture

Status: Active » Closed (works as designed)

I'm going to mark this as closed as I guess my use-case is too weird. I wanted to use "drush rsync" for no defensible reason, but I can use just rsync itself to get the job done.

Here is what I did: I ran my "drush rsync" command but added the --debug flag. Amongst everything it prints out is the rsync command line it is running. I killed the command and then copied the command line into my script. I removed the "--exclude=".svn" part of the command. This worked perfectly for me. Now I can do "svn status -u" and see that my local copy is in sync with my SVN repository.

Thanks everyone.

greg.1.anderson’s picture

Title: Why are ".svn" folders excluded when an rsync is performed? » Drush rsync should support a --include-vcs argument
Assigned: Unassigned » greg.1.anderson
Category: support » feature
Status: Closed (works as designed) » Active

Naw, that's a reasonable use case.

Regarding your workaround, you might want to consider using regular rsync with drush dd if you want to sync things like %files. I'll add your --include-vcs args sometime; trivial change, just need to test it and make sure it works okay.

willieseabrook’s picture

I've found this issue because I share a similar use case.

Tried to override the exclude using --include="+.svn" and that don't appear to work.

willieseabrook’s picture

StatusFileSize
new850 bytes

Patch attached.

acrollet’s picture

hi folks,

just chipping in with another use case for this feature. At the agency where I work, we are using a development workflow with aegir wherein we build the production platform with a drush makefile, with custom code checked out of a VCS repository (svn at the present time). In order to do this, we build the platform on the command line with the --working-copy arg to drush_make and import it with provision-save. (as described by Miguel Jacq here: http://lists.aegirproject.org/pipermail/aegir/2011-January/000026.html)

All this works beautifully, except for the use case where the production platform is located on an Aegir satellite server. Aegir's hub & spoke model uses drush rsync to copy platforms to remote servers, and the lack of a --include-vcs flag to drush means that all our work up to this point was in vain.

The patch in #9 looks decent to me, I can do a proper review if it helps to move this issue along.

thanks,

Adrian

greg.1.anderson’s picture

Version: All-versions-4.2 » All-versions-4.x-dev
Assigned: greg.1.anderson » msonnabaum
Status: Active » Patch (to be ported)

Committed to 5.x-dev. Could optionally be backported to 4.x.

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

Yeah, I think this is pretty reasonable. Backported.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.