diff options
-rw-r--r-- | README | 1 | ||||
-rwxr-xr-x | lorry | 34 |
2 files changed, 28 insertions, 7 deletions
@@ -120,6 +120,7 @@ This is equivalent to Trunk is the path to the directory where the main branch is located. Branches and Tags are glob expressions to allow finer control over which paths are used. +Trunk is mandatory, but Branches and Tags are optional. Texlive keeps a lot of resources in their svn repository, we are only concerned with the source code, so this layout should select the correct subdirectory for each branch. @@ -436,15 +436,35 @@ class Lorry(cliapp.Application): # git-svn will convert branch, trunk and tag paths to allow this, # but it is simpler to disable it and do it manually self.run_program(['git', 'config', 'svn-remote.svn.fetch', - layout["trunk"]+':refs/heads/master'], - cwd=gitdir) - self.run_program(['git', 'config', 'svn-remote.svn.branches', - layout["branches"] + ':refs/heads/*'], - cwd=gitdir) - self.run_program(['git', 'config', 'svn-remote.svn.tags', - layout["tags"] + ':refs/tags/*'], + layout["trunk"] + ':refs/heads/master'], cwd=gitdir) + if 'branches' in layout: + self.run_program(['git', 'config', 'svn-remote.svn.branches', + layout["branches"] + ':refs/heads/*'], + cwd=gitdir) + else: + # try removing old config + try: + self.run_program(['git', 'config', '--unset', + 'svn-remote.svn.branches'], cwd=gitdir) + except Exception as e: + if '(exit code 5)' not in e.message: + raise + + if 'tags' in layout: + self.run_program(['git', 'config', 'svn-remote.svn.tags', + layout["tags"] + ':refs/tags/*'], + cwd=gitdir) + else: + # try removing old config + try: + self.run_program(['git', 'config', '--unset', + 'svn-remote.svn.tags'], cwd=gitdir) + except Exception as e: + if '(exit code 5)' not in e.message: + raise + # update the remote tracking branches self.run_program(['git', 'svn', 'fetch'], cwd=gitdir) |