svnkit 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/svnkit.rb +77 -14
- data/lib/svnkit/svnkit-1.8.5.jar +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de27a037f2a8a4dff728a819aff64e13279842dc
|
4
|
+
data.tar.gz: 8e0d2e292b877145dfe0ab888ff5df361e5287d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 808574d8e4baf8d62a3da48843dce9957026dcee3297069f0bd40490b5ae6aa1e32b3de96680d07e07712f758d459aa2e7ffb95f97dfa52155f98150d6d51fe6
|
7
|
+
data.tar.gz: ee680ceef983b2789fe8ee510115b9e2062781f30aba583ba20e5bb93e467679ec5d47a89d79e058b14ace32b75090d6a391ed022dd0d436f15c2a4b851231ce
|
data/lib/svnkit.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#encoding:utf-8
|
2
2
|
require 'java'
|
3
|
-
require 'svnkit/svnkit-1.8.
|
3
|
+
require 'svnkit/svnkit-1.8.5.jar'
|
4
4
|
require 'svnkit/sqljet-1.1.10.jar'
|
5
5
|
require 'svnkit/antlr-runtime-3.4.jar'
|
6
6
|
require 'svnkit/sequence-library-1.0.2.jar'
|
@@ -14,6 +14,8 @@ require 'svnkit/sequence-library-1.0.2.jar'
|
|
14
14
|
'org.tmatesoft.svn.core.wc.SVNCopySource',
|
15
15
|
'org.tmatesoft.svn.core.wc.SVNRevision',
|
16
16
|
'org.tmatesoft.svn.core.SVNProperties',
|
17
|
+
'org.tmatesoft.svn.core.wc.SVNInfo',
|
18
|
+
'org.tmatesoft.svn.core.ISVNLogEntryHandler',
|
17
19
|
'org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl'].each do |klass|
|
18
20
|
java_import klass
|
19
21
|
end
|
@@ -21,6 +23,14 @@ java_import('java.io.File') do |a,b|
|
|
21
23
|
'JavaFile'
|
22
24
|
end
|
23
25
|
|
26
|
+
class Java::OrgTmatesoftSvnCoreWc::SVNInfo
|
27
|
+
def last_revsion
|
28
|
+
getCommittedRevision.getNumber
|
29
|
+
end
|
30
|
+
def last_author
|
31
|
+
getAuthor
|
32
|
+
end
|
33
|
+
end
|
24
34
|
|
25
35
|
class SVN
|
26
36
|
attr_accessor :client
|
@@ -41,14 +51,16 @@ class SVN
|
|
41
51
|
updateclient.doCheckout(url, desFile, SVNRevision::HEAD, SVNRevision::HEAD, SVNDepth::INFINITY,true)
|
42
52
|
end
|
43
53
|
|
44
|
-
def copy
|
54
|
+
def copy svnurls,desturl,message='copy operation by svnkit'
|
45
55
|
copyclient = @client.getCopyClient
|
46
56
|
copyclient.setIgnoreExternals false
|
47
|
-
url =SVNURL.parseURIEncoded svnurl
|
48
57
|
des=SVNURL.parseURIEncoded desturl
|
49
58
|
copysources=[]
|
50
|
-
|
51
|
-
|
59
|
+
svnurls.each do |svnurl|
|
60
|
+
url =SVNURL.parseURIEncoded svnurl
|
61
|
+
copysources << SVNCopySource.new(SVNRevision::HEAD, SVNRevision::HEAD, url)
|
62
|
+
end
|
63
|
+
copyclient.doCopy(copysources.to_java("org.tmatesoft.svn.core.wc.SVNCopySource"), des, false, true, false, message, nil)
|
52
64
|
end
|
53
65
|
|
54
66
|
def upload svnurl,targetfile,message='import operation by svnkit'
|
@@ -56,7 +68,7 @@ class SVN
|
|
56
68
|
commitclient.setIgnoreExternals false
|
57
69
|
url = SVNURL.parseURIEncoded svnurl
|
58
70
|
target = JavaFile.new targetfile
|
59
|
-
commitclient.doImport(target,url,message, nil, true,
|
71
|
+
commitclient.doImport(target,url,message, nil, true, false,SVNDepth::INFINITY)
|
60
72
|
end
|
61
73
|
def delete svnurl,message='delete operation by svnkit'
|
62
74
|
commitclient = @client.getCommitClient
|
@@ -90,12 +102,63 @@ class SVN
|
|
90
102
|
target = JavaFile.new targetpath
|
91
103
|
updateclient.doUpdate(target, SVNRevision::HEAD,SVNDepth::INFINITY,true, true)
|
92
104
|
end
|
105
|
+
|
106
|
+
def wcclient
|
107
|
+
@svnwcclient = @client.getWCClient unless @svnwcclient
|
108
|
+
@svnwcclient.setIgnoreExternals false
|
109
|
+
end
|
110
|
+
|
111
|
+
def svninfo svnurl
|
112
|
+
wcclient
|
113
|
+
url =SVNURL.parseURIEncoded svnurl
|
114
|
+
info = @svnwcclient.doInfo(url, SVNRevision::HEAD, SVNRevision::HEAD)
|
115
|
+
end
|
116
|
+
|
117
|
+
def log svnurl,startRevision=nil,endRevision=nil
|
118
|
+
repository = @client.createRepository(SVNURL.parseURIEncoded(svnurl),false)
|
119
|
+
endRevision = repository.getLatestRevision unless endRevision
|
120
|
+
startRevision = 0 unless startRevision
|
121
|
+
logEntries = repository.log([].to_java("java.lang.String"), nil,startRevision, endRevision, true, true)
|
122
|
+
logs=[]
|
123
|
+
logEntries.iterator.each do |entry|
|
124
|
+
p entry.java_class
|
125
|
+
log={}
|
126
|
+
log['revision'] = entry.getRevision
|
127
|
+
log['author'] = entry.getAuthor
|
128
|
+
log['date'] = entry.getDate.format
|
129
|
+
log['message'] = entry.getMessage
|
130
|
+
log['changepaths'] = []
|
131
|
+
entry.getChangedPaths.keySet.iterator.each do |changepath|
|
132
|
+
entryPath = entry.getChangedPaths.get changepath
|
133
|
+
p entryPath.getType.chr
|
134
|
+
p entryPath.getPath.to_s
|
135
|
+
log['changepaths']<<{entryPath.getPath.to_s=>entryPath.getType.chr}
|
136
|
+
end
|
137
|
+
logs<<log
|
138
|
+
end
|
139
|
+
logs
|
140
|
+
end
|
141
|
+
|
93
142
|
end
|
94
|
-
|
95
|
-
#svn.
|
96
|
-
#svn.
|
97
|
-
#svn.
|
98
|
-
#svn.
|
99
|
-
#svn.
|
100
|
-
#
|
101
|
-
#svn.
|
143
|
+
begin
|
144
|
+
#svn = SVN.new 'chwu','qingqing923!'
|
145
|
+
#svn.delete "https://192.168.75.168:8888/svn/QM_CITI2.0/Tags/Build_1.2.15"
|
146
|
+
#svn.mkdir "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/test","test"
|
147
|
+
#svn.checkout("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Project/06.Test/项目实施/标准环境/CustomCI V1.1",'E:\\RubyProject\\SVNKIT\\CIManager\\')
|
148
|
+
#info = svn.copy(["https://192.168.75.168:8888/svn/QM_CITI2.0/Trunk/Development/Source/CIManager",
|
149
|
+
#"https://192.168.75.168:8888/svn/QM_CITI2.0/Trunk/Development/Source/svnkit",
|
150
|
+
#"https://192.168.75.168:8888/svn/QM_CITI2.0/Trunk/Development/Source/CIManager"].uniq,
|
151
|
+
#"https://192.168.75.168:8888/svn/QM_CITI2.0/Tags/Build_1.2.15")
|
152
|
+
#p info.getAuthor
|
153
|
+
#p info.getDate
|
154
|
+
#p info.getNewRevision
|
155
|
+
#p revsion = svn.svninfo("https://192.168.75.168:8888/svn/QM_CITI2.0/Trunk/Development/Source/CIManager").last_revsion
|
156
|
+
#svn.upload("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/dk.rb","C:\\dk.rb")
|
157
|
+
#svn.delete "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/dk.rb"
|
158
|
+
#svn.export "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/","F:\\"
|
159
|
+
#svn.update "E:\\QM_CITI1.0\\项目实施\\标准环境"
|
160
|
+
end
|
161
|
+
|
162
|
+
#p svn.log "https://192.168.75.168:8888/svn/QM_CITI2.0/Trunk/Development/Source/CIManager",50,56
|
163
|
+
|
164
|
+
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svnkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aslandhu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: svnkit wrap
|
14
14
|
email: chwu@iflytek.com
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- lib/svnkit/sequence-library-1.0.2.jar
|
31
31
|
- lib/svnkit/sqljet-1.1.10.jar
|
32
32
|
- lib/svnkit/svnkit-1.8.3.jar
|
33
|
+
- lib/svnkit/svnkit-1.8.5.jar
|
33
34
|
- lib/svnkit/svnkit-cli-1.8.3.jar
|
34
35
|
- lib/svnkit/svnkit-javahl16-1.8.3.jar
|
35
36
|
- lib/svnkit/trilead-ssh2-1.0.0-build217.jar
|