[Zope-dev] Buildout + svn:externals for different users - how?

Marius Gedminas marius at gedmin.as
Tue Sep 16 08:45:48 EDT 2008


On Tue, Sep 16, 2008 at 01:03:43PM +0200, Hermann Himmelbauer wrote:
> We are two people who work at the same project (with the same buildout). I 
> have SVN write access to svn.zope.org, my colleague does not (which is o.k. 
> as he does not need to).
> 
> As I need to develop some SVN packages from svn.zope.org, I'd like to put them 
> in my buildout/src tree and reference them via svn:externals. However, I need 
> to specify the SVN via "svn+ssh://myusername@svn.zope.org/...". If I do so, 
> my colleague cannot use the buildout.
> 
> Modifying the .ssh/config with 
> Host svn.zop.org
> USER 
> 
> does also not work as he has no user.
> 
> What's a suitable solution to this?

Use anonymous SVN in svn:externals (svn://svn.zope.org/...).  Then, if
you find that you need to modify something (usually when svn commit
aborts with an error), do a quick svn switch to the svn+ssh URL, commit,
then switch back.

I have a couple of scripts for this:

    mg at platonas:~ $ cat bin/switch-to-readonly 
    #!/bin/bash
    # Switch between svn://... and svn+ssh://... in subversion sandboxes
    [ -d .svn ] || {
      echo "This is not a subversion working directory." 1>&2
      exit 1
    }
    url=`svn info $1|grep URL|cut -d ' ' -f 2-`
    schema=${url%%://*}
    rest=${url#*://}
    [ "$schema" != "svn+ssh" ] && {
      echo "Repository URL doesn't begin with svn+ssh://"
      exit 1
    }
    newurl=svn://$rest
    svn switch --relocate $url $newurl $1

    mg at platonas:~ $ cat bin/switch-to-editable 
    #!/bin/bash
    # Switch between svn://... and svn+ssh://... in subversion sandboxes
    [ -d .svn ] || {
      echo "This is not a subversion working directory." 1>&2
      exit 1
    }
    url=`svn info $1|grep URL|cut -d ' ' -f 2-`
    schema=${url%%://*}
    rest=${url#*://}
    [ "$schema" != "svn" -a "$schema" != "http" ] && {
      echo "Repository URL doesn't begin with svn:// or http://"
      exit 1
    }
    svn switch --relocate $url svn+ssh://$rest $1

Marius Gedminas
-- 
A programmer started to cuss
Because getting to sleep was a fuss
As he lay there in bed
Looping 'round in his head
was: while(!asleep()) sheep++;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20080916/1ddeb794/attachment.bin 


More information about the Zope-Dev mailing list