71
|
1 |
"{ Package: 'cvut:stx/goodies/libsvn' }"
|
|
2 |
|
|
3 |
"{ NameSpace: SVN }"
|
|
4 |
|
|
5 |
WCPathCommand subclass:#CommitCommand
|
|
6 |
instanceVariableNames:'message url username password noAuthCache'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'SVN-Private-Commands'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!CommitCommand methodsFor:'accessing'!
|
|
14 |
|
|
15 |
message
|
|
16 |
^ message
|
|
17 |
|
|
18 |
"Created: / 19-03-2008 / 15:59:36 / janfrog"
|
|
19 |
!
|
|
20 |
|
|
21 |
message:aString
|
|
22 |
message := aString.
|
|
23 |
|
|
24 |
"Created: / 19-03-2008 / 15:59:36 / janfrog"
|
|
25 |
"Modified: / 31-03-2008 / 14:20:11 / janfrog"
|
|
26 |
!
|
|
27 |
|
|
28 |
url
|
|
29 |
^ url
|
|
30 |
|
|
31 |
"Created: / 03-10-2008 / 18:19:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
32 |
!
|
|
33 |
|
|
34 |
url:something
|
|
35 |
url := something.
|
|
36 |
|
|
37 |
"Created: / 03-10-2008 / 18:19:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
38 |
! !
|
|
39 |
|
|
40 |
!CommitCommand methodsFor:'executing'!
|
|
41 |
|
|
42 |
execute
|
|
43 |
^ [ super execute ] on:SVN::AuthorizationError
|
|
44 |
do:[:ex |
|
|
45 |
|credentials dialog|
|
|
46 |
|
|
47 |
credentials := Credentials new username:OperatingSystem getLoginName.
|
|
48 |
credentials := (dialog := CredentialsDialog new)
|
|
49 |
model:credentials;
|
|
50 |
subtitle:self url;
|
|
51 |
open.
|
|
52 |
credentials
|
|
53 |
ifNil:[ ex pass ]
|
|
54 |
ifNotNil:[
|
|
55 |
username := credentials username.
|
|
56 |
password := credentials password.
|
|
57 |
noAuthCache := dialog savePassword not.
|
|
58 |
self execute
|
|
59 |
]
|
|
60 |
]
|
|
61 |
|
|
62 |
"Created: / 03-10-2008 / 18:22:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
63 |
"Modified: / 15-07-2009 / 12:09:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
64 |
! !
|
|
65 |
|
|
66 |
!CommitCommand methodsFor:'executing - private'!
|
|
67 |
|
|
68 |
svnCmd
|
|
69 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
70 |
|
|
71 |
^'commit'
|
|
72 |
|
|
73 |
"Created: / 16-03-2008 / 07:47:00 / janfrog"
|
|
74 |
!
|
|
75 |
|
|
76 |
svnCmdArgumentsOn:arg
|
|
77 |
|
|
78 |
arg nextPut:'--message'; nextPut: (message ? '').
|
|
79 |
super svnCmdArgumentsOn:arg
|
|
80 |
|
|
81 |
"Created: / 19-03-2008 / 15:59:13 / janfrog"
|
|
82 |
"Modified: / 31-03-2008 / 14:13:03 / janfrog"
|
|
83 |
!
|
|
84 |
|
|
85 |
svnGlobalArgumentsOn: argStream
|
|
86 |
|
|
87 |
super svnGlobalArgumentsOn: argStream.
|
|
88 |
|
|
89 |
"/argStream nextPut:'--config-dir'; nextPut:'/tmp/.svn'; nextPut:'--no-auth-cache'.
|
|
90 |
|
|
91 |
username ifNotNil:
|
|
92 |
[argStream
|
|
93 |
nextPut: '--username';
|
|
94 |
nextPut: username].
|
|
95 |
password ifNotNil:
|
|
96 |
[argStream
|
|
97 |
nextPut: '--password';
|
|
98 |
nextPut: password].
|
|
99 |
noAuthCache == true ifTrue:
|
|
100 |
[argStream
|
|
101 |
nextPutAll:'--no-auth-cache']
|
|
102 |
|
|
103 |
"Created: / 31-10-2008 / 09:30:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
104 |
!
|
|
105 |
|
|
106 |
svnProcessCommandOutput:arg1 err:arg2
|
|
107 |
"Superclass says that I am responsible to implement this method"
|
|
108 |
|
|
109 |
^ arg1 contents
|
|
110 |
|
|
111 |
"Created: / 03-10-2008 / 16:31:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
112 |
! !
|
|
113 |
|
|
114 |
!CommitCommand class methodsFor:'documentation'!
|
|
115 |
|
|
116 |
version
|
|
117 |
^ '$Header$'
|
175
|
118 |
!
|
|
119 |
|
|
120 |
version_CVS
|
|
121 |
^ '$Header$'
|
|
122 |
!
|
|
123 |
|
|
124 |
version_SVN
|
|
125 |
^'Id: SVN__CommitCommand.st 100 2009-07-15 18:35:02Z vranyj1 '
|
71
|
126 |
! !
|