author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 01 Dec 2012 01:00:13 +0000 | |
changeset 118 | 5a8b78ad48ae |
parent 115 | b1ed2d29054b |
child 123 | ee1cc926f489 |
permissions | -rw-r--r-- |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
1 |
"{ Package: 'stx:libscm/mercurial' }" |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
2 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
3 |
SCMAbstractPackageModelRegistry subclass:#HGPackageModelRegistry |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
4 |
instanceVariableNames:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
5 |
classVariableNames:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
7 |
category:'SCM-Mercurial-StX' |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
8 |
! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
9 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
10 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
11 |
!HGPackageModelRegistry methodsFor:'accessing'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
12 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
13 |
packageNamed:package |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
14 |
"Returns a HGPackageModel for given package." |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
15 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
16 |
| dir repo | |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
17 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
18 |
packages at: package ifPresent: [ :pkg | ^ pkg ]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
19 |
wcs at: package ifPresent:[ :wc | ^ wc ]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
20 |
dir := Smalltalk getPackageDirectoryForPackage: package. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
21 |
dir := HGRepository discover: dir. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
22 |
dir isNil ifTrue:[ |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
23 |
HGError raiseErrorString: 'No repository found for package ',package. |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
24 |
^nil. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
25 |
]. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
26 |
repo := repositories at: dir ifAbsentPut: [ HGRepository on: dir ]. |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
27 |
^packages at: package ifAbsentPut: [ HGPackageModel new name: package repository: repo ]. |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
28 |
|
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
29 |
"Created: / 14-11-2012 / 00:15:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
30 |
"Modified: / 16-11-2012 / 19:52:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
31 |
! ! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
32 |
|
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
33 |
!HGPackageModelRegistry methodsFor:'initialization'! |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
34 |
|
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
35 |
flush: pattern |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
36 |
"Flushes all cached data packages matching given name." |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
37 |
| toFlush | |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
38 |
toFlush := OrderedCollection new. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
39 |
packages valuesDo:[:package| |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
40 |
(package name matches: pattern) ifTrue:[toFlush add: package]]. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
41 |
toFlush do:[:package| |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
42 |
| wcdir | |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
43 |
repositories removeKey: package repository path ifAbsent:[nil]. |
118
5a8b78ad48ae
Refactoring (part 2): Rename SCMAbstractPackageModel>>workingCopy to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
44 |
wcdir := package temporaryWorkingCopy path. |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
45 |
[ wcdir recursiveRemove ] on: Error do:[ |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
46 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
47 |
Delay waitForSeconds: 1. |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
48 |
wcdir recursiveRemove. |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
49 |
]. |
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
50 |
]. |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
51 |
packages removeKey: package name |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
52 |
]. |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
53 |
|
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
54 |
"Created: / 16-11-2012 / 19:40:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
96
7a0ecabf712b
HGPackageModelRegistry>>flush: fix for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
93
diff
changeset
|
55 |
"Modified: / 22-11-2012 / 16:03:07 / jv" |
118
5a8b78ad48ae
Refactoring (part 2): Rename SCMAbstractPackageModel>>workingCopy to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
56 |
"Modified: / 01-12-2012 / 00:32:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
93
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
57 |
! ! |
2579830f6b61
Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
69
diff
changeset
|
58 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
59 |
!HGPackageModelRegistry class methodsFor:'documentation'! |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
60 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
61 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
62 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
96
diff
changeset
|
63 |
^ '$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
|
64 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
65 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
66 |
version_SVN |
69
17045d49309f
Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
67 |
^ '§Id:: §' |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
68 |
! ! |