mercurial/HGCommand.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 04 Feb 2013 12:59:18 +0100
changeset 214 175e450bb8dd
parent 213 d5a0f178e2c4
child 215 165ce6502156
permissions -rw-r--r--
Better error handling in HGCommand (part 1). HGCommand now spawns two auxiliary threads to parse stdout and stderr. Notification are not propagated to the thread that calls HGCommand>>execute (ongoing work).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     1
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     2
 COPYRIGHT (c) 2012-2013 by Jan Vrany
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     3
              All Rights Reserved
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     4
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     5
 This software is furnished under a license and may be used
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     6
 only in accordance with the terms of that license and with the
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     8
 be provided or otherwise made available to, or used by, any
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
     9
 other person.  No title to or ownership of the software is
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
    10
 hereby transferred.
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
    11
"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    12
"{ Package: 'stx:libscm/mercurial' }"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    13
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    14
Object subclass:#HGCommand
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
    15
	instanceVariableNames:'workingDirectory result error workers blocker'
207
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
    16
	classVariableNames:'HGExecutable HGVersion Debugging Tracing'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    17
	poolDictionaries:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    18
	category:'SCM-Mercurial-Internal'
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    19
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    20
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    21
HGCommand subclass:#add
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    22
	instanceVariableNames:'paths'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    23
	classVariableNames:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    24
	poolDictionaries:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    25
	privateIn:HGCommand
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    26
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    27
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    28
HGCommand subclass:#branches
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    29
	instanceVariableNames:'active closed'
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    30
	classVariableNames:''
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    31
	poolDictionaries:''
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    32
	privateIn:HGCommand
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    33
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    34
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    35
HGCommand subclass:#cat
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
    36
	instanceVariableNames:'path revision destination'
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
    37
	classVariableNames:''
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
    38
	poolDictionaries:''
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
    39
	privateIn:HGCommand
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
    40
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
    41
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    42
HGCommand subclass:#clone
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
    43
	instanceVariableNames:'url path update'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    44
	classVariableNames:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    45
	poolDictionaries:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    46
	privateIn:HGCommand
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    47
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    48
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    49
HGCommand subclass:#commit
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
    50
	instanceVariableNames:'message files author date'
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    51
	classVariableNames:''
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    52
	poolDictionaries:''
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    53
	privateIn:HGCommand
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    54
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    55
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    56
HGCommand subclass:#heads
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    57
	instanceVariableNames:''
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    58
	classVariableNames:''
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    59
	poolDictionaries:''
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    60
	privateIn:HGCommand
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    61
!
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
    62
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    63
HGCommand subclass:#locate
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    64
	instanceVariableNames:'revision'
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    65
	classVariableNames:''
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    66
	poolDictionaries:''
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    67
	privateIn:HGCommand
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    68
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    69
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    70
HGCommand subclass:#log
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
    71
	instanceVariableNames:'start stop path childrenOnly revsets'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    72
	classVariableNames:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    73
	poolDictionaries:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    74
	privateIn:HGCommand
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    75
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    76
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    77
HGCommand subclass:#merge
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    78
	instanceVariableNames:'revision tool'
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    79
	classVariableNames:''
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    80
	poolDictionaries:''
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    81
	privateIn:HGCommand
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    82
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
    83
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    84
HGCommand subclass:#mv
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    85
	instanceVariableNames:'source destination'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    86
	classVariableNames:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    87
	poolDictionaries:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    88
	privateIn:HGCommand
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    89
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
    90
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    91
HGCommand subclass:#pull
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    92
	instanceVariableNames:'url'
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    93
	classVariableNames:''
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    94
	poolDictionaries:''
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    95
	privateIn:HGCommand
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    96
!
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
    97
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
    98
HGCommand subclass:#push
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
    99
	instanceVariableNames:'url force'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   100
	classVariableNames:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   101
	poolDictionaries:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   102
	privateIn:HGCommand
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   103
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   104
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   105
HGCommand subclass:#remove
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   106
	instanceVariableNames:'paths'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   107
	classVariableNames:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   108
	poolDictionaries:''
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   109
	privateIn:HGCommand
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   110
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   111
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   112
HGCommand subclass:#resolve
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   113
	instanceVariableNames:'tool mark unmark files'
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   114
	classVariableNames:''
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   115
	poolDictionaries:''
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   116
	privateIn:HGCommand
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   117
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   118
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   119
HGCommand subclass:#resolve__list
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   120
	instanceVariableNames:''
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   121
	classVariableNames:''
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   122
	poolDictionaries:''
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   123
	privateIn:HGCommand
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   124
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   125
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   126
HGCommand subclass:#showconfig
142
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   127
	instanceVariableNames:'key'
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   128
	classVariableNames:''
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   129
	poolDictionaries:''
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   130
	privateIn:HGCommand
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   131
!
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
   132
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   133
HGCommand subclass:#status
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   134
	instanceVariableNames:'path'
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   135
	classVariableNames:''
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   136
	poolDictionaries:''
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   137
	privateIn:HGCommand
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   138
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   139
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   140
HGCommand subclass:#update
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   141
	instanceVariableNames:'revision'
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   142
	classVariableNames:''
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   143
	poolDictionaries:''
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   144
	privateIn:HGCommand
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   145
!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   146
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   147
HGCommand subclass:#version
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   148
	instanceVariableNames:'executable'
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   149
	classVariableNames:''
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   150
	poolDictionaries:''
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   151
	privateIn:HGCommand
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   152
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   153
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   154
!HGCommand class methodsFor:'documentation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   155
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   156
copyright
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   157
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   158
 COPYRIGHT (c) 2012-2013 by Jan Vrany
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   159
              All Rights Reserved
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   160
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   161
 This software is furnished under a license and may be used
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   162
 only in accordance with the terms of that license and with the
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   163
 inclusion of the above copyright notice.   This software may not
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   164
 be provided or otherwise made available to, or used by, any
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   165
 other person.  No title to or ownership of the software is
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   166
 hereby transferred.
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   167
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   168
!
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 208
diff changeset
   169
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   170
documentation
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   171
"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   172
    A wrapper for hg command line tool. Individual commands are wrapped in 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   173
    my private classes. 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   174
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   175
    HGCommand is part of internal implementation and subject to change. 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   176
    Therefore it should not be used by user code. Use classed and APIs in 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   177
    SCM-Mercurial-Core instead.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   178
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   179
    [author:]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   180
        Jan Vrany <jan.vrany@fit.cvut.cz>
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   181
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   182
    [instance variables:]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   183
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   184
    [class variables:]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   185
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   186
    [see also:]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   187
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   188
"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   189
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   190
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   191
!HGCommand class methodsFor:'initialization'!
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   192
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   193
initialize
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   194
    "Invoked at system start or when the class is dynamically loaded."
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   195
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   196
    "/ please change as required (and remove this comment)
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   197
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   198
    "/ HGExecutable := nil.
