SVN__ListCommand.st
author convert-repo
Tue, 09 Aug 2016 03:35:30 +0000
changeset 1178 3a6dad9479fd
parent 824 f8a52ef83887
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
695
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     1
"
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     2
 Copyright (c) 2007-2010 Jan Vrany
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     3
 Copyright (c) 2009-2010 eXept Software AG
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     4
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     5
 Permission is hereby granted, free of charge, to any person
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     6
 obtaining a copy of this software and associated documentation
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     7
 files (the 'Software'), to deal in the Software without
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     8
 restriction, including without limitation the rights to use,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
     9
 copy, modify, merge, publish, distribute, sublicense, and/or sell
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    10
 copies of the Software, and to permit persons to whom the
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    11
 Software is furnished to do so, subject to the following
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    12
 conditions:
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    13
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    14
 The above copyright notice and this permission notice shall be
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    15
 included in all copies or substantial portions of the Software.
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    16
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    17
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    18
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    19
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    20
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    21
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    22
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    23
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    24
 OTHER DEALINGS IN THE SOFTWARE.
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    25
"
448
8c30a64870e5 *** empty log message ***
fm
parents: 349
diff changeset
    26
"{ Package: 'stx:libsvn' }"
91
422d7b237477 initial checkin
fm
parents:
diff changeset
    27
422d7b237477 initial checkin
fm
parents:
diff changeset
    28
"{ NameSpace: SVN }"
422d7b237477 initial checkin
fm
parents:
diff changeset
    29
422d7b237477 initial checkin
fm
parents:
diff changeset
    30
BranchCommand subclass:#ListCommand
422d7b237477 initial checkin
fm
parents:
diff changeset
    31
	instanceVariableNames:'url recursive'
422d7b237477 initial checkin
fm
parents:
diff changeset
    32
	classVariableNames:''
422d7b237477 initial checkin
fm
parents:
diff changeset
    33
	poolDictionaries:''
422d7b237477 initial checkin
fm
parents:
diff changeset
    34
	category:'SVN-Private-Commands'
422d7b237477 initial checkin
fm
parents:
diff changeset
    35
!
422d7b237477 initial checkin
fm
parents:
diff changeset
    36
695
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    37
!ListCommand class methodsFor:'documentation'!
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    38
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    39
copyright
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    40
"
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    41
 Copyright (c) 2007-2010 Jan Vrany
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    42
 Copyright (c) 2009-2010 eXept Software AG
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    43
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    44
 Permission is hereby granted, free of charge, to any person
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    45
 obtaining a copy of this software and associated documentation
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    46
 files (the 'Software'), to deal in the Software without
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    47
 restriction, including without limitation the rights to use,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    48
 copy, modify, merge, publish, distribute, sublicense, and/or sell
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    49
 copies of the Software, and to permit persons to whom the
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    50
 Software is furnished to do so, subject to the following
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    51
 conditions:
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    52
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    53
 The above copyright notice and this permission notice shall be
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    54
 included in all copies or substantial portions of the Software.
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    55
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    56
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    57
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    58
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    59
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    60
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    61
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    62
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    63
 OTHER DEALINGS IN THE SOFTWARE.
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    64
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    65
"
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    66
! !
91
422d7b237477 initial checkin
fm
parents:
diff changeset
    67
422d7b237477 initial checkin
fm
parents:
diff changeset
    68
!ListCommand class methodsFor:'executing'!
422d7b237477 initial checkin
fm
parents:
diff changeset
    69
422d7b237477 initial checkin
fm
parents:
diff changeset
    70
list: url 
422d7b237477 initial checkin
fm
parents:
diff changeset
    71
    ^ (self new)
422d7b237477 initial checkin
fm
parents:
diff changeset
    72
        url: url;
422d7b237477 initial checkin
fm
parents:
diff changeset
    73
        execute
422d7b237477 initial checkin
fm
parents:
diff changeset
    74
422d7b237477 initial checkin
fm
parents:
diff changeset
    75
    "Created: / 19-03-2008 / 08:27:10 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
    76
    "Modified: / 19-08-2009 / 13:28:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
    77
! !
422d7b237477 initial checkin
fm
parents:
diff changeset
    78
695
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    79
!ListCommand class methodsFor:'others'!
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    80
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    81
version_CVS
824
f8a52ef83887 checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 695
diff changeset
    82
    ^ '$Header$'
695
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    83
! !
6767e9bad300 Updates from SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 448
diff changeset
    84
91
422d7b237477 initial checkin
fm
parents:
diff changeset
    85
!ListCommand methodsFor:'accessing'!
422d7b237477 initial checkin
fm
parents:
diff changeset
    86
422d7b237477 initial checkin
fm
parents:
diff changeset
    87
recursive
422d7b237477 initial checkin
fm
parents:
diff changeset
    88
    ^ recursive ? false
422d7b237477 initial checkin
fm
parents:
diff changeset
    89
422d7b237477 initial checkin
fm
parents:
diff changeset
    90
    "Created: / 15-03-2008 / 20:56:05 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
    91
!
422d7b237477 initial checkin
fm
parents:
diff changeset
    92
422d7b237477 initial checkin
fm
parents:
diff changeset
    93
recursive:aBoolean
422d7b237477 initial checkin
fm
parents:
diff changeset
    94
    recursive := aBoolean.
422d7b237477 initial checkin
fm
parents:
diff changeset
    95
422d7b237477 initial checkin
fm
parents:
diff changeset
    96
    "Created: / 15-03-2008 / 20:56:05 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
    97
