summaryrefslogtreecommitdiff
path: root/lorry
diff options
context:
space:
mode:
Diffstat (limited to 'lorry')
-rwxr-xr-xlorry34
1 files changed, 27 insertions, 7 deletions
diff --git a/lorry b/lorry
index aa87d52..2759f54 100755
--- a/lorry
+++ b/lorry
@@ -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)