207
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
   199
    Debugging := Tracing := OperatingSystem getLoginName = 'jv'.
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   200
207
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
   201
    "Modified: / 29-01-2013 / 16:22:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   202
! !
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   203
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   204
!HGCommand class methodsFor:'accessing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   205
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   206
hgCommand
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   207
    | h |
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   208
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   209
    HGExecutable notNil ifTrue:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   210
        ^ HGExecutable
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   211
    ].
82
40eb86d8d5bd Fixed misspelled selector in HGCommand. Use WC's repository to push
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 80
diff changeset
   212
    HGExecutable := UserPreferences current hgCommand.
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   213
    HGExecutable isNil ifTrue:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   214
        OperatingSystem isMSWINDOWSlike ifTrue:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   215
            "/        h := Win32OperatingSystem registryEntry 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   216
            "/                key:'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\svn.exe'.
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   217
            "/        h notNil ifTrue:[HGExecutable := h valueNamed:''].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   218
            "/        HGExecutable notEmptyOrNil ifTrue:[^HGExecutable]
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   219
            HGExecutable := OperatingSystem pathOfCommand:'hg'.
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   220
        ] ifFalse:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   221
            OperatingSystem isUNIXlike ifTrue:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   222
                HGExecutable := OperatingSystem pathOfCommand:'hg'.
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   223
            ]
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   224
        ].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   225
    ].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   226
    HGExecutable isNil ifTrue:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   227
        self error:'''hg'' executable not found!!'.
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   228
    ].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   229
    ^ HGExecutable
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   230
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   231
    "
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   232
     HGExecutable := nil.
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   233
     self basicNew executable"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   234
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   235
    "Created: / 19-11-2012 / 21:48:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
82
40eb86d8d5bd Fixed misspelled selector in HGCommand. Use WC's repository to push
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 80
diff changeset
   236
    "Modified: / 19-11-2012 / 23:21:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   237
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   238
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   239
hgCommand: command
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   240
    HGExecutable := command
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   241
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   242
    "Created: / 19-11-2012 / 21:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   243
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   244
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   245
hgVersion
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   246
    "Return mercurial version installed on this compiter"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   247
    
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   248
    HGVersion isNil ifTrue:[
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   249
        HGVersion := self hgVersionOf: self hgCommand
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   250
    ].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   251
    ^ HGVersion
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   252
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   253
    "
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   254
     HGCommand hgVersion
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   255
    "
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   256
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   257
    "Created: / 19-11-2012 / 20:14:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   258
    "Modified: / 21-01-2013 / 05:07:58 / jv"
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   259
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   260
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   261
hgVersionIsSupported
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   262
    ^ self hgVersionIsSupported:self hgVersion
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   263
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   264
    "
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   265
     HGCommand mercurialVersionIsSupported"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   266
    "Created: / 19-11-2012 / 20:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   267
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   268
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   269
hgVersionIsSupported:version 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   270
    ^ self hgVersionsSupported 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   271
        anySatisfy:[:vsn | 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   272
            ((vsn at:1) == #'*' or:[ (vsn at:1) == (version at:1) ]) 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   273
                and:[
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   274
                    ((vsn at:2) == #'*' or:[ (vsn at:2) == (version at:2) ]) 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   275
                        and:[ ((vsn at:3) == #'*' or:[ (vsn at:1) == (version at:3) ]) ]
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   276
                ]
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   277
        ].
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   278
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   279
    "
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   280
     HGCommand mercurialVersionIsSupported: #(2 3 2)
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   281
     HGCommand mercurialVersionIsSupported: #(2 0 1)
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   282
     HGCommand mercurialVersionIsSupported: #(1 9 1)
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   283
     HGCommand mercurialVersionIsSupported: #(1 0 0)
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   284
     HGCommand mercurialVersionIsSupported: #(2 4 nil)"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   285
    "Created: / 19-11-2012 / 20:31:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   286
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   287
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   288
hgVersionOf: hgcommand
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   289
    "Return mercurial version installed on this compiter"
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   290
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   291
    ^version new 
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   292
        executable: hgcommand;
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   293
        execute
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   294
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   295
    "
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   296
     HGCommand hgVersion
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   297
    "
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   298
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   299
    "Created: / 21-01-2013 / 05:05:01 / jv"
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   300
!
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
   301
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   302
hgVersionsSupported
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   303
    "Return a list of mercurial version supported bu this
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   304
     implementation"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   305
    
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   306
    ^ #( #(1 9 #'*')
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   307
     #(2 #'*' #'*') )
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   308
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   309
    "Created: / 19-11-2012 / 20:26:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   310
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   311
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   312
verbose
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   313
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   314
    ^ UserPreferences current hgVerbose
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   315
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   316
    "Created: / 19-03-2008 / 12:29:47 / janfrog"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   317
    "Modified: / 19-03-2009 / 14:00:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   318
    "Modified (format): / 27-12-2011 / 16:00:06 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   319
    "Modified: / 17-10-2012 / 13:05:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   320
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   321
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   322
verbose:aBoolean
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   323
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   324
    UserPreferences current hgVerbose:aBoolean
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   325
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   326
    "Created: / 19-03-2008 / 12:29:59 / janfrog"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   327
    "Modified: / 19-03-2009 / 14:00:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   328
    "Modified (format): / 27-12-2011 / 16:00:13 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   329
    "Modified: / 17-10-2012 / 13:05:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   330
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   331
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   332
!HGCommand class methodsFor:'commands'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   333
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   334
add
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   335
    ^add new
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   336
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   337
    "Created: / 15-11-2012 / 00:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   338
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   339
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   340
branches
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   341
    ^branches new
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   342
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   343
    "Created: / 27-11-2012 / 19:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   344
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   345
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   346
cat
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   347
    ^cat new
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   348
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   349
    "Created: / 17-11-2012 / 00:16:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   350
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   351
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   352
clone
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   353
    ^clone new
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   354
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   355
    "Created: / 01-10-2012 / 00:09:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   356
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   357
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   358
commit
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   359
    ^commit new
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   360
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   361
    "Created: / 12-11-2012 / 22:40:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   362
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   363
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   364
heads
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   365
    ^heads new
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   366
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   367
    "Created: / 27-11-2012 / 21:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   368
!
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   369
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   370
locate
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   371
    ^locate new
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   372
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   373
    "Created: / 16-11-2012 / 22:36:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   374
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   375
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   376
log
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   377
    ^log new
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   378
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   379
    "Created: / 13-11-2012 / 09:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   380
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   381
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   382
merge
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   383
    ^merge new
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   384
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   385
    "Created: / 14-01-2013 / 16:03:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   386
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   387
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   388
mv
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   389
    ^mv new
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   390
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   391
    "Created: / 15-11-2012 / 00:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   392
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   393
109
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   394
pull
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   395
    ^pull new
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   396
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   397
    "Created: / 27-11-2012 / 23:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   398
!
08c6eca6df25 Added warning about commiting new head to HGCommitDialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
   399
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   400
push
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   401
    ^push new
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   402
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   403
    "Created: / 30-09-2012 / 23:46:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   404
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   405
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   406
remove
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   407
    ^remove new
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   408
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   409
    "Created: / 15-11-2012 / 00:06:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   410
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   411
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   412
resolve
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   413
    ^resolve new
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   414
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   415
    "Created: / 14-01-2013 / 18:20:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   416
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   417
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   418
resolve__list
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   419
    ^resolve__list new
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   420
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   421
    "Created: / 14-01-2013 / 16:42:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   422
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   423
145
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   424
showconfig
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   425
    ^showconfig new
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   426
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   427
    "Created: / 06-12-2012 / 20:24:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   428
!
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   429
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   430
status
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   431
    ^status new
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   432
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   433
    "Created: / 23-10-2012 / 11:10:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   434
!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   435
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   436
update
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   437
    ^update new
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   438
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   439
    "Created: / 21-11-2012 / 00:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   440
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   441
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   442
!HGCommand class methodsFor:'commands-shortcuts'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   443
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   444
clone: url to: stringOfFilename
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   445
    self clone
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   446
        url: url;
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   447
        path: stringOfFilename asFilename asAbsoluteFilename pathName;
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   448
        execute
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   449
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   450
    "Created: / 01-10-2012 / 00:06:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   451
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   452
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   453
!HGCommand methodsFor:'accessing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   454
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   455
workingDirectory
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   456
    ^workingDirectory notNil ifTrue:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   457
        workingDirectory
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   458
    ] ifFalse: [
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   459
        Filename currentDirectory pathName
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   460
    ]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   461
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   462
    "Created: / 11-05-2011 / 08:26:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   463
    "Modified (format): / 27-12-2011 / 15:54:08 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   464
    "Modified: / 01-10-2012 / 14:38:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   465
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   466
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   467
workingDirectory:aStringOrFilename
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   468
    aStringOrFilename asFilename isDirectory ifFalse:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   469
        self error:'Working directory does not exist'.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   470
        ^self.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   471
    ].    
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   472
    workingDirectory := aStringOrFilename asString.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   473
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   474
    "Modified: / 01-10-2012 / 14:38:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   475
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   476
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   477
!HGCommand methodsFor:'executing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   478
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   479
execute
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   480
    | stdoutPipe stdout stderrPipe stderr pid environment status  args |
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   481
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   482
    workers := OrderedCollection new.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   483
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   484
    stdoutPipe := NonPositionableExternalStream makePipe.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   485
    stdout := stdoutPipe first.
52
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   486
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   487
    stderrPipe := NonPositionableExternalStream makePipe.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   488
    stderr := stderrPipe first.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   489
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   490
    environment := OperatingSystem isUNIXlike 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   491
                    ifTrue:[OperatingSystem getEnvironment copy]
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   492
                    ifFalse:[environment := Dictionary new].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   493
    environment at: 'HGEDITOR' put: 'true'.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   494
52
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   495
    environment at:'LANG' put:'C'.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   496
52
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   497
    args := self arguments.
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   498
    OperatingSystem isMSWINDOWSlike ifTrue:[
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   499
        args := String streamContents:[:s|
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   500
            args 
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   501
                do:[:each | s nextPut:$"; nextPutAll: each; nextPut: $"]
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   502
                separatedBy: [ s space ]
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   503
        ]
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   504
    ].
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   505
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   506
    blocker := (Semaphore new:-2) name: 'Waiting for hg command to finish'.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   507
    Processor monitor:[
207
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
   508
        Tracing ifTrue:[
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
   509
            Logger log: 'executing: ' , (args asStringWith:' ') severity: #trace facility: 'HG'.
fce7e7b62741 HGCommand: added tracing of executed commands.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
   510
        ].
52
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   511
        pid := OperatingSystem exec:(self executable) withArguments:args
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   512
            environment:environment
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   513
            fileDescriptors:{0 . stdoutPipe second fileDescriptor . stderrPipe second fileDescriptor}
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   514
            fork:true 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   515
            newPgrp:false 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   516
            inDirectory:self workingDirectory
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   517
    ] action:[:stat |
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   518
        status := stat.
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   519
        blocker signal.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   520
    ].
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   521
    
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   522
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   523
    stdoutPipe second close.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   524
    stderrPipe second close.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   525
    pid isNil ifTrue:[
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   526
        HGCommandError raiseErrorString: 'cannot execute hg command'.
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   527
        stdout close.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   528
        ^ self.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   529
    ].
95
83ee62dc9491 HGCommand: fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 88
diff changeset
   530
    (Debugging and:[OperatingSystem isUNIXlike]) ifTrue:[
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   531
        stdout := stdout contents asString readStream.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   532
        stderr := stderr contents asString readStream.
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
   533
    ].
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   534
    self spawn: [ result := self parseOutput: stdout ].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   535
    self spawn: [ error  := self parseError:  stderr ].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   536
    [
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   537
        blocker wait.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   538
    ] ensure:[
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   539
        stderr close.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   540
        stdout close.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   541
    ].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   542
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   543
    ^self status: status result: result error: error
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   544
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   545
    "
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   546
        SVNv2::Command info: 'https://swing.fit.cvut.cz/svn/stx/libsvn'
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   547
    "
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   548
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   549
    "Created: / 11-05-2011 / 07:45:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   550
    "Modified: / 17-12-2011 / 19:22:00 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   551
    "Modified (format): / 27-12-2011 / 15:53:54 / dundee"
52
281850dff0ac HGCommand: changed: #execute: on Windows arguments must be passed as string.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 51
diff changeset
   552
    "Modified: / 14-11-2012 / 13:41:57 / jv"
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   553
    "Modified: / 04-02-2013 / 12:27:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   554
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   555
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   556
!HGCommand methodsFor:'private'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   557
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   558
arguments
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   559
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   560
    ^ OrderedCollection streamContents:[:s |
165
4f6432cf4240 Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   561
        s nextPut: self executable.
4f6432cf4240 Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   562
        s nextPut: '--noninteractive'.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   563
        self argumentsGlobalOn:s.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   564
        s nextPut:self command.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   565
        self argumentsCommandOn:s.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   566
    ].
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   567
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   568
    "Created: / 11-05-2011 / 07:58:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   569
    "Modified (format): / 27-12-2011 / 15:47:23 / dundee"
165
4f6432cf4240 Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
   570
    "Modified: / 16-12-2012 / 00:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   571
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   572
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   573
argumentsCommandOn:stream
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   574
    "Called to get command specific options"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   575
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   576
    self subclassResponsibility
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   577
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   578
    "Created: / 11-05-2011 / 07:58:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   579
    "Modified (format): / 27-12-2011 / 15:46:59 / dundee"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
   580
    "Modified: / 16-11-2012 / 22:31:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   581
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   582
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   583
argumentsGlobalOn:arg
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   584
    "Called to get global options"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   585
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   586
    "Created: / 11-05-2011 / 07:58:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   587
    "Modified (format): / 27-12-2011 / 15:47:10 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   588
    "Modified: / 30-09-2012 / 23:43:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   589
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   590
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   591
command
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   592
    "Returns the git 'command' option, i.e. commit,
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   593
     push, pull, ..."
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   594
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   595
    ^self class nameWithoutPrefix
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   596
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   597
    "
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   598
        HGCommand::push basicNew command
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   599
    "
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   600
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   601
    "Created: / 11-05-2011 / 07:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   602
    "Modified (format): / 27-12-2011 / 15:47:17 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   603
    "Modified: / 30-09-2012 / 23:37:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   604
    "Modified (comment): / 17-10-2012 / 13:25:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   605
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   606
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   607
executable
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   608
    ^ self class hgCommand
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   609
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
   610
    "Modified: / 19-11-2012 / 21:48:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   611
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   612
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   613
parseError:stream 
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   614
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   615
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   616
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   617
    ^ (self parserOn: stream) parseError.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   618
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   619
    "Created: / 04-02-2013 / 11:59:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   620
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   621
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   622
parseOutput:stream 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   623
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   624
     etc."
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   625
    
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   626
    ^ self subclassResponsibility
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   627
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   628
    "Created: / 11-05-2011 / 07:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   629
    "Created: / 17-12-2011 / 17:02:41 / dundee"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   630
    "Modified (comment): / 17-10-2012 / 13:14:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   631
!
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   632
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   633
parserOn: aStream
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   634
    "Returns an HGCommandParser initialized on given stream."
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   635
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   636
    ^HGCommandParser on: aStream
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   637
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   638
    "Created: / 04-02-2013 / 12:17:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   639
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   640
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   641
spawn:aBlock
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   642
    "Spawn a new background thread executing given block"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   643
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   644
    | worker |
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   645
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   646
    worker := aBlock newProcess.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   647
    workers add: worker.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   648
    worker addExitAction:[ blocker signal. workers remove: worker ].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   649
    worker resume.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   650
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   651
    "Created: / 04-02-2013 / 11:55:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   652
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   653
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   654
status: status result: res
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   655
    "Called when hg command finishes, passing it's status and result from parser"
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   656
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   657
    status success ifFalse:[
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   658
        HGCommandError raiseErrorString: ('hg command failed (status %1)' expandMacrosWith: status code) .
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   659
    ].
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   660
    ^res
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   661
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   662
    "Created: / 15-11-2012 / 17:04:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   663
    "Modified (format): / 04-02-2013 / 12:12:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   664
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   665
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   666
status: status result: res error: err
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   667
    "Called when hg command finishes, passing it's status, result and possible error from parser"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   668
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   669
    err notNil ifTrue:[
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   670
        err raise.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   671
        ^self
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   672
    ].
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   673
    ^self status: status result: res
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   674
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   675
    "Created: / 04-02-2013 / 12:12:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   676
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   677
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   678
!HGCommand::add methodsFor:'accessing'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   679
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   680
paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   681
    ^ paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   682
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   683
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   684
paths:something
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   685
    paths := something.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   686
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   687
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   688
!HGCommand::add methodsFor:'private'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   689
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   690
argumentsCommandOn:stream
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   691
    "Called to get command specific options"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   692
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   693
    paths isEmptyOrNil ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   694
        self error: 'No paths given'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   695
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   696
    stream nextPutAll: paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   697
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   698
    "Created: / 15-11-2012 / 00:05:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   699
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   700
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   701
parseOutput:stream 
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   702
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   703
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   704
    
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   705
    ^ nil
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   706
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   707
    "Modified: / 15-11-2012 / 00:38:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   708
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   709
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   710
!HGCommand::branches methodsFor:'accessing'!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   711
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   712
active
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   713
    ^ active
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   714
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   715
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   716
active:aBoolean
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   717
    active := aBoolean.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   718
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   719
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   720
closed
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   721
    ^ closed
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   722
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   723
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   724
closed:aBoolean
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   725
    closed := aBoolean.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   726
! !
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   727
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   728
!HGCommand::branches methodsFor:'private'!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   729
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   730
argumentsCommandOn:stream
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   731
    "Called to get command specific options"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   732
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   733
    active == true ifTrue:[
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   734
        stream nextPut:'--active'
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   735
    ].
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   736
    closed == true ifTrue:[
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   737
        stream nextPut:'--closed'
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   738
    ].
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   739
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   740
    "Created: / 27-11-2012 / 19:54:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   741
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   742
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   743
argumentsGlobalOn:stream
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   744
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   745
    stream nextPut:'--debug' "/to get full node ids
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   746
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   747
    "Created: / 27-11-2012 / 19:54:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   748
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   749
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   750
parseOutput:stream 
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   751
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   752
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   753
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   754
    ^ (self parserOn:stream) parseCommandBranches
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   755
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   756
    "Created: / 27-11-2012 / 19:55:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   757
! !
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   758
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   759
!HGCommand::cat methodsFor:'accessing'!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   760
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   761
destination
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   762
    ^ destination
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   763
!
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   764
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   765
destination:aStringOrFilename
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   766
    destination := aStringOrFilename.
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   767
!
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   768
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   769
path
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   770
    ^ path
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   771
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   772
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   773
path:something
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   774
    path := something.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   775
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   776
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   777
revision
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   778
    ^ revision
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   779
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   780
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   781
revision:something
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   782
    revision := something.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   783
! !
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   784
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   785
!HGCommand::cat methodsFor:'executing'!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   786
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   787
execute
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   788
    "
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   789
    A hacked version of #execute that returns a open read
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   790
    stream to read directly from 'hg cat' stdout...
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   791
    
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   792
    "
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   793
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   794
    | pipe output pid environment sema args sout exec |
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   795
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   796
    pipe := NonPositionableExternalStream makePipe.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   797
    output := pipe first.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   798
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   799
    OperatingSystem isUNIXlike ifTrue:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   800
        environment := OperatingSystem getEnvironment copy.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   801
    ] ifFalse:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   802
        environment := Dictionary new.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   803
    ].
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   804
    environment at:'LANG' put:'C'.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   805
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   806
    args := self arguments.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   807
    OperatingSystem isMSWINDOWSlike ifTrue:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   808
        args := String streamContents:[:s|
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   809
            args 
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   810
                do:[:each | s nextPut:$"; nextPutAll: each; nextPut: $"]
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   811
                separatedBy: [ s space ]
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   812
        ]
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   813
    ].
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   814
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   815
    sout := destination notNil 
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   816
                ifTrue:[destination asFilename writeStream]
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   817
                ifFalse:[pipe second].
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   818
    sema := Semaphore new name: 'Waiting for hg command to finish'.
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   819
    exec := [
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   820
        pid := OperatingSystem exec:(self executable) withArguments:args
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   821
                environment:environment
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   822
                fileDescriptors:{0 . sout fileDescriptor . pipe second fileDescriptor}
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   823
                fork:true 
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   824
                newPgrp:false 
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   825
                inDirectory:self workingDirectory.
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   826
    ].
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   827
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   828
    destination notNil ifTrue:[
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   829
        Processor 
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   830
            monitor:exec
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   831
            action:[:stat |
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   832
                sema signal.
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   833
            ].
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   834
    ] ifFalse:[
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   835
        exec value
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   836
    ].
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   837
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   838
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   839
    pipe second close.
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   840
    sout close.
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   841
    pid isNil ifTrue:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   842
        HGCommandError raiseErrorString: 'cannot execute hg command'.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   843
        output close.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   844
        ^ self.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   845
    ].
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   846
    ^destination notNil 
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   847
        ifTrue:[sema wait. nil]
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   848
        ifFalse:[output].
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   849
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   850
    "Created: / 17-11-2012 / 00:13:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
126
952efea00dd2 More SourceCodeManager API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   851
    "Modified: / 04-12-2012 / 10:10:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   852
! !
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   853
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   854
!HGCommand::cat methodsFor:'private'!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   855
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   856
argumentsCommandOn:stream
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   857
    "Called to get command specific options"
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   858
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   859
    path isNil ifTrue:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   860
        self error:'No path specified'
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   861
    ].
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   862
    revision isNil ifTrue:[
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   863
        self error:'No revision specified'
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   864
    ].
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   865
    stream nextPut:'--rev'; nextPut: revision asString.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   866
    stream nextPut:path
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   867
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   868
    "Modified: / 17-11-2012 / 00:09:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   869
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   870
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   871
parseOutput:stream 
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   872
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   873
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   874
    
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   875
    ^ self shouldImplement
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   876
! !
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   877
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   878
!HGCommand::clone methodsFor:'accessing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   879
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   880
path
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   881
    ^ path
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   882
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   883
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   884
path:something
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   885
    path := something.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   886
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   887
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   888
url
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   889
    ^ url
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   890
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   891
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   892
url:something
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   893
    url := something.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   894
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   895
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   896
!HGCommand::clone methodsFor:'private'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   897
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   898
argumentsCommandOn:stream
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   899
    "Called to get command specific options"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   900
    update == false ifTrue:[
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   901
        stream nextPut:'--noupdate'.
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   902
    ].
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   903
    stream nextPut: url; nextPut: path.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   904
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   905
    "Created: / 01-10-2012 / 00:04:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
   906
    "Modified: / 21-11-2012 / 00:17:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   907
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   908
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   909
parseOutput:stream 
63
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
   910
    "superclass Command says that I am responsible to implement this method"
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   911
    
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   912
    ^ nil
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   913
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
   914
    "Modified: / 14-11-2012 / 22:42:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   915
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   916
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   917
!HGCommand::commit methodsFor:'accessing'!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   918
146
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   919
author
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   920
    ^ author
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   921
!
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   922
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   923
author:aString
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   924
    author := aString.
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   925
!
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   926
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   927
date
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   928
    ^ date
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   929
!
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   930
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   931
date:aTimestampOrString
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   932
    date := aTimestampOrString.
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   933
!
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   934
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   935
files
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   936
    ^ files
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   937
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   938
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   939
files:something
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   940
    files := something.
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   941
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   942
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   943
message
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   944
    ^ message
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   945
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   946
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   947
message:something
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   948
    message := something.
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   949
! !
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   950
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   951
!HGCommand::commit methodsFor:'private'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   952
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   953
argumentsCommandOn:stream
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   954
    "Called to get command specific options"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   955
73
eb731ce2685e Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   956
    author notNil ifTrue:[
eb731ce2685e Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   957
        stream nextPut:'--user'; nextPut: author
eb731ce2685e Fixed HGStXTests>>test_commit_01
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   958
    ].
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   959
    date notNil ifTrue:[
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   960
        stream nextPut:'--date'.
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   961
        date isTimestamp ifTrue:[
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   962
            stream nextPut: (date printStringFormat: '%(year)-%(month)-%(day) %H:%m:%S')
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   963
        ] ifFalse:[
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   964
            stream nextPut: date asString
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   965
        ]
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   966
    ].
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   967
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   968
    stream nextPut:'-m'; nextPut: message.
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   969
    files notNil ifTrue:[
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   970
        stream nextPutAll: files
49
ffb879bfafe7 - stx_libscm_mercurial
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 40
diff changeset
   971
    ].
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   972
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   973
    "Created: / 12-11-2012 / 22:38:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
146
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   974
    "Modified: / 07-12-2012 / 15:32:51 / jv"
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   975
    "Modified: / 01-02-2013 / 14:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   976
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   977
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   978
parseError:stream 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   979
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   980
     etc."
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   981
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   982
    ^ (self parserOn: stream) parseErrorCommit.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   983
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   984
    "Created: / 04-02-2013 / 12:28:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   985
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   986
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   987
parseOutput:stream 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   988
    "superclass HGCommand says that I am responsible to implement this method"
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   989
    "Nothing to do"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
   990
    "Modified: / 12-11-2012 / 22:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   991
!
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   992
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   993
status: status result: result
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   994
    "Called when hg command finishes, passing it's status and result from parser"
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   995
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   996
    (status code ~~ 0 and:[status code ~~ 1]) ifTrue:[
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   997
        HGCommandError raiseErrorString: ('hg command failed (status %1)' expandMacrosWith: status code) .
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   998
    ].
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
   999
    ^result
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1000
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1001
    "Created: / 15-11-2012 / 17:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1002
! !
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1003
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1004
!HGCommand::heads methodsFor:'private'!
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1005
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1006
argumentsCommandOn:stream
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1007
    "Called to get command specific options"
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1008
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1009
    stream 
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1010
        nextPut:'--template';
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1011
        nextPut:HGCommandParser templateHeads.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1012
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1013
    "Created: / 27-11-2012 / 21:30:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1014
!
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1015
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1016
parseOutput:stream 
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1017
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1018
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1019
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1020
    ^ (self parserOn:stream) parseCommandHeads
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1021
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1022
    "Created: / 27-11-2012 / 21:30:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1023
! !
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
  1024
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1025
!HGCommand::locate methodsFor:'accessing'!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1026
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1027
revision
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1028
    ^ revision
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1029
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1030
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1031
revision:rev
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1032
    revision := rev.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1033
! !
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1034
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1035
!HGCommand::locate methodsFor:'private'!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1036
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1037
argumentsCommandOn:stream
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1038
    "Called to get command specific options"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1039
165
4f6432cf4240 Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
  1040
    "/stream nextPut:'--print0'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1041
    revision notNil ifTrue:[
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1042
        stream nextPut: '--rev'; nextPut: revision printString.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1043
    ].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1044
165
4f6432cf4240 Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 151
diff changeset
  1045
    "Modified: / 16-12-2012 / 00:09:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1046
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1047
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1048
parseOutput:stream 
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1049
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1050
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1051
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1052
    ^ (self parserOn:stream) parseCommandLocate
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1053
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1054
    "Modified: / 16-11-2012 / 22:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1055
! !
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
  1056
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1057
!HGCommand::log methodsFor:'accessing'!
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1058
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1059
childrenOnly
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1060
    ^ childrenOnly
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1061
!
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1062
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1063
childrenOnly:aBoolean
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1064
    childrenOnly := aBoolean.
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1065
!
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1066
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1067
path
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1068
    ^ path
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1069
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1070
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1071
path:aString
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1072
    path := aString.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1073
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1074
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1075
revset: revset
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1076
    revsets isNil ifTrue:[revsets := OrderedCollection new].
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1077
    revsets add: revset.
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1078
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1079
    "Created: / 22-01-2013 / 16:16:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1080
!
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1081
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1082
revsets: aCollection
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1083
    revsets isNil ifTrue:[
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1084
        revsets := aCollection
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1085
    ] ifFalse:[
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1086
        revsets addAll: aCollection
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1087
    ].
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1088
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1089
    "Created: / 22-01-2013 / 16:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1090
! !
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1091
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1092
!HGCommand::log methodsFor:'private'!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1093
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1094
argumentsCommandOn:stream
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1095
    "Called to get command specific options"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1096
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1097
    | template |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1098
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1099
    path isNil ifTrue:[
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1100
        revsets isEmptyOrNil ifTrue:[
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1101
            self error:'No revisions given'.
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1102
        ].
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1103
        revsets do:[:revset|
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1104
            stream nextPut:'--rev'.
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1105
            stream nextPut:revset asString
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1106
        ].
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1107
        template := HGCommandParser templateLog.
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1108
    ] ifFalse:[
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1109
        stream nextPut: '--follow'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1110
        template := HGCommandParser templateLogFile.
40
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1111
    ].
e3699c0b00f9 Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
  1112
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1113
    childrenOnly == true ifTrue:[
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1114
        template := HGCommandParser templateLogChildren.
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1115
    ].
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1116
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1117
    stream 
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1118
        nextPut:'--debug';
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1119
        nextPut:'--template';
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1120
        nextPut:template.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1121
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1122
    path notNil ifTrue:[
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1123
        stream nextPut: path.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 126
diff changeset
  1124
    ].
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1125
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1126
    "Created: / 13-11-2012 / 09:05:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
191
f0745f4cdc97 Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
  1127
    "Modified: / 22-01-2013 / 16:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1128
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1129
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1130
parseOutput:stream 
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1131
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1132
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1133
    
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1134
    childrenOnly == true ifTrue:[
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1135
        ^ (self parserOn:stream) parseCommandLogChildren.
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1136
    ].
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1137
    ^ path isNil 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1138
        ifTrue:[ (self parserOn:stream) parseCommandLog ]
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1139
        ifFalse:[ (self parserOn:stream) parseCommandLogFile ]
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1140
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
  1141
    "Created: / 13-11-2012 / 09:05:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
137
379bd934f8d0 Make HGChangeset>>children dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
  1142
    "Modified: / 05-12-2012 / 23:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1143
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1144
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1145
!HGCommand::merge methodsFor:'accessing'!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1146
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1147
revision
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1148
    ^ revision
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1149
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1150
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1151
revision:something
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1152
    revision := something.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1153
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1154
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1155
tool
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1156
    ^ tool
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1157
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1158
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1159
tool:aString
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1160
    tool := aString.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1161
! !
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1162
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1163
!HGCommand::merge methodsFor:'private'!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1164
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1165
argumentsCommandOn:stream
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1166
    "Called to get command specific options"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1167
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1168
    revision notNil ifTrue:[
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1169
        stream nextPut:'--rev'; nextPut: revision asString.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1170
    ].
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1171
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1172
    revision notNil ifTrue:[
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1173
        stream nextPut:'--tool'; nextPut: tool asString.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1174
    ].
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1175
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1176
    "Modified: / 14-01-2013 / 15:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1177
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1178
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1179
parseOutput:stream 
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1180
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1181
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1182
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1183
    ^ (self parserOn:stream) parseCommandMerge
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1184
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1185
    "Modified: / 14-01-2013 / 16:00:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1186
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1187
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1188
status: status result: result
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1189
    "Called when hg command finishes, passing it's status and result from parser"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1190
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1191
    (status code ~~ 0 and:[status code ~~ 1]) ifTrue:[
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1192
        HGCommandError raiseErrorString: ('hg command failed (status %1)' expandMacrosWith: status code) .
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1193
    ].
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1194
    ^result
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1195
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1196
    "Created: / 14-01-2013 / 16:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1197
! !
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1198
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1199
!HGCommand::mv methodsFor:'accessing'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1200
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1201
destination
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1202
    ^ destination
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1203
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1204
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1205
destination:something
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1206
    destination := something.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1207
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1208
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1209
source
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1210
    ^ source
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1211
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1212
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1213
source:something
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1214
    source := something.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1215
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1216
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1217
!HGCommand::mv methodsFor:'private'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1218
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1219
argumentsCommandOn:stream
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1220
    "Called to get command specific options"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1221
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1222
    source isNil ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1223
        self error:'No source'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1224
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1225
    source asFilename exists ifFalse:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1226
        self error:('(Source does not exist (%1)' bindWith: source)
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1227
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1228
    destination isNil ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1229
        self error:'No destination'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1230
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1231
    stream nextPut: source asString; nextPut: destination.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1232
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1233
    "Created: / 15-11-2012 / 00:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1234
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1235
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1236
parseOutput:stream 
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1237
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1238
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1239
    
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1240
    ^ nil
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1241
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1242
    "Modified: / 15-11-2012 / 00:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1243
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1244
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1245
!HGCommand::pull methodsFor:'private'!
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1246
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1247
argumentsCommandOn:stream
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1248
    "Called to get command specific options"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1249
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1250
    url notNil ifTrue:[
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1251
        stream nextPut: url.
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1252
    ].
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1253
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1254
    "Created: / 30-09-2012 / 23:44:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1255
    "Modified: / 15-11-2012 / 09:56:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1256
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1257
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1258
parseOutput:stream 
63
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
  1259
    "superclass HGCommand says that I am responsible to implement this method"
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1260
    
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1261
    ^ nil
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1262
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1263
    "Modified: / 15-11-2012 / 09:53:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1264
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1265
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1266
!HGCommand::push methodsFor:'accessing'!
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1267
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1268
force
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1269
    ^ force
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1270
!
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1271
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1272
force:something
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1273
    force := something.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1274
!
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1275
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1276
url
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1277
    ^ url
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1278
!
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1279
206
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1280
url:remote
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1281
    url := remote.
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1282
! !
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1283
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1284
!HGCommand::push methodsFor:'private'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1285
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1286
argumentsCommandOn:stream
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1287
    "Called to get command specific options"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1288
206
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1289
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1290
    stream nextPut: (url ? 'default').
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1291
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1292
    force == true ifTrue:[
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1293
        stream nextPut:'--force'
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
  1294
    ]
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1295
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1296
    "Created: / 30-09-2012 / 23:44:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
206
7985d1be806a Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 191
diff changeset
  1297
    "Modified: / 29-01-2013 / 15:42:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1298
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1299
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1300
parseError:stream 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1301
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1302
     etc."
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1303
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1304
    ^ (self parserOn: stream) parseErrorPush.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1305
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1306
    "Created: / 04-02-2013 / 12:53:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1307
!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1308
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1309
parseOutput:stream 
63
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
  1310
    "superclass HGCommand says that I am responsible to implement this method"
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1311
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1312
    ^ (self parserOn:stream) parseCommandPush
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1313
151
527a1e85aef8 Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
  1314
    "Modified: / 10-12-2012 / 02:15:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1315
!
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1316
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1317
status: status result: result
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1318
    "Called when hg command finishes, passing it's status and result from parser"
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1319
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1320
    (status code ~~ 0 and:[status code ~~ 1]) ifTrue:[
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1321
        HGCommandError raiseErrorString: ('hg command failed (status %1)' expandMacrosWith: status code) .
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1322
    ].
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1323
    ^result
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1324
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 57
diff changeset
  1325
    "Created: / 15-11-2012 / 17:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1326
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1327
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1328
!HGCommand::remove methodsFor:'accessing'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1329
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1330
paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1331
    ^ paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1332
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1333
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1334
paths:something
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1335
    paths := something.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1336
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1337
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1338
!HGCommand::remove methodsFor:'private'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1339
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1340
argumentsCommandOn:stream
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1341
    "Called to get command specific options"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1342
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1343
    paths isEmptyOrNil ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1344
        self error: 'No paths given'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1345
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1346
    stream nextPutAll: paths
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1347
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1348
    "Created: / 15-11-2012 / 00:05:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1349
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1350
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1351
parseOutput:stream 
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1352
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1353
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1354
    
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1355
    ^ nil
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1356
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1357
    "Modified: / 15-11-2012 / 00:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1358
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1359
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1360
!HGCommand::resolve class methodsFor:'initialization'!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1361
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1362
initialize
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1363
    "Invoked at system start or when the class is dynamically loaded."
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1364
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1365
    "/ please change as required (and remove this comment)
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1366
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1367
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1368
! !
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1369
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1370
!HGCommand::resolve methodsFor:'accessing'!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1371
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1372
files
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1373
    ^ files
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1374
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1375
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1376
files:something
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1377
    files := something.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1378
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1379
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1380
mark
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1381
    ^ mark
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1382
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1383
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1384
mark:something
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1385
    mark := something.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1386
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1387
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1388
tool
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1389
    ^ tool
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1390
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1391
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1392
tool:something
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1393
    tool := something.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1394
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1395
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1396
unmark
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1397
    ^ unmark
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1398
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1399
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1400
unmark:something
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1401
    unmark := something.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1402
! !
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1403
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1404
!HGCommand::resolve methodsFor:'private'!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1405
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1406
argumentsCommandOn:stream
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1407
    "Called to get command specific options"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1408
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1409
    tool notNil ifTrue:[
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1410
        stream nextPut:'--tool'; nextPut: tool
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1411
    ].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1412
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1413
    mark ifTrue:[
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1414
        self assert: (unmark isNil or:[unmark not]).
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1415
        stream nextPut: '--mark'.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1416
    ].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1417
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1418
    unmark ifTrue:[
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1419
        self assert: (mark isNil or:[mark not]).
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1420
        stream nextPut: '--unmark'.
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1421
    ].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1422
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1423
    files do:[:f|stream nextPut: f].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1424
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1425
    "Modified: / 14-01-2013 / 19:29:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1426
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1427
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1428
parseOutput:stream 
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1429
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1430
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1431
    
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1432
    ^ nil
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1433
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1434
    "Modified: / 14-01-2013 / 19:27:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1435
!
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1436
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1437
status: status result: result
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1438
    "Called when hg command finishes, passing it's status and result from parser"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1439
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1440
    status code == 0 ifTrue:[ ^ true ].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1441
    status code == 1 ifTrue:[ ^ false].
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1442
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1443
    HGCommandError raiseErrorString: ('hg command failed (status %1)' expandMacrosWith: status code).
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1444
    ^false
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1445
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1446
    "Created: / 14-01-2013 / 19:27:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1447
! !
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1448
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1449
!HGCommand::resolve__list methodsFor:'private'!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1450
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1451
argumentsCommandOn:stream
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1452
    "Called to get command specific options"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1453
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1454
    stream nextPut: '--list'
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1455
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1456
    "Modified: / 14-01-2013 / 16:43:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1457
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1458
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1459
command
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1460
    ^'resolve'
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1461
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1462
    "Created: / 14-01-2013 / 16:50:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1463
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1464
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1465
parseOutput:stream 
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1466
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1467
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1468
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1469
    ^ (self parserOn:stream) parseCommandResolveList
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1470
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1471
    "Modified: / 14-01-2013 / 16:43:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1472
! !
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1473
142
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1474
!HGCommand::showconfig methodsFor:'accessing'!
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1475
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1476
argumentsCommandOn:stream
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1477
    "Called to get command specific options"
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1478
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1479
    key notNil ifTrue:[
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1480
        stream nextPut: key
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1481
    ].
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1482
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1483
    "Created: / 06-12-2012 / 15:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
145
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1484
!
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1485
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1486
parseOutput:stream 
145
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1487
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1488
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1489
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1490
    ^ (self parserOn:stream) parseCommandShowConfig
145
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1491
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
  1492
    "Created: / 06-12-2012 / 21:45:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
142
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1493
! !
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 141
diff changeset
  1494
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1495
!HGCommand::status methodsFor:'accessing'!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1496
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1497
path
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1498
    ^ path
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1499
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1500
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1501
path:aString
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1502
    path := aString.
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1503
! !
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1504
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1505
!HGCommand::status methodsFor:'private'!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1506
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1507
argumentsCommandOn:stream
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1508
    "Called to get command specific options"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1509
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1510
    stream nextPut:'-A'.
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1511
    path notNil ifTrue:[stream nextPut: path]
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1512
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1513
    "Created: / 23-10-2012 / 11:09:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1514
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1515
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1516
parseOutput:stream 
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1517
    ^ (self parserOn:stream) parseCommandStatus
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1518
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1519
    "Modified: / 23-10-2012 / 11:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1520
! !
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
  1521
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1522
!HGCommand::update methodsFor:'accessing'!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1523
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1524
revision
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1525
    ^ revision
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1526
!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1527
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1528
revision:something
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1529
    revision := something.
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1530
! !
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1531
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1532
!HGCommand::update methodsFor:'private'!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1533
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1534
argumentsCommandOn:stream
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1535
    "Called to get command specific options"
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1536
102
16bc16d9e6d5 Update logical revision on commit,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 95
diff changeset
  1537
    revision notNil ifTrue:[
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1538
        stream nextPut:'--rev'; nextPut: revision asString.
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1539
    ].
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1540
102
16bc16d9e6d5 Update logical revision on commit,
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 95
diff changeset
  1541
    "Modified: / 23-11-2012 / 23:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1542
!
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1543
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1544
parseOutput:stream 
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1545
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1546
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1547
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1548
    ^ (self parserOn:stream) parseCommandUpdate
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1549
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
  1550
    "Modified: / 14-01-2013 / 16:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1551
! !
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 82
diff changeset
  1552
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1553
!HGCommand::version methodsFor:'accessing'!
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1554
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1555
executable
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1556
    ^ executable notNil 
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1557
        ifTrue:[executable]
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1558
        ifFalse:[self class hgCommand]
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1559
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1560
    "Modified (format): / 21-01-2013 / 05:06:54 / jv"
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1561
!
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1562
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1563
executable:aString
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1564
    executable := aString.
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1565
! !
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1566
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1567
!HGCommand::version methodsFor:'private'!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1568
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1569
arguments
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1570
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1571
    ^ Array with: HGExecutable with: '--version'
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1572
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1573
    "Created: / 19-11-2012 / 20:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1574
!
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1575
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1576
parseOutput:stream 
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1577
    "Parses output of 'hg' command, i.e. commit, log, update, checkout, 
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1578
     etc."
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1579
    
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
  1580
    ^ (self parserOn:stream) parseCommandVersion
80
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1581
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1582
    "Created: / 19-11-2012 / 20:02:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1583
! !
8f300696b26b Added configurable path to 'hg' command.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 78
diff changeset
  1584
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1585
!HGCommand class methodsFor:'documentation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1586
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1587
version_HG
115
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 109
diff changeset
  1588
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 109
diff changeset
  1589
    ^ '$Changeset: <not expanded> $'
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1590
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 52
diff changeset
  1591
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1592
version_SVN
57
47b14a8b7eb8 Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1593
    ^ '§Id::                                                                                                                        §'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1594
! !
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
  1595
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 179
diff changeset
  1596
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 37
diff changeset
  1597
HGCommand initialize!
178
1ed827252fee More work on merging. Not yet finished.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
  1598
HGCommand::resolve initialize!