!
422d7b237477 initial checkin
fm
parents:
diff changeset
    98
422d7b237477 initial checkin
fm
parents:
diff changeset
    99
url
422d7b237477 initial checkin
fm
parents:
diff changeset
   100
    ^ url ifNil:[ branch url]
422d7b237477 initial checkin
fm
parents:
diff changeset
   101
422d7b237477 initial checkin
fm
parents:
diff changeset
   102
    "Modified: / 19-08-2009 / 13:28:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
   103
!
422d7b237477 initial checkin
fm
parents:
diff changeset
   104
422d7b237477 initial checkin
fm
parents:
diff changeset
   105
url:aString
422d7b237477 initial checkin
fm
parents:
diff changeset
   106
    url := aString.
422d7b237477 initial checkin
fm
parents:
diff changeset
   107
! !
422d7b237477 initial checkin
fm
parents:
diff changeset
   108
422d7b237477 initial checkin
fm
parents:
diff changeset
   109
!ListCommand methodsFor:'executing - private'!
422d7b237477 initial checkin
fm
parents:
diff changeset
   110
422d7b237477 initial checkin
fm
parents:
diff changeset
   111
svnCmd
422d7b237477 initial checkin
fm
parents:
diff changeset
   112
    "raise an error: must be redefined in concrete subclass(es)"
422d7b237477 initial checkin
fm
parents:
diff changeset
   113
422d7b237477 initial checkin
fm
parents:
diff changeset
   114
    ^'list'
422d7b237477 initial checkin
fm
parents:
diff changeset
   115
422d7b237477 initial checkin
fm
parents:
diff changeset
   116
    "Created: / 15-03-2008 / 21:03:32 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
   117
!
422d7b237477 initial checkin
fm
parents:
diff changeset
   118
422d7b237477 initial checkin
fm
parents:
diff changeset
   119
svnCmdArgumentsOn: argStream 
422d7b237477 initial checkin
fm
parents:
diff changeset
   120
    self recursive ifTrue: [ argStream nextPut: '--recursive' ].
422d7b237477 initial checkin
fm
parents:
diff changeset
   121
    argStream
422d7b237477 initial checkin
fm
parents:
diff changeset
   122
        nextPut: '-r';
422d7b237477 initial checkin
fm
parents:
diff changeset
   123
        nextPut: self revision printString;
422d7b237477 initial checkin
fm
parents:
diff changeset
   124
        nextPut: '--xml';
422d7b237477 initial checkin
fm
parents:
diff changeset
   125
        nextPut: self url asString
422d7b237477 initial checkin
fm
parents:
diff changeset
   126
422d7b237477 initial checkin
fm
parents:
diff changeset
   127
    "Created: / 15-03-2008 / 21:21:11 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
   128
    "Modified: / 16-03-2008 / 07:38:11 / janfrog"
422d7b237477 initial checkin
fm
parents:
diff changeset
   129
    "Modified: / 19-04-2008 / 13:57:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
   130
!
422d7b237477 initial checkin
fm
parents:
diff changeset
   131
422d7b237477 initial checkin
fm
parents:
diff changeset
   132
svnParseXML: doc 
422d7b237477 initial checkin
fm
parents:
diff changeset
   133
    ^ (doc root / 'list' / 'entry') asCollection 
422d7b237477 initial checkin
fm
parents:
diff changeset
   134
        collect: [:entryNode | RepositoryEntry readFromXml: entryNode ]
422d7b237477 initial checkin
fm
parents:
diff changeset
   135
422d7b237477 initial checkin
fm
parents:
diff changeset
   136
    "Created: / 19-04-2008 / 13:56:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
   137
    "Modified: / 19-08-2009 / 09:05:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
   138
!
422d7b237477 initial checkin
fm
parents:
diff changeset
   139
422d7b237477 initial checkin
fm
parents:
diff changeset
   140
svnProcessCommandOutput:out err:err 
422d7b237477 initial checkin
fm
parents:
diff changeset
   141
    ^ self svnParseXML:((XML::XMLParser on:out)
422d7b237477 initial checkin
fm
parents:
diff changeset
   142
                validate:false;
422d7b237477 initial checkin
fm
parents:
diff changeset
   143
                scanDocument)
422d7b237477 initial checkin
fm
parents:
diff changeset
   144
422d7b237477 initial checkin
fm
parents:
diff changeset
   145
    "Created: / 03-10-2008 / 16:31:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
422d7b237477 initial checkin
fm
parents:
diff changeset
   146
! !
422d7b237477 initial checkin
fm
parents:
diff changeset
   147
422d7b237477 initial checkin
fm
parents:
diff changeset
   148
!ListCommand class methodsFor:'documentation'!
422d7b237477 initial checkin
fm
parents:
diff changeset
   149
422d7b237477 initial checkin
fm
parents:
diff changeset
   150
version
824
f8a52ef83887 checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 695
diff changeset
   151
    ^ '$Header$'
139
04fc02f6bb12 changed: #version_SVN
fm
parents: 91
diff changeset
   152
!
04fc02f6bb12 changed: #version_SVN
fm
parents: 91
diff changeset
   153
04fc02f6bb12 changed: #version_SVN
fm
parents: 91
diff changeset
   154
version_SVN
824
f8a52ef83887 checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 695
diff changeset
   155
    ^ '§Id: SVN__ListCommand.st 362 2011-08-08 13:07:42Z vranyj1 §'
91
422d7b237477 initial checkin
fm
parents:
diff changeset
   156
! !