From 1208f6bc67256619bcc8ef9bd0e8d8dfd29b52c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 1 Jul 2015 17:20:23 -0500 Subject: [PATCH] rrs/tools/common.py: Add get_pv_type function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_pv_type returns the type of pv can be git, svn, hg, etc. Signed-off-by: Aníbal Limón --- rrs/tools/common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rrs/tools/common.py b/rrs/tools/common.py index 5922ce9..ee72d97 100644 --- a/rrs/tools/common.py +++ b/rrs/tools/common.py @@ -26,3 +26,14 @@ def update_repo(fetchdir, repo_name, repo_url, pull, logger): out = utils.runcmd("git fetch", path, logger = logger) return path + +def get_pv_type(pv): + pv_type = '' + if '+git' in pv: + pv_type = 'git' + elif '+svn' in pv: + pv_type = 'svn' + elif '+hg' in pv: + pv_type = 'hg' + + return pv_type