diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-01-20 18:28:46 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-01-20 18:34:25 +0000 |
commit | 41e3c12c6540548bd5b847e6340504d3c0a6e7fd (patch) | |
tree | 2db155978680cbfa1dabcfe1f3d6592d06aa492a /lorry | |
parent | ab196c1135af59e4c695d098fb3c505beecb337d (diff) | |
download | lorry-41e3c12c6540548bd5b847e6340504d3c0a6e7fd.tar.gz |
lorry: svn add branches and tags after clone
Glob expressions can be used to specify branches, but git svn clone/init will append /* to
them unless they have a * in them. It is possible to have globs without.
netpbm has branches in its root directory, so the glob
{advanced,stable,super-stable} should select only those directories
as branches, but they become {a,s,ss}/*, so subdirectories of each become
branches
The workaround is to manually add the glob expression to config
so it is cloned then branches are added, then re fetched
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -166,16 +166,23 @@ class Lorry(cliapp.Application): spec['url'], gitdir]) else: layout = spec["layout"] + # git-svn will append /* to branches or tags that don't + # already have one, this does not work with {a,b} globs self.run_program(['git', 'svn', 'clone', spec['url'], gitdir, - '--tags', layout["tags"], - '--trunk', layout["trunk"], - '--branches', layout["branches"]]) + '--trunk', layout["trunk"]]) + self.run_program(['git', 'config', 'svn-remote.svn.branches', + layout["branches"] + ':refs/remotes/*'], + cwd=gitdir) + self.run_program(['git', 'config', 'svn-remote.svn.tags', + layout["tags"] + ':refs/remotes/tags/*'], + cwd=gitdir) + self.run_program(['git', 'svn', 'fetch'], cwd=gitdir) else: self.progress('.. updating existing clone') # update the remote tracking branch self.run_program(['git', 'svn', 'fetch'], cwd=gitdir) # update the master branch with these changes - self.run_program(['git', 'svn', 'rebase'] cwd=gitdir + self.run_program(['git', 'svn', 'rebase'], cwd=gitdir) def gitify_cvs(self, dirname, gitdir, spec): self.run_program(['git', 'cvsimport', '-d', spec['url'], |