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