Subversion Repositories Koakuma

Rev

Rev 6 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 13
Line 1... Line 1...
1
# $Id: vcs_cvs.tcl 6 2024-10-01 22:57:18Z nishi $
1
# $Id: vcs_cvs.tcl 13 2024-10-02 06:39:33Z nishi $
2
lappend components "CVS" "CVS Integration" "1.00" "VCS"
2
lappend components "CVS" "CVS Integration" "1.00" "VCS"
3
 
3
 
4
proc CVS_info {} {
4
proc CVS_info {} {
5
	regexp {[0-9]+\.[0-9]+\.[0-9]+} "[exec cvs --version]" version
5
	regexp {[0-9]+\.[0-9]+\.[0-9]+} "[exec cvs --version]" version
6
	add_toc2 "CVS"
6
	add_toc2 "CVS"
Line 13... Line 13...
13
	tputs	"			$version"
13
	tputs	"			$version"
14
	tputs	"		</td>"
14
	tputs	"		</td>"
15
	tputs	"	</tr>"
15
	tputs	"	</tr>"
16
	tputs	"</table>"
16
	tputs	"</table>"
17
}
17
}
-
 
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
}