Subversion Repositories Koakuma

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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