From 85bd0d837f3f001b61cba9e8e37257ee410dee32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Fri, 22 Jul 2016 16:46:38 +0200 Subject: add support for checking out branch after git-svn init --- MgaRepo/git.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MgaRepo/git.py b/MgaRepo/git.py index ab89b25..4e763f8 100644 --- a/MgaRepo/git.py +++ b/MgaRepo/git.py @@ -52,7 +52,7 @@ class GIT(VCS): else: return self.update(targetpath, clone=True, **kwargs) - def init(self, url, targetpath, fullnames=True, **kwargs): + def init(self, url, targetpath, fullnames=True, branch=None, **kwargs): # verify repo url execcmd("svn", "info", url) @@ -73,6 +73,12 @@ class GIT(VCS): "svn-remote.authorlog.defaultmail": usermap.defaultmail} self.configset(gitconfig) + if branch: + execcmd(("git", "init", "-q", self.path), **kwargs) + execcmd(("git", "checkout", "-q", branch), **kwargs) + cmd = ["svn", "rebase", "--local"] + status, output = self._execVcs(*cmd, **kwargs) + return True def info(self, path, **kwargs): -- cgit v1.2.1