author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 01 Feb 2013 12:02:22 +0000 | |
changeset 210 | 54a73fa50d40 |
parent 209 | 1ac6a3ac648a |
child 212 | 8ec5884fba41 |
permissions | -rw-r--r-- |
210 | 1 |
" |
2 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
34 | 12 |
"{ Package: 'stx:libscm/mercurial' }" |
13 |
||
14 |
Object subclass:#HGRepository |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
15 |
instanceVariableNames:'uuid path wc changesets branches heads config lock' |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
16 |
classVariableNames:'Cache' |
34 | 17 |
poolDictionaries:'' |
18 |
category:'SCM-Mercurial-Core' |
|
19 |
! |
|
20 |
||
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
21 |
HGRepositoryObject subclass:#Changesets |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
22 |
instanceVariableNames:'changesets revno2nodeIdMap' |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
23 |
classVariableNames:'' |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
24 |
poolDictionaries:'' |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
25 |
privateIn:HGRepository |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
26 |
! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
27 |
|
210 | 28 |
!HGRepository class methodsFor:'documentation'! |
29 |
||
30 |
copyright |
|
31 |
" |
|
32 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
33 |
All Rights Reserved |
|
34 |
||
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! ! |
|
34 | 43 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
44 |
!HGRepository class methodsFor:'initialization'! |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
45 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
46 |
flush |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
47 |
"Flush all cached repositories" |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
48 |
|
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
49 |
Cache := CacheDictionary new: 8 |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
50 |
|
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
51 |
"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
|
52 |
! |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
53 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
54 |
initialize |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
55 |
"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
|
56 |
|
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
57 |
"/ please change as required (and remove this comment) |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
58 |
|
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
59 |
Cache := CacheDictionary new: 8 |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
60 |
|
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
61 |
"Modified: / 14-12-2012 / 19:31:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
62 |
! ! |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
63 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
64 |
!HGRepository class methodsFor:'instance creation'! |
34 | 65 |
|
66 |
on: aStringOrFilename |
|
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
67 |
^self on: aStringOrFilename cached: false |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
68 |
|
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
69 |
"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
|
70 |
"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
|
71 |
! |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
72 |
|
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
73 |
on: aStringOrFilename cached: cache |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
74 |
| path | |
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
75 |
|
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
76 |
path := aStringOrFilename asFilename. |
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
77 |
^cache ifTrue:[ |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
78 |
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
|
79 |
] ifFalse:[ |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
80 |
self new initializeOn: path |
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
81 |
] |
34 | 82 |
|
167
73ede479a28f
Bugfix - do not cache repositories by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
83 |
"Created: / 16-12-2012 / 12:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 84 |
! ! |
85 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
86 |
!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
|
87 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
88 |
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
|
89 |
"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
|
90 |
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
|
91 |
|
88 | 92 |
^self clone: aFilenameOrUrlOrString to: aStringOrFilename update: true |
93 |
||
94 |
"Created: / 14-11-2012 / 22:46:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
95 |
"Modified: / 21-11-2012 / 00:20:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
96 |
! |
|
97 |
||
98 |
clone: aFilenameOrUrlOrString to: aStringOrFilename update: update |
|
99 |
"Clones repository at given URL to given directory. |
|
100 |
Returns an instance HGRepository representing the clone." |
|
101 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
102 |
| 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
|
103 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
104 |
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
|
105 |
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
|
106 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
107 |
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
|
108 |
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
|
109 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
110 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
111 |
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
|
112 |
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
|
113 |
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
|
114 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
115 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
116 |
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
|
117 |
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
|
118 |
^nil |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
119 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
120 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
121 |
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
|
122 |
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
|
123 |
path: dst pathName; |
88 | 124 |
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
|
125 |
execute. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
126 |
^HGRepository on: dst. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
127 |
|
88 | 128 |
"Created: / 21-11-2012 / 00:20:06 / 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
|
129 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
130 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
131 |
!HGRepository class methodsFor:'utilities'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
132 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
133 |
discover: aStringOrFilename |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
134 |
"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
|
135 |
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
|
136 |
returns nil. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
137 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
138 |
Currently, it searches for presence of .hg directory" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
139 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
140 |
| f | |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
141 |
f := aStringOrFilename. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
142 |
f isDirectory ifFalse:[ |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
143 |
f := f directory |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
144 |
]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
145 |
[ ( f / '.hg' ) exists ] whileFalse:[ |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
146 |
f isRootDirectory ifTrue:[ ^nil ]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
147 |
f := f directory. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
148 |
]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
149 |
^f |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
150 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
151 |
"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
|
152 |
"Modified: / 14-11-2012 / 00:02:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
153 |
! ! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
154 |
|
34 | 155 |
!HGRepository methodsFor:'accessing'! |
156 |
||
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
157 |
branches |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
158 |
"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
|
159 |
including closed ones" |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
160 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
161 |
branches isNil ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
162 |
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
|
163 |
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
|
164 |
reader:[:old | |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
165 |
| rbranches current names | |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
166 |
rbranches := old. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
167 |
current := HGCommand branches |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
168 |
workingDirectory: path pathName; |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
169 |
active: false; |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
170 |
closed: true; |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
171 |
execute. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
172 |
names := rbranches collect:[:b|b name]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
173 |
current := current reject:[:b|names includes: b name]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
174 |
current do:[:b|b setRepository: self]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
175 |
rbranches addAll: current. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
176 |
rbranches isEmpty ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
177 |
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
|
178 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
179 |
rbranches. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
180 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
181 |
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
|
182 |
]. |
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
183 |
^branches value |
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
184 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
185 |
"Created: / 27-11-2012 / 19:57:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
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
|
186 |
"Modified: / 25-01-2013 / 20:25:28 / 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
|
187 |
! |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
188 |
|
145
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
189 |
config |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
190 |
^config |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
191 |
|
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
192 |
"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
|
193 |
! |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
194 |
|
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
195 |
heads |
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
196 |
"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
|
197 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
198 |
heads isNil ifTrue:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
199 |
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
|
200 |
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
|
201 |
reader:[ |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
202 |
| ids | |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
203 |
|
203
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
204 |
ids := HGCommand heads |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
205 |
workingDirectory: path pathName; |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
206 |
execute. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
207 |
ids collect:[:id|self changesetWithId: id]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
208 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
209 |
]. |
85d2f90dc053
Performance improvement: cache heads and branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
194
diff
changeset
|
210 |
^heads value. |
106
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
211 |
|
99be3b5a40da
Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
105
diff
changeset
|
212 |
"Created: / 27-11-2012 / 21:33:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
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
|
213 |
"Modified: / 25-01-2013 / 20:25:34 / 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
|
214 |
! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
215 |
|
34 | 216 |
path |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
217 |
"Return path to the repository (directory with .hg store)" |
34 | 218 |
^ path |
219 |
||
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
220 |
"Modified (comment): / 13-11-2012 / 18:18:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 221 |
! |
222 |
||
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
223 |
pathName |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
224 |
"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
|
225 |
^ path pathName |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
226 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
227 |
"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
|
228 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
229 |
|
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
230 |
remoteDefault |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
231 |
"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
|
232 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
233 |
^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
|
234 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
235 |
"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
|
236 |
! |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
150
diff
changeset
|
237 |
|
150
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
238 |
remotes |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
239 |
"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
|
240 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
241 |
| paths remotes | |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
242 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
243 |
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
|
244 |
paths isNil ifTrue:[ ^ #() ]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
245 |
paths isEmpty ifTrue:[ ^ #() ]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
246 |
remotes := OrderedCollection new. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
247 |
paths keysAndValuesDo:[:name :url| |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
248 |
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
|
249 |
]. |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
250 |
^remotes |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
251 |
|
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
252 |
"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
|
253 |
! |
1813913f6106
Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
145
diff
changeset
|
254 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
255 |
uuid |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
256 |
"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
|
257 |
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
|
258 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
259 |
^ uuid |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
260 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
261 |
"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
|
262 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
263 |
|
36 | 264 |
workingCopy |
265 |
wc isNil ifTrue:[ |
|
266 |
wc := HGWorkingCopy new setRepository: self. |
|
267 |
]. |
|
268 |
^wc |
|
269 |
||
270 |
"Created: / 19-10-2012 / 15:42:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
34 | 271 |
! ! |
272 |
||
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
273 |
!HGRepository methodsFor:'accessing-changesets'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
274 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
275 |
@ id |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
276 |
^self changesetWithId: id. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
277 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
278 |
"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
|
279 |
! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
280 |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
281 |
changesetWithId: id |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
282 |
^changesets changesetWithId: id |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
283 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
284 |
"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
|
285 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
286 |
|
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
287 |
!HGRepository methodsFor:'accessing-private'! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
288 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
289 |
branchWithName: name |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
290 |
"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
|
291 |
an exception is raised" |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
292 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
293 |
^self branchWithName: name ifAbsent:[ |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
294 |
HGNoSuchBranchError newException |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
295 |
parameter: name; |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
296 |
messageText: 'No such branch: ', name; |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
297 |
raiseSignal |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
298 |
] |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
299 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
300 |
"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
|
301 |
! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
302 |
|
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
303 |
branchWithName: name createIfAbsent: create |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
304 |
|
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
305 |
^self branchWithName: name ifAbsent:[ |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
306 |
| b | |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
307 |
b := HGBranch new setRepository: self. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
308 |
b setName: name. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
309 |
branches add: b. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
310 |
b |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
311 |
] |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
312 |
|
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
313 |
"Created: / 10-12-2012 / 03:14:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
314 |
! |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
315 |
|
105
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
316 |
branchWithName: name ifAbsent: block |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
317 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
318 |
^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
|
319 |
|
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
320 |
"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
|
321 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
322 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
323 |
changesetWithId: id into: cs |
193
ad31a280c0d4
Bugfixes in changeset lazy loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
191
diff
changeset
|
324 |
^changesets load: id into: cs |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
325 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
326 |
"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
|
327 |
"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
|
328 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
329 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
330 |
lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
331 |
^lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
332 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
333 |
"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
|
334 |
! ! |
25e8ff9d2a31
Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
103
diff
changeset
|
335 |
|
34 | 336 |
!HGRepository methodsFor:'initialization'! |
337 |
||
338 |
initializeOn: aStringOrFilename |
|
339 |
| p | |
|
340 |
||
341 |
p := aStringOrFilename asFilename. |
|
342 |
p exists ifFalse:[ |
|
343 |
HGRepositoryError raiseSignal: 'Given path does not exists'. |
|
344 |
^nil. |
|
345 |
]. |
|
346 |
p isDirectory ifFalse:[ |
|
347 |
HGRepositoryError raiseSignal: 'Given path is not a directory'. |
|
348 |
^nil. |
|
349 |
]. |
|
350 |
(p / '.hg') isDirectory ifFalse:[ |
|
351 |
HGRepositoryError raiseSignal: 'Given path does not contain a repository (.hg subdir not found - try use #lookup:)'. |
|
352 |
^nil. |
|
353 |
]. |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
354 |
path := p. |
55 | 355 |
changesets := HGRepository::Changesets new setRepository: self. |
145
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
356 |
uuid := UUID new. |
1b8652185a8f
Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
357 |
config := HGConfig new setRepository: self. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
358 |
lock := RecursionLock new. |
34 | 359 |
|
360 |
"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
|
361 |
"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
|
362 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
363 |
|
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
364 |
!HGRepository methodsFor:'operations'! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
365 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
366 |
cloneTo: aStringOrFilename |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
367 |
"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
|
368 |
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
|
369 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
370 |
^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
|
371 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
372 |
"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
|
373 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
374 |
|
88 | 375 |
cloneTo: aStringOrFilename update: update |
376 |
"Creates a clone of the receiver into given directory. |
|
377 |
Returns an instance HGRepository representing the clone. |
|
378 |
If update is true, repository working copy is updated, otherwise |
|
379 |
it's left empty" |
|
380 |
||
381 |
^self class clone: path to: aStringOrFilename update: update |
|
382 |
||
383 |
"Created: / 21-11-2012 / 00:21:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
384 |
! |
|
385 |
||
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
386 |
pull |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
387 |
"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
|
388 |
See .hg/hgrc, section path" |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
389 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
390 |
HGCommand pull |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
391 |
workingDirectory: path pathName; |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
392 |
execute. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
393 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
394 |
"Created: / 15-11-2012 / 10:00:39 / 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
|
395 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
396 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
397 |
push |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
398 |
"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
|
399 |
See .hg/hgrc, section path" |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
400 |
|
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
401 |
^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
|
402 |
|
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
403 |
"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
|
404 |
"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
|
405 |
! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
406 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
407 |
push: remote |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
408 |
"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
|
409 |
an instance HGRemote, an instance of URL or a String (remote alias)' |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
410 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
411 |
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
|
412 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
413 |
^self push: remote force: false |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
414 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
415 |
"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
|
416 |
"Modified: / 27-11-2012 / 21:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
417 |
"Modified (comment): / 29-01-2013 / 15:40:40 / 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
|
418 |
! |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
419 |
|
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
420 |
push: remote force: force |
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
421 |
"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
|
422 |
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
|
423 |
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
|
424 |
of new heads in remote repo), |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
425 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
426 |
See .hg/hgrc, section path" |
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
427 |
|
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
428 |
HGCommand push |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
429 |
workingDirectory: path pathName; |
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
430 |
url: (remote ? 'default') asString; |
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
431 |
force: force; |
57
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
432 |
execute. |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
433 |
|
107
c92f7674485e
Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
106
diff
changeset
|
434 |
"Created: / 27-11-2012 / 21:58:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
206
7985d1be806a
Improvement HGRepository>>push:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
204
diff
changeset
|
435 |
"Modified: / 29-01-2013 / 16:03:12 / 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
|
436 |
! ! |
47b14a8b7eb8
Some hacks to make basic Mercurial commit working
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
55
diff
changeset
|
437 |
|
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
438 |
!HGRepository methodsFor:'synchronized evaluation'! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
439 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
440 |
synchronizationSemaphore |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
441 |
^lock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
442 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
443 |
"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
|
444 |
! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
445 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
446 |
synchronizationSemaphore: aRecursionLock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
447 |
lock := aRecursionLock |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
448 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
449 |
"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
|
450 |
! ! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
451 |
|
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
452 |
!HGRepository::Changesets class methodsFor:'documentation'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
453 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
454 |
documentation |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
455 |
" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
456 |
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
|
457 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
458 |
[author:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
459 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
460 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
461 |
[instance variables:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
462 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
463 |
[class variables:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
464 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
465 |
[see also:] |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
466 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
467 |
" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
468 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
469 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
470 |
!HGRepository::Changesets class methodsFor:'instance creation'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
471 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
472 |
new |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
473 |
"return an initialized instance" |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
474 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
475 |
^ self basicNew initialize. |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
476 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
477 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
478 |
!HGRepository::Changesets methodsFor:'accessing'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
479 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
480 |
changesetWithId: idobj |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
481 |
| id xid cs | |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
482 |
|
103
04731ef44417
HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
483 |
id := idobj asHGChangesetId. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
484 |
"/Try to translate it... |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
485 |
id hasRevnoOnly ifTrue:[ |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
486 |
xid := revno2nodeIdMap at: id revno ifAbsent:[nil]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
487 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
488 |
xid := xid ? id. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
489 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
490 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
491 |
"/Look in cache using xlated id... |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
492 |
cs := changesets at: xid ifAbsent:[ nil ]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
493 |
cs notNil ifTrue: [ ^ cs ]. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
494 |
|
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
495 |
self synchronized:[ |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
496 |
"/Look in cache using xlated id... |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
497 |
cs := changesets at: xid ifAbsent:[ nil ]. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
498 |
cs notNil ifTrue: [ ^ cs ]. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
499 |
|
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
500 |
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
|
501 |
"/Full id, can make it lazy |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
502 |
HGChangeset new setId: xid; setRepository: repository |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
503 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
504 |
"/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
|
505 |
self load: xid into: nil |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
506 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
507 |
|
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
508 |
self assert: cs id isFull. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
509 |
self assert: cs id hasRevno. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
510 |
changesets at: cs id put: cs. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
511 |
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
|
512 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
513 |
^cs . |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
514 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
515 |
"Created: / 13-11-2012 / 17:52:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
516 |
"Modified: / 22-01-2013 / 22:31:50 / 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
|
517 |
! ! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
518 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
519 |
!HGRepository::Changesets methodsFor:'initialization'! |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
520 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
521 |
initialize |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
522 |
"Invoked when a new instance is created." |
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
523 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
524 |
"/ 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
|
525 |
changesets := Dictionary new. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
526 |
revno2nodeIdMap := Dictionary new. |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
527 |
|
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
528 |
"/ 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
|
529 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
57
diff
changeset
|
530 |
"Modified: / 16-11-2012 / 21:58:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 531 |
! ! |
532 |
||
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
533 |
!HGRepository::Changesets methodsFor:'private'! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
534 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
535 |
load: id into: changesetOrNil |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
536 |
"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
|
537 |
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
|
538 |
changeset. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
539 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
540 |
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
|
541 |
non-lazy" |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
542 |
|
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
543 |
| csets cs | |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
544 |
csets := HGCommand log |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
545 |
workingDirectory: repository path asString; |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
546 |
revsets: (self loadRevsetsForLoad: id); |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
547 |
execute. |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
548 |
"/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
|
549 |
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
|
550 |
| existing | |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
551 |
|
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
552 |
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
|
553 |
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
|
554 |
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
|
555 |
existing setSlotsFrom: each. |
209
1ac6a3ac648a
Bug fix in changeset lazu loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
206
diff
changeset
|
556 |
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
|
557 |
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
|
558 |
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
|
559 |
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
|
560 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
561 |
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
|
562 |
cs := existing |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
563 |
]. |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
564 |
]. |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
565 |
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
|
566 |
^cs |
165
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
567 |
|
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
568 |
"Created: / 16-12-2012 / 00:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
209
1ac6a3ac648a
Bug fix in changeset lazu loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
206
diff
changeset
|
569 |
"Modified: / 29-01-2013 / 16:27:52 / 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
|
570 |
! |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
571 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
572 |
loadRevsetsForLoad: id |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
573 |
| 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
|
574 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
575 |
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
|
576 |
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
|
577 |
addId := true. |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
578 |
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
|
579 |
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
|
580 |
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
|
581 |
start isNil ifTrue:[ |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
582 |
start := stop := each. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
583 |
each = id ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
584 |
addId := false |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
585 |
]. |
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
586 |
] ifFalse:[ |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
587 |
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
|
588 |
revsets add: (start revno printString , ':' , (start revno - 20) printString). |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
589 |
start := each. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
590 |
] ifFalse:[ |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
591 |
each = id ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
592 |
addId := false |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
593 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
594 |
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
|
595 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
596 |
] |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
597 |
] ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
598 |
start notNil ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
599 |
start ~~ stop ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
600 |
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
|
601 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
602 |
revsets add: start revno printString |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
603 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
604 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
605 |
start := stop := nil. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
606 |
] |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
607 |
]. |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
608 |
start notNil ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
609 |
start ~~ stop ifTrue:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
610 |
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
|
611 |
] ifFalse:[ |
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
612 |
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
|
613 |
]. |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
614 |
]. |
193
ad31a280c0d4
Bugfixes in changeset lazy loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
191
diff
changeset
|
615 |
(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
|
616 |
^revsets |
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
617 |
|
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
618 |
"Created: / 22-01-2013 / 16:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
194
3874039d3135
More bugfixes regarding lazy changeset loading.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
193
diff
changeset
|
619 |
"Modified: / 22-01-2013 / 22:22:33 / 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
|
620 |
! ! |
4f6432cf4240
Added support for lazy changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
163
diff
changeset
|
621 |
|
34 | 622 |
!HGRepository class methodsFor:'documentation'! |
623 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
624 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
625 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
626 |
^ '$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
|
627 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
628 |
|
34 | 629 |
version_SVN |
55 | 630 |
^ '§Id:: §' |
34 | 631 |
! ! |
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
632 |
|
191
f0745f4cdc97
Performance optimization: lazily pre-load all unloaded changes at once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
176
diff
changeset
|
633 |
|
163
21bc6994087d
Experimental HGWorkingCopyBrowser - unfinished!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
634 |
HGRepository initialize! |