mercurial/HGRemote.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 12 Jul 2013 17:47:21 +0100
changeset 335 7e19ab19148b
parent 210 54a73fa50d40
child 401 218a20c7e54a
permissions -rw-r--r--
Changed license to LGPL2.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
     1
"
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     2
stx:libscm - a new source code management library for Smalltalk/X
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     3
Copyright (C) 2012-2013 Jan Vrany
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     4
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     5
This library is free software; you can redistribute it and/or
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     6
modify it under the terms of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     7
License as published by the Free Software Foundation; either
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
     8
version 2.1 of the License. 
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
     9
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    10
This library is distributed in the hope that it will be useful,
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    11
but WITHOUT ANY WARRANTY; without even the implied warranty of
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    13
Lesser General Public License for more details.
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    14
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    15
You should have received a copy of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    16
License along with this library; if not, write to the Free Software
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    18
"
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"{ Package: 'stx:libscm/mercurial' }"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
HGRepositoryObject subclass:#HGRemote
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	instanceVariableNames:'name url'
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
	classVariableNames:''
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	poolDictionaries:''
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	category:'SCM-Mercurial-Core'
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    28
!HGRemote class methodsFor:'documentation'!
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    29
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    30
copyright
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    31
"
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    32
stx:libscm - a new source code management library for Smalltalk/X
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    33
Copyright (C) 2012-2013 Jan Vrany
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    34
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    35
This library is free software; you can redistribute it and/or
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    36
modify it under the terms of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    37
License as published by the Free Software Foundation; either
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    38
version 2.1 of the License. 
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    39
335
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    40
This library is distributed in the hope that it will be useful,
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    41
but WITHOUT ANY WARRANTY; without even the implied warranty of
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    42
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    43
Lesser General Public License for more details.
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    44
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    45
You should have received a copy of the GNU Lesser General Public
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    46
License along with this library; if not, write to the Free Software
7e19ab19148b Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    47
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    48
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 206
diff changeset
    49
! !
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!HGRemote methodsFor:'accessing'!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
name
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    ^ name
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
url
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    ^ url
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
! !
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
206
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    61
!HGRemote methodsFor:'converting'!
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    62
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    63
asString
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    64
    ^name notNil 
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    65
        ifTrue:[name] 
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    66
        ifFalse:[url asString].
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    67
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    68
    "Created: / 29-01-2013 / 15:43:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    69
! !
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
    70
151
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    71
!HGRemote methodsFor:'displaying'!
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    72
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    73
displayString
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    74
    ^self isDefault ifTrue:[
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    75
        name asText allBold , ' - ', url asString
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    76
    ] ifFalse:[
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    77
        name , ' - ', url asString
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    78
    ]
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    79
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    80
    "Created: / 10-12-2012 / 01:33:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    81
! !
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
    82
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
!HGRemote methodsFor:'initialization'!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
setName: aString url: aStringOrUrl
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
    name := aString.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
    url := aStringOrUrl asURL
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
    "Created: / 09-12-2012 / 22:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
! !
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
!HGRemote methodsFor:'printing & storing'!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
printOn:aStream
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
    "append a printed representation if the receiver to the argument, aStream"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    super printOn:aStream.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    aStream nextPutAll:'('.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
    name printOn:aStream.
151
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   100
    aStream nextPutAll:' - '.
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
    url printOn:aStream.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    aStream nextPutAll:')'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
151
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   104
    "Modified: / 10-12-2012 / 01:33:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
! !
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
!HGRemote methodsFor:'testing'!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
isDefault
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
    "Return true, if receiver is default remote repository,
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
     i.e., if default push should go there"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
    ^ name = 'default'
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
    "Created: / 09-12-2012 / 23:24:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
! !
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
!HGRemote class methodsFor:'documentation'!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
version_HG
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
    ^ '$Changeset: <not expanded> $'
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
! !
206
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   124