From 23538cf9a696b8c5a8fed3290299bf33910aa392 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 11 Dec 2013 11:33:17 -0500 Subject: [PATCH] Added hg support when package use it as VCS --- cmd/get.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cmd/get.go b/cmd/get.go index ec6632b7e..cb20a36f3 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -350,7 +350,24 @@ func updateByVcs(vcs, dirPath string) error { log.Error("", "Error occurs when 'git pull origin "+branch+"'") log.Error("", "\t"+err.Error()) } + case "hg": + stdout, stderr, err := com.ExecCmd("hg", "pull") + if err != nil { + log.Error("", "Error occurs when 'hg pull'") + log.Error("", "\t"+err.Error()) + } + if len(stderr) > 0 { + log.Error("", "Error: "+stderr) + } + stdout, stderr, err = com.ExecCmd("hg", "up") + if err != nil { + log.Error("", "Error occurs when 'hg up'") + log.Error("", "\t"+err.Error()) + } + if len(stderr) > 0 { + log.Error("", "Error: "+stderr) + } } return nil }