svnkit 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/svnkit.rb +29 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acca2d3f17aa68573a1ce34e663353046ab26307
4
- data.tar.gz: 6db92ea2f51fb64b82db9567fd408b7400952358
3
+ metadata.gz: 738e82ae14c1b191c1ecc7d479aacc1c9431e371
4
+ data.tar.gz: 47b57f61b5f7afdf12835b33ca2b1a636fd0ea35
5
5
  SHA512:
6
- metadata.gz: cb867fdb22540530b696d1ee8a134adc3ea2558817a8961e1780fc45977ed69cad2c77dfc7a08e089a2e53985c3685c15df60307051288b65540816cc1b86881
7
- data.tar.gz: 8494d3328a0d778834f4233f9ad88e4fb5b0a6c0354e15614fe28a3ec1f9c55040065063d78431ec0fd0e0b32abaac44d8ffc741b273dcd4a8ac21843298efc2
6
+ metadata.gz: 38afbc2f0dd410b44c1e092d8082d7815b381181663387d594ff20ed75f1229a5d29c44b778fbd8874e5ba0873d340de8cac19ea22fb51793d990a6468ccca83
7
+ data.tar.gz: 4595ce6d0a7754854f4e0211cf027c4232f1ac5dc245926760bfff6082f055274c3053618536f8ad880c93666013c5fa4093d2a58e60dab8a24e205f8fc4cdae
data/lib/svnkit.rb CHANGED
@@ -10,7 +10,6 @@ require 'svnkit/sequence-library-1.0.2.jar'
10
10
  'org.tmatesoft.svn.core.wc.SVNWCUtil',
11
11
  'org.tmatesoft.svn.core.SVNURL',
12
12
  'org.tmatesoft.svn.core.SVNDepth',
13
- 'java.io.File',
14
13
  'org.tmatesoft.svn.core.wc.SVNUpdateClient',
15
14
  'org.tmatesoft.svn.core.wc.SVNCopySource',
16
15
  'org.tmatesoft.svn.core.wc.SVNRevision',
@@ -18,6 +17,11 @@ require 'svnkit/sequence-library-1.0.2.jar'
18
17
  'org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl'].each do |klass|
19
18
  java_import klass
20
19
  end
20
+ java_import('java.io.File') do |a,b|
21
+ 'JavaFile'
22
+ end
23
+
24
+
21
25
  class SVN
22
26
  attr_accessor :client
23
27
  def initialize user,password
@@ -31,54 +35,66 @@ class SVN
31
35
  #respository = @client.createRepository url,true
32
36
  #revision = respository.getLatestRevision
33
37
  #depth = SVNDepth.getInfinityOrEmptyDepth true
34
- desFile = File.new des
38
+ desFile = JavaFile.new des
35
39
  updateclient = @client.getUpdateClient
36
40
  updateclient.setIgnoreExternals false
37
41
  updateclient.doCheckout(url, desFile, SVNRevision::HEAD, SVNRevision::HEAD, SVNDepth::INFINITY,true)
38
42
  end
39
43
 
40
- def copy svnurl,desturl
44
+ def copy svnurl,desturl,message='copy operation by svnkit'
41
45
  copyclient = @client.getCopyClient
42
46
  copyclient.setIgnoreExternals false
43
47
  url =SVNURL.parseURIEncoded svnurl
44
48
  des=SVNURL.parseURIEncoded desturl
45
49
  copysources=[]
46
50
  copysources << SVNCopySource.new(SVNRevision::HEAD, SVNRevision::HEAD, url)
47
- copyclient.doCopy(copysources.to_java("org.tmatesoft.svn.core.wc.SVNCopySource"), des, false, false, false, "copy", nil);
51
+ copyclient.doCopy(copysources.to_java("org.tmatesoft.svn.core.wc.SVNCopySource"), des, false, false, false, message, nil);
48
52
  end
49
53
 
50
- def upload svnurl,targetfile
54
+ def upload svnurl,targetfile,message='import operation by svnkit'
51
55
  commitclient = @client.getCommitClient
52
56
  commitclient.setIgnoreExternals false
53
57
  url = SVNURL.parseURIEncoded svnurl
54
- target = File.new targetfile
55
- commitclient.doImport(target,url, "import operation!", nil, true, true,SVNDepth::INFINITY)
58
+ target = JavaFile.new targetfile
59
+ commitclient.doImport(target,url,message, nil, true, true,SVNDepth::INFINITY)
56
60
  end
57
- def delete svnurl
61
+ def delete svnurl,message='delete operation by svnkit'
58
62
  commitclient = @client.getCommitClient
59
63
  commitclient.setIgnoreExternals false
60
64
  url =SVNURL.parseURIEncoded svnurl
61
65
  deleteurls = []
62
66
  deleteurls << url
63
- commitclient.doDelete(deleteurls.to_java("org.tmatesoft.svn.core.SVNURL"), "delete model");
67
+ commitclient.doDelete(deleteurls.to_java("org.tmatesoft.svn.core.SVNURL"), message)
68
+ end
69
+
70
+ def mkdir svnurl,message='mkdir operation by svnkit'
71
+ commitclient = @client.getCommitClient
72
+ commitclient.setIgnoreExternals false
73
+ url = SVNURL.parseURIEncoded svnurl
74
+ mkurls = []
75
+ mkurls << url
76
+ commitclient.doMkDir(mkurls.to_java("org.tmatesoft.svn.core.SVNURL"),message)
64
77
  end
65
- def export svnurl,despath
78
+
79
+ def export svnurl,despath,message='download(without svn manager)operation by svnkit'
66
80
  updateclient = @client.getUpdateClient
67
81
  updateclient.setIgnoreExternals false
68
82
  url =SVNURL.parseURIEncoded svnurl
69
83
  des = File.new despath
70
- updateclient.doExport(url,des, SVNRevision::HEAD, SVNRevision::HEAD, "downloadModel",true,SVNDepth::INFINITY)
84
+ updateclient.doExport(url,des, SVNRevision::HEAD, SVNRevision::HEAD, message,true,SVNDepth::INFINITY)
71
85
  end
86
+
72
87
  def update targetpath
73
88
  updateclient = @client.getUpdateClient
74
89
  updateclient.setIgnoreExternals false
75
- target = File.new targetpath
90
+ target = JavaFile.new targetpath
76
91
  updateclient.doUpdate(target, SVNRevision::HEAD,SVNDepth::INFINITY,true, true)
77
92
  end
78
93
  end
79
94
  #svn = SVN.new 'chwu','asland'
95
+ #svn.mkdir "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/test","test"
80
96
  #svn.checkout("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Project/06.Test/项目实施/标准环境/CustomCI V1.1",'E:\\RubyProject\\SVNKIT\\CIManager\\')
81
- #svn.copy("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Project/06.Test/项目实施/标准环境/CustomCI V1.1","https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager")
97
+ #svn.copy("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Project/06.Test/项目实施/标准环境/CustomCI V1.1","https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/test/")
82
98
  #svn.upload("https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/dk.rb","C:\\dk.rb")
83
99
  #svn.delete "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/dk.rb"
84
100
  #svn.export "https://192.168.75.168:8888/svn/QM_CITI1.0/Trunk/Development/Source/CIManager/","F:\\"
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - aslandhu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-08 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: svnkit wrap
14
14
  email: chwu@iflytek.com