author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 13 Feb 2014 16:25:49 +0000 | |
changeset 371 | f271ddd2b5e0 |
parent 335 | 7e19ab19148b |
child 395 | fc0607653d8a |
permissions | -rw-r--r-- |
210 | 1 |
" |
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
2 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
3 |
Copyright (C) 2012-2013 Jan Vrany |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
4 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
8 |
version 2.1 of the License. |
210 | 9 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
13 |
Lesser General Public License for more details. |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
14 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
210 | 18 |
" |
34 | 19 |
"{ Package: 'stx:libscm/mercurial' }" |
20 |
||
21 |
Object subclass:#HGRepository |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
22 |
instanceVariableNames:'uuid path wc changesets branches heads config lock server' |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
23 |
classVariableNames:'Cache UseCommandServer' |
34 | 24 |
poolDictionaries:'' |
25 |
category:'SCM-Mercurial-Core' |
|
26 |
! |
|
27 |
||
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
28 |
HGRepositoryObject subclass:#Changesets |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
29 |
instanceVariableNames:'changesets revno2nodeIdMap' |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
30 |
classVariableNames:'' |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
31 |
poolDictionaries:'' |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
32 |
privateIn:HGRepository |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
33 |
! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
34 |
|
210 | 35 |
!HGRepository class methodsFor:'documentation'! |
36 |
||
37 |
copyright |
|
38 |
" |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
39 |
stx:libscm - a new source code management library for Smalltalk/X |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
40 |
Copyright (C) 2012-2013 Jan Vrany |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
41 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
42 |
This library is free software; you can redistribute it and/or |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
43 |
modify it under the terms of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
44 |
License as published by the Free Software Foundation; either |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
45 |
version 2.1 of the License. |
210 | 46 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
47 |
This library is distributed in the hope that it will be useful, |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
48 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
49 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
50 |
Lesser General Public License for more details. |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
51 |
|
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
52 |
You should have received a copy of the GNU Lesser General Public |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
53 |
License along with this library; if not, write to the Free Software |
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
54 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
210 | 55 |
" |
56 |
! ! |
|
34 | 57 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
58 |
!HGRepository class methodsFor:'initialization'! |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
59 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
60 |
flush |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
61 |
"Flush all cached repositories" |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
62 |
|
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
63 |
Cache := CacheDictionary new: 8 |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
64 |
|
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
65 |
"Created: / 25-01-2013 / 18:58:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
66 |
! |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
67 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
68 |
initialize |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
69 |
"Invoked at system start or when the class is dynamically loaded." |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
70 |
|
256 | 71 |
| useCommandServer | |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
72 |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
73 |
Cache := CacheDictionary new: 8. |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
74 |
|
256 | 75 |
useCommandServer := OperatingSystem getEnvironment: 'STX_LIBSCM_MERCURIAL_USE_COMMAND_SERVER'. |
76 |
useCommandServer isNil ifTrue:[ |
|
77 |
UseCommandServer := false. |
|
78 |
] ifFalse:[ |
|
263
0709ed7451a7
Fix in HGRepository: honour STX_LIBSCM_MERCURIAL_USE_COMMAND_SERVER env. variable.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
259
diff
changeset
|
79 |
UseCommandServer := (useCommandServer = '1'). |
256 | 80 |
] |
81 |
||
82 |
"Modified: / 09-03-2013 / 22:21:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
83 |
! ! |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
84 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
85 |
!HGRepository class methodsFor:'instance creation'! |
34 | 86 |
|
371
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
87 |
init: aStringOrFilename |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
88 |
"Create a new repository in given directory and |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
89 |
return HGRepository for it" |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
90 |
|
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
91 |
| dir | |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
92 |
|
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
93 |
dir := aStringOrFilename asFilename. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
94 |
dir exists ifTrue:[ |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
95 |
dir isDirectory ifTrue:[ |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
96 |
dir directoryContents notEmpty ifTrue:[ |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
97 |
HGRepositoryError raiseErrorString: 'Directory exists but not empty'. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
98 |
^ self. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
99 |
]. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
100 |
] ifFalse:[ |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
101 |
HGRepositoryError raiseErrorString: 'Given path is not a directory'. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
102 |
^ self. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
103 |
]. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
104 |
]. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
105 |
HGCommand init |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
106 |
path: dir; |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
107 |
execute. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
108 |
^self on: dir. |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
109 |
|
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
110 |
"Created: / 13-02-2014 / 12:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
111 |
! |
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
112 |
|
34 | 113 |
on: aStringOrFilename |
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
114 |
^self on: aStringOrFilename cached: false |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
115 |
|
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
116 |
"Created: / 17-10-2012 / 13:30:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
117 |
"Modified: / 16-12-2012 / 12:59:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
118 |
! |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
119 |
|
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
120 |
on: aStringOrFilename cached: cache |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
121 |
| path | |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
122 |
|
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
123 |
path := aStringOrFilename asFilename. |
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
124 |
^cache ifTrue:[ |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
125 |
Cache at: path ifAbsentPut:[self new initializeOn: path] |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
126 |
] ifFalse:[ |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
127 |
self new initializeOn: path |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
128 |
] |
34 | 129 |
|
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
130 |
"Created: / 16-12-2012 / 12:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 131 |
! ! |
132 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
133 |
!HGRepository class methodsFor:'cloning'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
134 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
135 |
clone: aFilenameOrUrlOrString to: aStringOrFilename |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
136 |
"Clones repository at given URL to given directory. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
137 |
Returns an instance HGRepository representing the clone." |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
138 |
|
88 | 139 |
^self clone: aFilenameOrUrlOrString to: aStringOrFilename update: true |
140 |
||
141 |
"Created: / 14-11-2012 / 22:46:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
142 |
"Modified: / 21-11-2012 / 00:20:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
143 |
! |
|
144 |
||
145 |
clone: aFilenameOrUrlOrString to: aStringOrFilename update: update |
|
146 |
"Clones repository at given URL to given directory. |
|
147 |
Returns an instance HGRepository representing the clone." |
|
148 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
149 |
| url dst dir | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
150 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
151 |
url := aFilenameOrUrlOrString asString. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
152 |
dst := aStringOrFilename asFilename. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
153 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
154 |
dst exists ifTrue:[ |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
155 |
HGError raiseErrorString: 'Cannot clone to existsing directory!!'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
156 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
157 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
158 |
dir := dst directory. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
159 |
dir exists ifFalse:[ |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
160 |
HGError raiseErrorString: 'Directory for clone does not exist!!'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
161 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
162 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
163 |
dir isWritable ifFalse:[ |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
164 |
HGError raiseErrorString: 'Cannot clone into write-protected directory'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
165 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
166 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
167 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
168 |
HGCommand clone |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
169 |
url: url; |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
170 |
path: dst pathName; |
88 | 171 |
update: update; |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
172 |
execute. |
371
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
173 |
^self on: dst. |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
174 |
|
88 | 175 |
"Created: / 21-11-2012 / 00:20:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
371
f271ddd2b5e0
Added 'Clone...' and 'Create...' menu entries to file browser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
335
diff
changeset
|
176 |
"Modified: / 13-02-2014 / 12:40:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
177 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
178 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
179 |
!HGRepository class methodsFor:'utilities'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
180 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
181 |
discover: aStringOrFilename |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
182 |
"Find a Mercurial repository in given directory or super-directories |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
183 |
and return it (as an instance of Filename). If no repository is found, |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
184 |
returns nil. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
185 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
186 |
Currently, it searches for presence of .hg directory" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
187 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
188 |
| f | |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
189 |
f := aStringOrFilename. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
190 |
f isDirectory ifFalse:[ |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
191 |
f := f directory |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
192 |
]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
193 |
[ ( f / '.hg' ) exists ] whileFalse:[ |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
194 |
f isRootDirectory ifTrue:[ ^nil ]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
195 |
f := f directory. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
196 |
]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
197 |
^f |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
198 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
199 |
"Created: / 13-11-2012 / 22:34:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
200 |
"Modified: / 14-11-2012 / 00:02:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
309
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
201 |
! |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
202 |
|
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
203 |
discoverPackage: packageId |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
204 |
"Find a Mercurial repository in current package path for given package id. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
205 |
and return it (as an instance of Filename). If no repository is found, |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
206 |
returns nil." |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
207 |
|
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
208 |
| pkg pkgDir i | |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
209 |
|
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
210 |
pkg := packageId. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
211 |
[ pkg notNil ] whileTrue:[ |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
212 |
pkgDir := Smalltalk getPackageDirectoryForPackage: pkg. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
213 |
(pkgDir notNil and:[(HGRepository discover: pkgDir) notNil]) ifTrue:[ |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
214 |
^self discover: pkgDir |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
215 |
]. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
216 |
i := pkg lastIndexOf: $/. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
217 |
i == 0 ifTrue:[ i := pkg lastIndexOf: $: ]. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
218 |
i > 1 ifTrue:[pkg := pkg copyTo: i - 1] ifFalse:[pkg := nil]. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
219 |
]. |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
220 |
^nil |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
221 |
|
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
222 |
"Modified: / 14-11-2012 / 00:02:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8ab1c777abad
Bugfix in HGSourceCodeManager>>#isResponsibleForPackage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
263
diff
changeset
|
223 |
"Created: / 04-07-2013 / 02:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
224 |
! ! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
225 |
|
34 | 226 |
!HGRepository methodsFor:'accessing'! |
227 |
||
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
228 |
branches |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
229 |
"Returns a list of named branches in the repository, |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
230 |
including closed ones" |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
231 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
232 |
branches isNil ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
233 |
branches := HGCachedFileData |
204
e68551e9cd0c
Bugfix in HGRepository>>#branches &#heads - check .hg/store/00changelog.i instead of old .hg/00changelog.i!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
203
diff
changeset
|
234 |
on: ((Filename named: self pathName) / '.hg' / 'store' / '00changelog.i') |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
235 |
reader:[:old | |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
236 |
| rbranches current names | |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
237 |
rbranches := old. |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
238 |
current := self execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
239 |
(HGCommand branches |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
240 |
workingDirectory: path pathName; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
241 |
active: false; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
242 |
closed: true; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
243 |
yourself). |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
244 |
names := rbranches collect:[:b|b name]. |
237
fc6b21de083e
Fix in HGRepository>>#branches when using command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
235
diff
changeset
|
245 |
current := current ? #() reject:[:b|names includes: b name]. |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
246 |
current do:[:b|b setRepository: self]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
247 |
rbranches addAll: current. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
248 |
rbranches isEmpty ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
249 |
rbranches add: (HGBranch new setName: 'default'; setRepository: self). |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
250 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
251 |
rbranches. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
252 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
253 |
branches setData: OrderedCollection new. |
176
78124cee58da
Bugfix: keep branch of mater working copy even if there are no changesets yet.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
175
diff
changeset
|
254 |
]. |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
255 |
^branches value |
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
256 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
257 |
"Created: / 27-11-2012 / 19:57:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
237
fc6b21de083e
Fix in HGRepository>>#branches when using command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
235
diff
changeset
|
258 |
"Modified: / 04-03-2013 / 09:41:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
259 |
! |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
260 |
|
145
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
261 |
config |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
262 |
^config |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
263 |
|
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
264 |
"Created: / 06-12-2012 / 21:40:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
265 |
! |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
266 |
|
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
267 |
heads |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
268 |
"Returns a list of heads (as HGChangeset)" |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
269 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
270 |
heads isNil ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
271 |
heads := HGCachedFileData |
204
e68551e9cd0c
Bugfix in HGRepository>>#branches &#heads - check .hg/store/00changelog.i instead of old .hg/00changelog.i!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
203
diff
changeset
|
272 |
on: ((Filename named: self pathName) / '.hg' / 'store' / '00changelog.i') |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
273 |
reader:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
274 |
| ids | |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
275 |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
276 |
ids := self execute: HGCommand heads. |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
277 |
ids collect:[:id|self changesetWithId: id]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
278 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
279 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
280 |
^heads value. |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
281 |
|
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
282 |
"Created: / 27-11-2012 / 21:33:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
283 |
"Modified: / 03-03-2013 / 22:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
284 |
! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
285 |
|
34 | 286 |
path |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
287 |
"Return path to the repository (directory with .hg store)" |
34 | 288 |
^ path |
289 |
||
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
290 |
"Modified (comment): / 13-11-2012 / 18:18:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 291 |
! |
292 |
||
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
293 |
pathName |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
294 |
"Return path to the repository (directory with .hg store)" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
295 |
^ path pathName |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
296 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
297 |
"Created: / 16-11-2012 / 22:36:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
298 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
299 |
|
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
300 |
remoteDefault |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
301 |
"Return default remote (upstream) repository or nil if none" |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
302 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
303 |
^self remotes detect:[:e|e isDefault] ifNone:[nil] |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
304 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
305 |
"Created: / 10-12-2012 / 01:26:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
306 |
! |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
307 |
|
150
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
308 |
remotes |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
309 |
"Returns a collection of configured remote (upstream) repositories" |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
310 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
311 |
| paths remotes | |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
312 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
313 |
paths := self config get: #paths default: nil. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
314 |
paths isNil ifTrue:[ ^ #() ]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
315 |
paths isEmpty ifTrue:[ ^ #() ]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
316 |
remotes := OrderedCollection new. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
317 |
paths keysAndValuesDo:[:name :url| |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
318 |
remotes add: (HGRemote new setRepository: self; setName: name url:url value). |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
319 |
]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
320 |
^remotes |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
321 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
322 |
"Created: / 09-12-2012 / 22:51:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
323 |
! |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
324 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
325 |
uuid |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
326 |
"Returns unique ID identifing this concrete instance |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
327 |
of a repository" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
328 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
329 |
^ uuid |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
330 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
331 |
"Modified (comment): / 14-11-2012 / 23:22:41 / 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:
46
diff
changeset
|
332 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
333 |
|
36 | 334 |
workingCopy |
335 |
wc isNil ifTrue:[ |
|
336 |
wc := HGWorkingCopy new setRepository: self. |
|
337 |
]. |
|
338 |
^wc |
|
339 |
||
340 |
"Created: / 19-10-2012 / 15:42:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
34 | 341 |
! ! |
342 |
||
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
343 |
!HGRepository methodsFor:'accessing-changesets'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
344 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
345 |
@ id |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
346 |
^self changesetWithId: id. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
347 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
348 |
"Created: / 16-11-2012 / 20:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
349 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
350 |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
351 |
changesetWithId: id |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
352 |
^changesets changesetWithId: id |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
353 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
354 |
"Created: / 13-11-2012 / 17:58:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
355 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
356 |
|
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
357 |
!HGRepository methodsFor:'accessing-private'! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
358 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
359 |
branchWithName: name |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
360 |
"Returns branch with given name. If there is no such branch, |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
361 |
an exception is raised" |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
362 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
363 |
^self branchWithName: name ifAbsent:[ |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
364 |
HGNoSuchBranchError newException |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
365 |
parameter: name; |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
366 |
messageText: 'No such branch: ', name; |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
367 |
raiseSignal |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
368 |
] |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
369 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
370 |
"Created: / 27-11-2012 / 13:55:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
371 |
! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
372 |
|
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
373 |
branchWithName: name createIfAbsent: create |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
374 |
|
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
375 |
^self branchWithName: name ifAbsent:[ |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
376 |
| b | |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
377 |
b := HGBranch new setRepository: self. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
378 |
b setName: name. |
212
8ec5884fba41
Fixed bugs introduced on 2013-01-22.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
379 |
branches value add: b. |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
380 |
b |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
381 |
] |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
382 |
|
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
383 |
"Created: / 10-12-2012 / 03:14:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
212
8ec5884fba41
Fixed bugs introduced on 2013-01-22.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
384 |
"Modified: / 01-02-2013 / 13:39:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
385 |
! |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
386 |
|
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
387 |
branchWithName: name ifAbsent: block |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
388 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
389 |
^self branches detect:[:b|b name = name] ifNone: block |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
390 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
391 |
"Created: / 27-11-2012 / 14:31:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
392 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
393 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
394 |
changesetWithId: id into: cs |
193
ad31a280c0d4
Bugfixes in changeset lazy loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
191
diff
changeset
|
395 |
^changesets load: id into: cs |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
396 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
397 |
"Created: / 16-12-2012 / 01:26:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
193
ad31a280c0d4
Bugfixes in changeset lazy loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
191
diff
changeset
|
398 |
"Modified: / 22-01-2013 / 20:56:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
399 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
400 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
401 |
lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
402 |
^lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
403 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
404 |
"Created: / 16-12-2012 / 00:39:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
405 |
! ! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
406 |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
407 |
!HGRepository methodsFor:'initialize & release'! |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
408 |
|
34 | 409 |
initializeOn: aStringOrFilename |
410 |
| p | |
|
411 |
||
412 |
p := aStringOrFilename asFilename. |
|
413 |
p exists ifFalse:[ |
|
414 |
HGRepositoryError raiseSignal: 'Given path does not exists'. |
|
415 |
^nil. |
|
416 |
]. |
|
417 |
p isDirectory ifFalse:[ |
|
418 |
HGRepositoryError raiseSignal: 'Given path is not a directory'. |
|
419 |
^nil. |
|
420 |
]. |
|
421 |
(p / '.hg') isDirectory ifFalse:[ |
|
422 |
HGRepositoryError raiseSignal: 'Given path does not contain a repository (.hg subdir not found - try use #lookup:)'. |
|
423 |
^nil. |
|
424 |
]. |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
425 |
path := p. |
55 | 426 |
changesets := HGRepository::Changesets new setRepository: self. |
145
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
427 |
uuid := UUID new. |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
428 |
config := HGConfig new setRepository: self. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
429 |
lock := RecursionLock new. |
34 | 430 |
|
431 |
"Created: / 17-10-2012 / 13:35:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
432 |
"Modified: / 25-01-2013 / 18:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
433 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
434 |
|
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
435 |
!HGRepository methodsFor:'operations'! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
436 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
437 |
cloneTo: aStringOrFilename |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
438 |
"Creates a clone of the receiver into given directory. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
439 |
Returns an instance HGRepository representing the clone." |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
440 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
441 |
^self class clone: path to: aStringOrFilename |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
442 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
443 |
"Created: / 14-11-2012 / 22:43:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
444 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
445 |
|
88 | 446 |
cloneTo: aStringOrFilename update: update |
447 |
"Creates a clone of the receiver into given directory. |
|
448 |
Returns an instance HGRepository representing the clone. |
|
449 |
If update is true, repository working copy is updated, otherwise |
|
450 |
it's left empty" |
|
451 |
||
452 |
^self class clone: path to: aStringOrFilename update: update |
|
453 |
||
454 |
"Created: / 21-11-2012 / 00:21:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
455 |
! |
|
456 |
||
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
457 |
execute: anHGCommand |
240
e04b6e515237
HGCommandServer>>execute: refactored & hopefully fixed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
239
diff
changeset
|
458 |
anHGCommand workingDirectoryOrNil isNil ifTrue:[ |
e04b6e515237
HGCommandServer>>execute: refactored & hopefully fixed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
239
diff
changeset
|
459 |
anHGCommand workingDirectory: path |
e04b6e515237
HGCommandServer>>execute: refactored & hopefully fixed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
239
diff
changeset
|
460 |
]. |
e04b6e515237
HGCommandServer>>execute: refactored & hopefully fixed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
239
diff
changeset
|
461 |
|
242
1b09c8551830
Fixes for command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
240
diff
changeset
|
462 |
"The command server does not work on Windows because readWait is |
1b09c8551830
Fixes for command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
240
diff
changeset
|
463 |
broken on Windows!!" |
1b09c8551830
Fixes for command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
240
diff
changeset
|
464 |
^(UseCommandServer and:[OperatingSystem isMSWINDOWSlike not]) ifTrue:[ |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
465 |
server isNil ifTrue:[ |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
466 |
server := HGCommandServer new repository: self. |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
467 |
server start. |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
468 |
]. |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
469 |
server execute: anHGCommand |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
470 |
] ifFalse:[ |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
471 |
anHGCommand execute |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
472 |
] |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
473 |
|
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
474 |
"Created: / 03-03-2013 / 22:52:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
242
1b09c8551830
Fixes for command server.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
240
diff
changeset
|
475 |
"Modified (format): / 06-03-2013 / 11:14:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
476 |
! |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
477 |
|
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
478 |
pull |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
479 |
"Pulls changesets from default upstream repository. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
480 |
See .hg/hgrc, section path" |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
481 |
|
215
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
482 |
^self pull: nil |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
483 |
|
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
484 |
"Created: / 15-11-2012 / 10:00:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
485 |
"Modified: / 04-02-2013 / 15:31:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
486 |
! |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
487 |
|
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
488 |
pull: remote |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
489 |
"Push changesets to given remote repository. 'remote' can be either |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
490 |
an instance HGRemote, an instance of URL or a String (remote alias). |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
491 |
If 'remote' nil, default upstream repository is used, ' |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
492 |
|
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
493 |
See .hg/hgrc, section for configured aliases" |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
494 |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
495 |
^self execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
496 |
(HGCommand pull |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
497 |
url: (remote ? 'default') asString; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
498 |
yourself) |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
499 |
|
215
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
500 |
"Created: / 04-02-2013 / 15:30:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
501 |
"Modified: / 03-03-2013 / 22:53:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
502 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
503 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
504 |
push |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
505 |
"Pushes changesets to default upstream repository. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
506 |
See .hg/hgrc, section path" |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
507 |
|
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
508 |
^self push: nil force: false |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
509 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
510 |
"Created: / 15-11-2012 / 09:59:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
511 |
"Modified: / 27-11-2012 / 21:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
512 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
513 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
514 |
push: remote |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
515 |
"Push changesets to given remote repository. 'remote' can be either |
215
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
516 |
an instance HGRemote, an instance of URL or a String (remote alias). |
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
517 |
If 'remote' nil, default upstream repository is used, ' |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
518 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
519 |
See .hg/hgrc, section for configured aliases" |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
520 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
521 |
^self push: remote force: false |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
522 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
523 |
"Created: / 15-11-2012 / 10:00:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
524 |
"Modified: / 27-11-2012 / 21:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
215
165ce6502156
Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
212
diff
changeset
|
525 |
"Modified (comment): / 04-02-2013 / 15:31:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
526 |
! |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
527 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
528 |
push: remote force: force |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
529 |
"Push changesets to given remote repository. 'remote' can be either |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
530 |
an instance HGRemote, an instance of URL or a String (remote alias)' |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
531 |
If force is true, push is forced (allowing creation |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
532 |
of new heads in remote repo), |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
533 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
534 |
See .hg/hgrc, section path" |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
535 |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
536 |
^self execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
537 |
(HGCommand push |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
538 |
workingDirectory: path pathName; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
539 |
url: (remote ? 'default') asString; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
540 |
force: force; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
541 |
yourself) |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
542 |
|
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
543 |
"Created: / 27-11-2012 / 21:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
544 |
"Modified: / 03-03-2013 / 22:54:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
545 |
! ! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
546 |
|
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
547 |
!HGRepository methodsFor:'synchronized evaluation'! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
548 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
549 |
synchronizationSemaphore |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
550 |
^lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
551 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
552 |
"Created: / 16-12-2012 / 00:40:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
553 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
554 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
555 |
synchronizationSemaphore: aRecursionLock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
556 |
lock := aRecursionLock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
557 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
558 |
"Created: / 16-12-2012 / 00:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
559 |
! ! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
560 |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
561 |
!HGRepository::Changesets class methodsFor:'documentation'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
562 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
563 |
documentation |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
564 |
" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
565 |
A simple object to maintain and load changesets metadata lazily. |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
566 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
567 |
[author:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
568 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
569 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
570 |
[instance variables:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
571 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
572 |
[class variables:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
573 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
574 |
[see also:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
575 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
576 |
" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
577 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
578 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
579 |
!HGRepository::Changesets class methodsFor:'instance creation'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
580 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
581 |
new |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
582 |
"return an initialized instance" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
583 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
584 |
^ self basicNew initialize. |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
585 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
586 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
587 |
!HGRepository::Changesets methodsFor:'accessing'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
588 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
589 |
changesetWithId: idobj |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
590 |
| id xid cs | |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
591 |
|
247
bf5bfe409ff8
Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
242
diff
changeset
|
592 |
id := idobj asHGChangesetId. |
bf5bfe409ff8
Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
242
diff
changeset
|
593 |
id = HGChangesetId null ifTrue:[ ^ HGChangeset null]. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
594 |
"/Try to translate it... |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
595 |
id hasRevnoOnly ifTrue:[ |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
596 |
xid := revno2nodeIdMap at: id revno ifAbsent:[nil]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
597 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
598 |
xid := xid ? id. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
599 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
600 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
601 |
"/Look in cache using xlated id... |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
602 |
cs := changesets at: xid ifAbsent:[ nil ]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
603 |
cs notNil ifTrue: [ ^ cs ]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
604 |
|
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
605 |
self synchronized:[ |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
606 |
"/Look in cache using xlated id... |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
607 |
cs := changesets at: xid ifAbsent:[ nil ]. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
608 |
cs notNil ifTrue: [ ^ cs ]. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
609 |
|
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
610 |
cs := (xid isFull and:[xid hasRevno]) ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
611 |
"/Full id, can make it lazy |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
612 |
HGChangeset new setId: xid; setRepository: repository |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
613 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
614 |
"/Short id, we have to load it |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
615 |
self load: xid into: nil |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
616 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
617 |
|
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
618 |
self assert: cs id isFull. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
619 |
self assert: cs id hasRevno. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
620 |
changesets at: cs id put: cs. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
621 |
revno2nodeIdMap at: cs id revno put: cs id. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
622 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
623 |
^cs . |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
624 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
625 |
"Created: / 13-11-2012 / 17:52:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
247
bf5bfe409ff8
Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
242
diff
changeset
|
626 |
"Modified (format): / 08-03-2013 / 19:54:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
627 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
628 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
629 |
!HGRepository::Changesets methodsFor:'initialization'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
630 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
631 |
initialize |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
632 |
"Invoked when a new instance is created." |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
633 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
634 |
"/ please change as required (and remove this comment) |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
635 |
changesets := Dictionary new. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
636 |
revno2nodeIdMap := Dictionary new. |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
637 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
638 |
"/ super initialize. -- commented since inherited method does nothing |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
639 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
640 |
"Modified: / 16-11-2012 / 21:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 641 |
! ! |
642 |
||
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
643 |
!HGRepository::Changesets methodsFor:'private'! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
644 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
645 |
load: id into: changesetOrNil |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
646 |
"Load all data for changeset with given id. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
647 |
If changesetOrNil is not nil, then update given |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
648 |
changeset. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
649 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
650 |
Return changeset with filled data, i.e,, changeset is |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
651 |
non-lazy" |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
652 |
|
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
653 |
| csets cs | |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
654 |
csets := self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
655 |
(HGCommand log |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
656 |
workingDirectory: repository path asString; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
657 |
revsets: (self loadRevsetsForLoad: id); |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
658 |
yourself). |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
659 |
"/just to be defensive... |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
660 |
csets do:[:each| |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
661 |
| existing | |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
662 |
|
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
663 |
each setRepository: repository. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
664 |
existing := changesets at: each id ifAbsentPut:[each]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
665 |
existing ~~ each ifTrue:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
666 |
existing setSlotsFrom: each. |
209
1ac6a3ac648a
Bug fix in changeset lazu loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
206
diff
changeset
|
667 |
existing setNonLazy. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
668 |
self assert: existing id isShort not. |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
669 |
self assert: existing id revno notNil. |
209
1ac6a3ac648a
Bug fix in changeset lazu loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
206
diff
changeset
|
670 |
self assert: existing loaded. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
671 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
672 |
existing id = id ifTrue:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
673 |
cs := existing |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
674 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
675 |
]. |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
676 |
self assert: cs notNil. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
677 |
^cs |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
678 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
679 |
"Created: / 16-12-2012 / 00:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
680 |
"Modified: / 03-03-2013 / 22:58:05 / 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:
176
diff
changeset
|
681 |
! |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
682 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
683 |
loadRevsetsForLoad: id |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
684 |
| revsets ids start stop addId | |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
685 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
686 |
revsets := OrderedCollection new. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
687 |
ids := changesets keys asOrderedCollection sort: [:a :b|a revno > b revno]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
688 |
addId := true. |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
689 |
ids do:[:each| | cs | |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
690 |
cs := changesets at: each. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
691 |
cs loaded ifFalse:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
692 |
start isNil ifTrue:[ |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
693 |
start := stop := each. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
694 |
each = id ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
695 |
addId := false |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
696 |
]. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
697 |
] ifFalse:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
698 |
each revno < (start revno - 20) ifTrue:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
699 |
revsets add: (start revno printString , ':' , (start revno - 20) printString). |
259
40dd6ff6db1f
Bugfix in: HGRepository::Changesets>>loadRevsetsForLoad:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
256
diff
changeset
|
700 |
start := stop := each. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
701 |
] ifFalse:[ |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
702 |
each = id ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
703 |
addId := false |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
704 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
705 |
stop := each. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
706 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
707 |
] |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
708 |
] ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
709 |
start notNil ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
710 |
start ~~ stop ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
711 |
revsets add: (start revno printString , ':' , stop revno printString). |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
712 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
713 |
revsets add: start revno printString |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
714 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
715 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
716 |
start := stop := nil. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
717 |
] |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
718 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
719 |
start notNil ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
720 |
start ~~ stop ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
721 |
revsets add: (start revno printString , ':' , stop revno printString). |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
722 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
723 |
revsets add: start revno printString |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
724 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
725 |
]. |
193
ad31a280c0d4
Bugfixes in changeset lazy loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
191
diff
changeset
|
726 |
(addId or:[revsets isEmpty]) ifTrue:[revsets add: id printString]. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
727 |
^revsets |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
728 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
729 |
"Created: / 22-01-2013 / 16:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
259
40dd6ff6db1f
Bugfix in: HGRepository::Changesets>>loadRevsetsForLoad:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
256
diff
changeset
|
730 |
"Modified: / 12-03-2013 / 23:59:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
731 |
! ! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
732 |
|
34 | 733 |
!HGRepository class methodsFor:'documentation'! |
734 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
735 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
736 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
737 |
^ '$Changeset: <not expanded> $' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
738 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
739 |
|
34 | 740 |
version_SVN |
55 | 741 |
^ '§Id:: §' |
34 | 742 |
! ! |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
743 |
|
335
7e19ab19148b
Changed license to LGPL2.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
309
diff
changeset
|
744 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
745 |
HGRepository initialize! |