Subversion Repositories Koakuma

Rev

Rev 6 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 nishi 1
# $Id: vcs_cvs.tcl 13 2024-10-02 06:39:33Z nishi $
6 nishi 2
lappend components "CVS" "CVS Integration" "1.00" "VCS"
3 nishi 3
 
4
proc CVS_info {} {
5
	regexp {[0-9]+\.[0-9]+\.[0-9]+} "[exec cvs --version]" version
6
	add_toc2 "CVS"
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
}
13 nishi 18
 
19
proc CVS_repository {url ws} {
20
	set result [URL_parse "$url"]
21
	set path "[regsub {@[^@]+$} "[Get_KV $result "path"]" ""]"
22
	regexp {^.+@([^@]+)$} "[Get_KV $result "path"]" -> reponame
23
 
24
	if { "[Get_KV $result "scheme"]" == "pserver" } {
25
		if { [file exists "$ws"] } {
26
			set old "[pwd]"
27
			cd "$ws"
28
			if { [catch {exec cvs -d ":pserver:[Get_KV $result "userpass"]@[Get_KV $result "host"]:$path" up >@stdout 2>@1}] } {
29
				cd "$old"
30
				return 1
31
			}
32
			cd "$old"
33
		} else {
34
			if { [catch {exec cvs -d ":pserver:[Get_KV $result "userpass"]@[Get_KV $result "host"]:$path" co -d "$ws" "$reponame" >@stdout 2>@1}] } {
35
				return 1
36
			}
37
		}
38
		return 0
39
	} elseif { "[Get_KV $result "scheme"]" == "file" } {
40
		if { [file exists "$ws"] } {
41
			set old "[pwd]"
42
			cd "$ws"
43
			if { [catch {exec cvs -d "$path" up >@stdout 2>@1}] } {
44
				cd "$old"
45
				return 1
46
			}
47
			cd "$old"
48
		} else {
49
			if { [catch {exec cvs -d "$path" co -d "$ws" "$reponame" >@stdout 2>@1}] } {
50
				return 1
51
			}
52
		}
53
		return 0
54
	} else {
55
		return 1
56
	}
57
	return 0
58
}