author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 03 Mar 2013 23:58:51 +0000 | |
branch | hg-command-server-support |
changeset 235 | 3d8ef499d7d9 |
parent 234 | a9ef61b902ae |
child 261 | 14855fd7632d |
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:#HGWorkingCopyFile |
|
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
15 |
instanceVariableNames:'wc children filename revisions' |
34 | 16 |
classVariableNames:'' |
63
77b0d42eebd0
Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
61
diff
changeset
|
17 |
poolDictionaries:'' |
34 | 18 |
category:'SCM-Mercurial-Core' |
19 |
! |
|
20 |
||
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
21 |
Object subclass:#LazyRevision |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
22 |
instanceVariableNames:'collection index changeset wc path' |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
23 |
classVariableNames:'' |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
24 |
poolDictionaries:'' |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
25 |
privateIn:HGWorkingCopyFile |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
26 |
! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
27 |
|
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
28 |
!HGWorkingCopyFile class methodsFor:'documentation'! |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
29 |
|
210 | 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 |
! |
|
43 |
||
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
44 |
documentation |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
45 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
46 |
A representation on a file in working copy. It behaves just like |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
47 |
ordinary filename but also provides methods for quering it's |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
48 |
state (added/removed/modified...), access to previous versions |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
49 |
and so on. |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
50 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
51 |
[author:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
52 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
53 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
54 |
[instance variables:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
55 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
56 |
[class variables:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
57 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
58 |
[see also:] |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
59 |
|
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
60 |
" |
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
67
diff
changeset
|
61 |
! ! |
34 | 62 |
|
63 |
!HGWorkingCopyFile class methodsFor:'instance creation'! |
|
64 |
||
63
77b0d42eebd0
Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
61
diff
changeset
|
65 |
wc: aHGWorkingCopy path: aStringOrFilename |
77b0d42eebd0
Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
61
diff
changeset
|
66 |
^self new setWorkingCopy: aHGWorkingCopy path: aStringOrFilename |
34 | 67 |
|
68 |
"Created: / 24-09-2012 / 13:52:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
69 |
! ! |
|
70 |
||
71 |
!HGWorkingCopyFile methodsFor:'accessing'! |
|
72 |
||
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
73 |
changeset |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
74 |
^wc changeset |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
75 |
|
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
76 |
"Created: / 05-12-2012 / 19:23:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
77 |
! |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
78 |
|
39
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
79 |
pathName |
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
80 |
^filename pathName |
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
81 |
|
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
82 |
"Created: / 12-11-2012 / 22:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
83 |
! |
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
84 |
|
34 | 85 |
pathNameRelative |
86 |
^self == wc root |
|
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
63
diff
changeset
|
87 |
ifTrue:[''] |
34 | 88 |
ifFalse:[filename pathName copyFrom: (wc root pathName size + 2)] |
89 |
||
90 |
"Created: / 25-09-2012 / 00:28:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67
985488894699
HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
63
diff
changeset
|
91 |
"Modified: / 16-11-2012 / 11:23:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 92 |
! |
93 |
||
142
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
94 |
pathNameRelativeSlashed |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
95 |
| p | |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
96 |
|
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
97 |
p := self pathNameRelative. |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
98 |
(p includes:$\) ifTrue:[ |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
99 |
p := p copyReplaceAll:$\ with:$/. |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
100 |
]. |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
101 |
^p |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
102 |
|
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
103 |
"Created: / 06-12-2012 / 17:11:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
104 |
! |
67e8c5ab8db2
Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
140
diff
changeset
|
105 |
|
234
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
106 |
repository |
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
107 |
^wc repository |
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
108 |
|
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
109 |
"Created: / 03-03-2013 / 20:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
110 |
! |
a9ef61b902ae
Most commands are now executeb using executeInRepository:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
210
diff
changeset
|
111 |
|
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
112 |
revisions |
140
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
113 |
| path pathS | |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
114 |
|
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
115 |
path := self pathNameRelative. |
140
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
116 |
pathS := OperatingSystem isMSWINDOWSlike |
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
117 |
ifTrue:[path copyReplaceAll:$\ with: $/] |
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
118 |
ifFalse:[path]. |
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
119 |
|
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
120 |
|
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
121 |
revisions isNil ifTrue:[ |
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
122 |
| old oldIds | |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
123 |
oldIds := self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
124 |
(HGCommand log |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
125 |
workingDirectory: wc pathName; |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
126 |
path: path; |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
127 |
yourself). |
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
128 |
pathS. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
129 |
old := OrderedCollection new. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
130 |
oldIds withIndexDo: [:id :index| |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
131 |
old add: ( |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
132 |
LazyRevision new |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
133 |
setCollection: old index: index changesetId: id workingCopy: wc path: pathS) |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
134 |
"/ | cs f | |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
135 |
"/ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
136 |
"/ f := (cs := wc repository changesetWithId: id) / p. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
137 |
"/ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
138 |
"/ cs changes do:[:chg| |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
139 |
"/ "/Catch renames... |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
140 |
"/ (chg isCopied and:[chg path = p]) ifTrue:[ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
141 |
"/ p := chg source. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
142 |
"/ ] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
143 |
"/ ]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
144 |
"/ f. |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
145 |
]. |
138
c66a831e131b
Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
136
diff
changeset
|
146 |
|
c66a831e131b
Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
136
diff
changeset
|
147 |
revisions := old. |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
148 |
]. |
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
149 |
"/older revisions are cached, newer not since they may change... |
138
c66a831e131b
Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
136
diff
changeset
|
150 |
|
140
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
151 |
^((wc changeset / pathS) newer:true) , revisions |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
152 |
|
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
153 |
"Created: / 05-12-2012 / 19:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
140
feab684bc4dc
Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
138
diff
changeset
|
154 |
"Modified: / 06-12-2012 / 03:50:58 / jv" |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
155 |
"Modified: / 03-03-2013 / 23:03:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
136
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
156 |
! |
2d1512dde043
Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
121
diff
changeset
|
157 |
|
34 | 158 |
status |
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
159 |
| cmd statuses | |
36 | 160 |
|
161 |
cmd := HGCommand status. |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
162 |
cmd workingDirectory: filename directory. |
36 | 163 |
cmd path: filename pathName. |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
164 |
statuses := self repository execute: cmd. |
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
165 |
self assert: statuses size == 1. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
166 |
self assert: statuses first second = filename baseName. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
167 |
^statuses first first. |
34 | 168 |
|
169 |
"Created: / 24-09-2012 / 22:27:33 / 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
|
170 |
"Modified: / 03-03-2013 / 23:04:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 171 |
! ! |
172 |
||
173 |
!HGWorkingCopyFile methodsFor:'delegating'! |
|
174 |
||
175 |
doesNotUnderstand: aMessage |
|
176 |
||
177 |
^(filename respondsTo: aMessage selector) ifTrue:[ |
|
178 |
aMessage sendTo: filename |
|
179 |
] ifFalse:[ |
|
180 |
super doesNotUnderstand: aMessage |
|
181 |
]. |
|
182 |
||
183 |
"Created: / 24-09-2012 / 13:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
184 |
! ! |
|
185 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
186 |
!HGWorkingCopyFile methodsFor:'enumerating-contents'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
187 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
188 |
directoryContentsAsFilenamesDo:aBlock |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
189 |
"evaluate aBlock for each file in the directory represented by the receiver. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
190 |
The block is invoked with a filename-argument. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
191 |
The enumerations order is undefined - i.e. usually NOT sorted by |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
192 |
filenames (but by creation time - on some systems). |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
193 |
This excludes entries for '.' or '..'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
194 |
NoOp for non-existing directories; however, this behavior |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
195 |
may be changed in the near future, to raise an exception instead. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
196 |
So users of this method better test for existing directory before. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
197 |
Notice: this enumerates fileName objects; see also |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
198 |
#directoryContentsDo:, which enumerates strings." |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
199 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
200 |
self directoryContentsDo:[:entry | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
201 |
aBlock value:(self construct:entry). |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
202 |
] |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
203 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
204 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
205 |
'.' asFilename directoryContentsAsFilenamesDo:[:fn | Transcript showCR:fn pathName]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
206 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
207 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
208 |
"Modified: / 18.9.1997 / 18:42:23 / stefan" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
209 |
"Modified: / 23.12.1999 / 20:56:35 / cg" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
210 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
211 |
|
34 | 212 |
!HGWorkingCopyFile methodsFor:'initialization'! |
213 |
||
214 |
setWorkingCopy: aHGWorkingCopy path: aStringOrFilename |
|
215 |
||
216 |
wc := aHGWorkingCopy. |
|
217 |
filename := aStringOrFilename asFilename. |
|
218 |
||
219 |
"Created: / 24-09-2012 / 13:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
220 |
! ! |
|
221 |
||
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
222 |
!HGWorkingCopyFile methodsFor:'inspecting'! |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
223 |
|
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
224 |
browse |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
225 |
"Opens a file browser on the working copy" |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
226 |
|
162
108fc9ee061e
Added HGWorkingCopyBrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
142
diff
changeset
|
227 |
HGSourceCodeManager workingCopyBrowserClass openOnDirectory: filename |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
228 |
|
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
229 |
"Created: / 04-02-2012 / 17:14:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
162
108fc9ee061e
Added HGWorkingCopyBrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
142
diff
changeset
|
230 |
"Modified: / 14-12-2012 / 15:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
231 |
! ! |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
232 |
|
34 | 233 |
!HGWorkingCopyFile methodsFor:'instance creation'! |
234 |
||
235 |
/ aString |
|
236 |
^self construct: aString |
|
237 |
||
238 |
"Created: / 24-09-2012 / 13:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
239 |
! |
|
240 |
||
241 |
construct: aString |
|
242 |
^(aString includes: Filename separator) ifTrue:[ |
|
243 |
self components: (aString tokensBasedOn: Filename separator) |
|
244 |
] ifFalse:[ |
|
245 |
self component: aString |
|
246 |
] |
|
247 |
||
248 |
"Created: / 24-09-2012 / 13:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
249 |
! ! |
|
250 |
||
251 |
!HGWorkingCopyFile methodsFor:'instance creation-private'! |
|
252 |
||
253 |
component: aString |
|
121
f7cac3dae028
Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
254 |
|
f7cac3dae028
Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
255 |
aString = '.' ifTrue:[ ^ self ]. |
f7cac3dae028
Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
256 |
aString = '..' ifTrue:[ ^ self error:'Not yet supported' ]. |
f7cac3dae028
Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
257 |
|
34 | 258 |
children isNil ifTrue: [ children := Dictionary new ]. |
259 |
^children |
|
260 |
at: aString |
|
261 |
ifAbsentPut:[HGWorkingCopyFile wc: wc path: (filename construct: aString)] |
|
262 |
||
263 |
"Created: / 24-09-2012 / 23:26:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
121
f7cac3dae028
Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
264 |
"Modified: / 01-12-2012 / 02:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 265 |
! |
266 |
||
267 |
components: anArray"OfStrings" |
|
268 |
^anArray inject: self into:[:entry :name | entry component: name ] |
|
269 |
||
270 |
"Created: / 24-09-2012 / 23:25:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
271 |
! ! |
|
272 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
273 |
!HGWorkingCopyFile methodsFor:'operations'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
274 |
|
180 | 275 |
markResolved |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
276 |
self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
277 |
(HGCommand resolve |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
278 |
workingDirectory: filename directory; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
279 |
mark: true; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
280 |
files: (Array with: filename baseName); |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
281 |
yourself) |
180 | 282 |
|
283 |
"Created: / 15-01-2013 / 10:22:23 / 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
|
284 |
"Modified: / 03-03-2013 / 23:01:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
180 | 285 |
! |
286 |
||
287 |
markUnresolved |
|
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
288 |
self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
289 |
(HGCommand resolve |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
290 |
workingDirectory: filename directory; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
291 |
unmark: true; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
292 |
files: (Array with: filename baseName); |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
293 |
yourself). |
180 | 294 |
|
295 |
"Created: / 15-01-2013 / 10:22:30 / 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
|
296 |
"Modified: / 03-03-2013 / 23:02:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
180 | 297 |
! |
298 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
299 |
moveTo: destination |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
300 |
"Make sure that this entry is tracked by Mercurial" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
301 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
302 |
self isTracked ifTrue:[ |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
303 |
self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
304 |
(HGCommand mv |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
305 |
workingDirectory: filename directory; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
306 |
source: filename pathName; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
307 |
destination: destination pathName; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
308 |
yourself) |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
309 |
]. |
88 | 310 |
filename exists ifTrue:[ |
311 |
filename moveTo: destination pathName |
|
312 |
]. |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
313 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
314 |
"Created: / 15-11-2012 / 00:23: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
|
315 |
"Modified: / 03-03-2013 / 23:02: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:
39
diff
changeset
|
316 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
317 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
318 |
remove |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
319 |
"Make sure that this entry is tracked by Mercurial" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
320 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
321 |
self isTracked ifTrue:[ |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
322 |
self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
323 |
(HGCommand remove |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
324 |
workingDirectory: filename directory; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
325 |
paths: { filename baseName }; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
326 |
yourself) |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
327 |
]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
328 |
filename remove |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
329 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
330 |
"Created: / 15-11-2012 / 00:08:59 / 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
|
331 |
"Modified: / 03-03-2013 / 23:03:21 / 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:
39
diff
changeset
|
332 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
333 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
334 |
track |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
335 |
"Make sure that this entry is tracked by Mercurial" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
336 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
337 |
self isUntracked ifTrue:[ |
235
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
338 |
self repository execute: |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
339 |
(HGCommand add |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
340 |
workingDirectory: filename directory; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
341 |
paths: { filename baseName }; |
3d8ef499d7d9
Command server is now used by default.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
234
diff
changeset
|
342 |
yourself) |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
343 |
] |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
344 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
345 |
"Created: / 15-11-2012 / 00:08:12 / 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
|
346 |
"Modified: / 03-03-2013 / 23:04:28 / 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:
39
diff
changeset
|
347 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
348 |
|
34 | 349 |
!HGWorkingCopyFile methodsFor:'printing & storing'! |
350 |
||
351 |
printOn:aStream |
|
352 |
"append a printed representation if the receiver to the argument, aStream" |
|
353 |
||
354 |
| path | |
|
355 |
||
356 |
aStream nextPut:$[. |
|
357 |
path := filename pathName. |
|
358 |
path := path copyFrom: wc path pathName size + 1. |
|
359 |
aStream nextPutAll: path. |
|
360 |
aStream nextPut:$]. |
|
361 |
||
362 |
"Modified: / 17-10-2012 / 13:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
363 |
! ! |
|
364 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
365 |
!HGWorkingCopyFile methodsFor:'reading-directories'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
366 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
367 |
directoryContentsAsFilenames |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
368 |
"return the contents of the directory as a collection of filenames. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
369 |
This excludes any entries for '.' or '..'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
370 |
Returns nil for non-existing directories; however, this behavior |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
371 |
may be changed in the near future, to raise an exception instead. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
372 |
So users of this method better test for existing directory before. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
373 |
Notice: |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
374 |
this returns the file-names as fileName instances; |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
375 |
see also #directoryContents, which returns strings." |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
376 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
377 |
|names| |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
378 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
379 |
names := filename directoryContents. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
380 |
names isNil ifTrue:[^ nil]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
381 |
^ names collect:[:entry | self construct:entry]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
382 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
383 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
384 |
'.' asFilename directoryContentsAsFilenames |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
385 |
'/XXXdoesNotExist' asFilename directoryContentsAsFilenames |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
386 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
387 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
388 |
"Modified: / 15-11-2012 / 01:13:27 / 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:
39
diff
changeset
|
389 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
390 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
391 |
directoryContentsAsFilenamesMatching: patternOrCollectionOfThose |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
392 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
393 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
394 |
Same as directoryContentsAsFilenames, but returns only files |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
395 |
that matches given patterns. This uses String>>matches: |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
396 |
for pattern matching |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
397 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
398 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
399 |
|names| |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
400 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
401 |
names := filename directoryContentsMatching: patternOrCollectionOfThose . |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
402 |
names isNil ifTrue:[^ nil]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
403 |
^ names asOrderedCollection collect:[:entry | self construct:entry]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
404 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
405 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
406 |
'/etc' asFilename |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
407 |
directoryContentsAsFilenamesMatching: 'pass*' |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
408 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
409 |
'/etc' asFilename |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
410 |
directoryContentsAsFilenamesMatching: #('pass*' 'nsswitch.conf') |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
411 |
" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
412 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
413 |
"Created: / 03-06-2009 / 09:57:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
414 |
"Modified: / 15-11-2012 / 01:13:36 / 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:
39
diff
changeset
|
415 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
416 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
417 |
recursiveDirectoryContentsAsFilenames |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
418 |
"return the contents of the directory and all subdirectories |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
419 |
as a collection of filenames. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
420 |
This excludes any entries for '.' or '..'. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
421 |
Returns nil for non-existing directories; however, this behavior |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
422 |
may be changed in the near future, to raise an exception instead. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
423 |
So users of this method better test for existing directory before. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
424 |
Notice: |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
425 |
this returns the file-names as fileName instances; |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
426 |
see also #recursiveDirectoryContents, which returns strings. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
427 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
428 |
Warning: this may take a long time to execute." |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
429 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
430 |
|names| |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
431 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
432 |
names := filename recursiveDirectoryContents. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
433 |
names isNil ifTrue:[^ nil]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
434 |
^ names collect:[:entry | self construct:entry]. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
435 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
436 |
"Created: / 15-11-2012 / 01:11:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
437 |
! ! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
438 |
|
36 | 439 |
!HGWorkingCopyFile methodsFor:'testing'! |
440 |
||
441 |
isAdded |
|
442 |
^ self status isAdded |
|
443 |
||
444 |
"Modified: / 23-10-2012 / 11:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
445 |
! |
|
446 |
||
447 |
isClean |
|
448 |
^ self status isClean |
|
449 |
||
450 |
"Modified: / 23-10-2012 / 11:13:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
451 |
! |
|
452 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
453 |
isCleanOrIgnored |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
454 |
| s | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
455 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
456 |
s := self status. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
457 |
^s isClean or:[s isIgnored] |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
458 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
459 |
"Created: / 15-11-2012 / 01:25:27 / 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:
39
diff
changeset
|
460 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
461 |
|
177
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
462 |
isConflict |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
463 |
"Return true, if the file had a conflict during merge or update. |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
464 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
465 |
Note, that this return true even if the file was later merged |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
466 |
and conflicts resolved. To check whether conflicts are resolved or |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
467 |
not, use #isResolved or isUnresolved" |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
468 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
469 |
^wc mergeState includesKey: self pathNameRelative. |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
470 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
471 |
"Created: / 14-01-2013 / 16:54:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
472 |
! |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
473 |
|
36 | 474 |
isIgnored |
475 |
^ self status isIgnored |
|
476 |
||
477 |
"Modified: / 23-10-2012 / 11:13:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
478 |
! |
|
479 |
||
480 |
isMissing |
|
481 |
^ self status isMissing |
|
482 |
||
483 |
"Modified: / 23-10-2012 / 11:12:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
484 |
! |
|
485 |
||
486 |
isModified |
|
487 |
^ self status isModified |
|
488 |
||
489 |
"Modified: / 23-10-2012 / 11:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
490 |
! |
|
491 |
||
492 |
isNotTracked |
|
493 |
^ self status isNotTracked |
|
494 |
||
495 |
"Modified: / 23-10-2012 / 11:13:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
496 |
! |
|
497 |
||
498 |
isRemoved |
|
499 |
^ self status isRemoved |
|
500 |
||
501 |
"Modified: / 23-10-2012 / 11:13:42 / 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:
39
diff
changeset
|
502 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
503 |
|
177
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
504 |
isResolved |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
505 |
"Return true, if the file had a conflict during merge or update |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
506 |
and is marked as resolved." |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
507 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
508 |
^(wc mergeState at: self pathNameRelative) == $R |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
509 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
510 |
"Created: / 14-01-2013 / 16:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
511 |
! |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
512 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
513 |
isTracked |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
514 |
| s | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
515 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
516 |
s := self status. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
517 |
^s isNotTracked not and:[s isIgnored not and:[s isRemoved not]] |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
518 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
519 |
"Created: / 15-11-2012 / 00:11:50 / 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:
39
diff
changeset
|
520 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
521 |
|
177
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
522 |
isUnresolved |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
523 |
"Return true, if the file had a conflict during merge or update |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
524 |
and is marked as not yet resolved." |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
525 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
526 |
^(wc mergeState at: self pathNameRelative) == $U |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
527 |
|
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
528 |
"Created: / 14-01-2013 / 16:56:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
529 |
! |
1b0ddad9770e
Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
165
diff
changeset
|
530 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
531 |
isUntracked |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
532 |
"An alias for not-tracked" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
533 |
^ self isNotTracked |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
534 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
535 |
"Created: / 14-11-2012 / 23:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
536 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
537 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
538 |
isUntrackedOrIgnored |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
539 |
| s | |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
540 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
541 |
s := self status. |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
542 |
^s isNotTracked or:[s isIgnored] |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
543 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
544 |
"Created: / 15-11-2012 / 01:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
545 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
546 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
547 |
isUnversioned |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
548 |
"An alias for not-tracked" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
549 |
^ self isNotTracked |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
550 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
551 |
"Created: / 14-11-2012 / 23:56:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
36 | 552 |
! ! |
553 |
||
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
554 |
!HGWorkingCopyFile::LazyRevision methodsFor:'accessing'! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
555 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
556 |
changeset |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
557 |
^changeset isHGChangeset |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
558 |
ifTrue:[changeset] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
559 |
ifFalse:[changeset := wc repository changesetWithId: changeset] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
560 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
561 |
"Created: / 22-01-2013 / 13:38:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
562 |
! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
563 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
564 |
changesetId |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
565 |
^changeset isHGChangesetId |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
566 |
ifTrue:[changeset] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
567 |
ifFalse:[changeset id] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
568 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
569 |
"Created: / 22-01-2013 / 13:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
570 |
! ! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
571 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
572 |
!HGWorkingCopyFile::LazyRevision methodsFor:'error handling'! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
573 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
574 |
doesNotUnderstand: aMessage |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
575 |
(HGChangesetFile canUnderstand: aMessage selector) ifFalse:[ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
576 |
^ super doesNotUnderstand: aMessage |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
577 |
]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
578 |
self ensureNotLazy. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
579 |
^aMessage sendTo: (collection at: index). |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
580 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
581 |
"Created: / 22-01-2013 / 13:41:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
582 |
! ! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
583 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
584 |
!HGWorkingCopyFile::LazyRevision methodsFor:'initialization'! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
585 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
586 |
setCollection: coll index: idx changesetId: csId workingCopy: workCopy path: p |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
587 |
collection := coll. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
588 |
index := idx. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
589 |
changeset := csId. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
590 |
wc := workCopy. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
591 |
path := p. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
592 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
593 |
"Created: / 22-01-2013 / 13:32:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
594 |
! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
595 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
596 |
setPath: p |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
597 |
path := p. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
598 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
599 |
"Created: / 22-01-2013 / 13:48:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
600 |
! ! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
601 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
602 |
!HGWorkingCopyFile::LazyRevision methodsFor:'private'! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
603 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
604 |
ensureNotLazy |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
605 |
| cs file renamed | |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
606 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
607 |
index ~~ 1 ifTrue:[ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
608 |
(collection at: index - 1) ensureNotLazy. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
609 |
]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
610 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
611 |
cs := self changeset. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
612 |
file := cs / path. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
613 |
collection at: index put: file. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
614 |
index ~~ collection size ifTrue:[ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
615 |
cs changes do:[:chg| |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
616 |
"/Catch renames... |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
617 |
(chg isCopied and:[chg path = path]) ifTrue:[ |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
618 |
renamed := chg source. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
619 |
index + 1 to: collection size do:[:i| |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
620 |
(collection at: i) setPath: renamed. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
621 |
]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
622 |
^self |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
623 |
] |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
624 |
]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
625 |
]. |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
626 |
|
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
627 |
"Created: / 22-01-2013 / 13:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
628 |
! ! |
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
629 |
|
34 | 630 |
!HGWorkingCopyFile class methodsFor:'documentation'! |
631 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
632 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
633 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
634 |
^ '$Changeset: <not expanded> $' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
635 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
636 |
|
34 | 637 |
version_SVN |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
638 |
^ '§Id:: §' |
34 | 639 |
! ! |
190
a4a4b6f2fc52
Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
180
diff
changeset
|
640 |