Subversion Repositories Koakuma

Rev

Rev 26 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26 nishi 1
# $Id: vcs_git.tcl 27 2024-10-02 08:24:48Z nishi $
2
lappend components "Git" "Git Integration" "1.00" "VCS"
3
 
4
proc Git_info {} {
5
	regexp {[0-9]+\.[0-9]+\.[0-9]+} "[exec git --version]" version
6
	tputs	"<table border=\"0\">"
7
	tputs	"	<tr>"
8
	tputs	"		<th>"
9
	tputs	"			Version"
10
	tputs	"		</th>"
11
	tputs	"		<td>"
12
	tputs	"			$version"
13
	tputs	"		</td>"
14
	tputs	"	</tr>"
15
	tputs	"</table>"
16
}
17
 
18
proc Git_repository {url ws} {
19
	if { [file exists "$ws"] } {
20
		set old "[pwd]"
21
		cd "$ws"
22
		if { [catch {exec git pull >@stdout 2>@1}] } {
23
			cd "$old"
24
			return 1
25
		}
26
		cd "$old"
27
		return 0
28
	} else {
29
		if { [catch {exec git clone --recursive "$url" "$ws" >@stdout 2>@1}] } {
30
			return 1
31
		}
32
		return 0
33
	}
34
}