Source

newspeak / VCSCore.ns3

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
Newspeak3
'StructuredVCS'
class VCSCore usingPlatform: p vcs: vcs ide: ide = (
"A source control application that supports different VCS backends (git, hg, ...).

Support for new VCSs can be added by providing a custom implementation of AbstractBackend.


Copyright (c) 2010-2011 Matthias Kleine

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ''Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ''AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"|
importedSourceMirrors = vcs sourceMirrors.

private diffing = vcs diffing.

"Collections"
protected Set = p blackMarket Collections Set.
protected OrderedCollection = p blackMarket Collections OrderedCollection.
protected Dictionary = p blackMarket Collections Dictionary.


protected Stream = p blackMarket Collections Stream.
protected TextStream = p blackMarket Collections TextStream.

protected ExternalLauncher = p blackMarket ExternalProcess ExternalLauncher.

protected UUID = p blackMarket Network UUID.

protected Time = p blackMarket Kernel Time.
protected Monitor = p blackMarket Kernel Monitor.

protected Color = p blackMarket Graphics Color.

protected MultiByteBinaryOrTextStream = p blackMarket Multilingual MultiByteBinaryOrTextStream.

private CrLfFileStream = p blackMarket Files CrLfFileStream.

protected HopscotchImages = p blackMarket Hopscotch HopscotchImages.

protected hopscotch = p hopscotch.
protected Subject = hopscotch core Subject.
protected Presenter = hopscotch core Presenter.
protected RowComposer = hopscotch composers RowComposer.
protected ColumnComposer = hopscotch composers ColumnComposer.
protected BlankFragment = hopscotch fragments BlankFragment.
protected TextEditorFragment = hopscotch fragments TextEditorFragment.
protected SeparatorItem = hopscotch SeparatorItem.
protected Menu = hopscotch Menu.
protected MenuItem = hopscotch MenuItem.
protected EditableLinePresenter = hopscotch fragments EditableLinePresenter.

protected Transcript = p blackMarket Transcript.

brazil = p brazil.
private Gradient = brazil plumbing Gradient.

private FileDirectory = p blackMarket Files FileDirectory.

"Nested classes"

protected Differencer = diffing Differencer.
protected WordMerger = diffing WordMerger.

protected SourceControlSubject = vcs ui SourceControlSubject.

Processor = p blackMarket Processor.

"Other fields"
protected logger = Logger new.
private processes = Set new.
|)
(
class AbstractBackend = ("Abstract superclass for concrete back-ends. Provides shared functionality.

Concrete implementations must provide a subclass of AbstractBackend that implements classes/methods marked as such"|
|)
(
class AbstractLocalRepository onRepositoryId: repositoryId = Repository onRepositoryId: repositoryId (|
protected repositoryDirectory = FileDirectory on: repositoryId.
protected repositoryVersionAccessing = RepositoryVersionAccessing new.
|)
(
class AbstractLocalHistorian named: n version: v = SuperHistorian named: n (|
	version = v.
|)
('accessing'
canMergeWith: otherVersion = (

	^ (version isAncestorOf: otherVersion version) not and: [
			(otherVersion version isAncestorOf: version) not]
)'actions'
cloneAs: clonedHistorianName ifFail: failBlock = (

	^ repository
		newHistorianNamed: clonedHistorianName
		setTo: version
		ifFail: failBlock.
)
forkAs: forkedHistorianName ifFail: failBlock = (

	| forkedHistorian |
	forkedHistorian:: repository newHistorianNamed: forkedHistorianName setTo: version ifFail: failBlock.
	^ forkedHistorian
)
forwardTrackedHistorianIfFail: failBlock = (

	trackedHistorianifPresent: [:trackedHistorian | trackedHistorian setTo: version ifFail: failBlock]
	ifAbsent: [failBlock value: 'No tracked historian available']
	ifError: [
		logger warn: 'Couln''t access historian'.
		failBlock value: 'Failed to access historian']
)
setTo: newVersion ifFail: failBlock = (

	super setTo: newVersion ifFail: failBlock.
	version:: newVersion
)
shareTo: remoteRepository = (

	| newName newHistorian |
	newHistorian:: remoteRepository newHistorianNamed: name setTo: version ifFail: [logger error: 'Could not create a new remote historian'].
	trackedHistorian: newHistorian.
)'subclassResponsibility'
trackedHistorian: otherHistorian = (

	subclassResponsibility
)
trackedHistorianifPresent: presentBlock ifAbsent: absentBlock ifError: errorBlock = (

	subclassResponsibility
)) : ()
class AbstractRepositoryVersionAccessing = ()
(
class AbstractRepositoryVersion = Version ("An immutable Version that can be retrieved from the repository using an identifier."|
	internalId
	message
	author
	cachedWithAncestors
|)
('accessing'
hash = (

	^ internalId hash
)
isParentOfImage = (

	^ imageHistorian version = self
)
isRepositoryVersion = (

	^ true
)
parents = (

	^ parentInternalIds collect: [:each | versionAtInternalId: each].
)
withAncestors = (

	nil = cachedWithAncestors ifTrue: [
		cachedWithAncestors:: super withAncestors].
	^ cachedWithAncestors
)'actions'
loadIntoImage = (

	sourceMirrors installMirrorsAsToplevelClasses: mirrors
)'subclassResponsibility'
parentInternalIds = (

	subclassResponsibility
)'testing'
= other = (

	^ other internalId = internalId
)) : ()
class AbstractRepositoryVersionStream onStream: s = Stream (|
	stream = s.
|)
('accessing'
atEnd = (

	^ stream atEnd
)
contents = (

	| copied |
	copied:: self class onStream: stream contents readStream.
	^ Array streamContents: [:resultStream |
		[copied atEnd] whileFalse: [
			resultStream nextPut: copied next]].
)'actions'
nextLine = (

	^ String streamContents: [:resultStream | | c |
		c:: stream next.
		[c = nil or: [c = Character cr]] whileFalse: [
			resultStream nextPut: c.
			c:: stream next]]
)) : ()'accessing'
Version = (

	"We shouldn't require this. But something appears to be broken with the compiler."
	^ outer AbstractBackend Version
)'subclassResponsibility'
exportVersionId: internalId to: remoteRepository = (

	subclassResponsibility
)
importVersionId: internalId from: remoteRepository = (

	subclassResponsibility
)
versionAtInternalId: internalId = (

	subclassResponsibility
)) : ()'accessing'
Stream = (

	"Something is broken with the NS2 compiler. It cannot find Stream otherwise."
	^ outer VCSCore Stream
)
SuperHistorian = (

	^ super Historian
)
historianNamed: name versionId: versionId = (

	^ Historian named: name version: (versionAtInternalId: versionId)
)
logStream = (

	^ repositoryVersionAccessing logStream
)
remoteRepositoryAt: repositoryId = (

	^ remoteRepositories detect: [:each |
		each repositoryId = repositoryId or: [each name = repositoryId]]
)
versionAtInternalId: internalId = (

	^ repositoryVersionAccessing versionAtInternalId: internalId
)'actions'
exportVersionId: internalId to: remoteRepository = (

	repositoryVersionAccessing exportVersionId: internalId to: remoteRepository
)
importVersionId: internalId from: remoteRepository = (

	^ repositoryVersionAccessing importVersionId: internalId from: remoteRepository
)
refresh = (

	"May be overridden"
)'subclassResponsibility'
RepositoryVersionAccessing = (

	subclassResponsibility
)
create = (

	subclassResponsibility
)
imageHistorian = (

	subclassResponsibility
)
remoteRepositories = (

	subclassResponsibility
)) : ()
class AbstractRemoteRepository onLocalRepository: lr onRepositoryId: repositoryId onName: n = Repository onRepositoryId: repositoryId (|
	protected localRepository = lr.
	protected name = n.|)
(
class AbstractRemoteHistorian named: historianName versionId: vId = GeneralHistorian named: historianName ("A historian stored in a remote repository. It knows only it's version's identifier"|
	versionId ::= vId.
|)
('accessing'
isTracked = (

	^ localRepository historians anySatisfy: [:each |
		each
			trackedHistorianifPresent: [:trackedHistorian | self = trackedHistorian]
			ifAbsent: [false]
			ifError: [
				logger warn: 'Couln''t access historian'.
				false]]
)
version = (

	repository exportVersionId: versionId.
	^ localRepository versionAtInternalId: versionId
)'actions'
createIfFail: failBlock = (

	repository importVersionId: version internalId.
	super createIfFail: failBlock
)
trackAs: localHistorianName = (

	^ localRepository
		newHistorianNamed: localHistorianName
		trackingHistorian: self
		setTo: version
		ifFail: [insertErrorHandlingForTrackingAHistorianWhenALocalHistorianWithTheGivenNameAlreadyExists]
)) : ()'accessing'
GeneralHistorian = (

	^ super Historian
)
historianNamed: name versionId: versionId = (

	^ Historian named: name versionId: versionId
)
repository = (

	^ self
)'actions'
exportVersionId: versionId = (

	localRepository importVersionId: versionId from: self
)
importVersionId: versionId = (

	localRepository exportVersionId: versionId to: self
)) : ()
class AbstractRepository onRepositoryId: rid = (|
    private repositoryId = rid.
	protected cachedCommand
|)
(
class AbstractCommand = (|
	cachedLauncher
|)
(
class Launcher = (|
cachedExternalLauncher
command

|)
('accessing'
externalLauncher = (

	nil = cachedExternalLauncher ifTrue: [
		cachedExternalLauncher:: ExternalLauncher for: command.
		cachedExternalLauncher
			otherUnixLocations: {'/opt/local/bin'. '/usr/local/bin'};
			otherWindowsLocations: {'c:\cygwin\bin'}].
	^cachedExternalLauncher
)'actions'
noDefaultArgumentsRun: arguments = (

	^ externalLauncher
		runWith: arguments
		ifSuccess: [ :stdout <ReadStream> :stderr <ReadStream> |
			stdout contents]
		ifFailure: [ :stdout <ReadStream> :stderr <ReadStream> |
			halt]
)
run: arguments = (

	^ run: arguments ifFail: [halt]
)
run: arguments ifFail: failBlock= (

	^ run: arguments ifSuccess: [:stdout :stderr | stdout contents] ifFailure: [:stdout :stderr | failBlock value]
)
run: arguments ifSuccess: successBlock ifFailure: failureBlock = (

	^ externalLauncher
		runWith: defaultArguments, arguments
		ifSuccess: [ :stdout <ReadStream> :stderr <ReadStream> |
			successBlock value: stdout value: stderr]
		ifFailure: [ :stdout <ReadStream> :stderr <ReadStream> |
			failureBlock value: stdout value: stderr]
)
runLines: arguments = (

	^ runLines: arguments ifFail: [halt]
)
runLines: arguments ifFail: failBlock = (

	| result|
	result:: OrderedCollection new.
	(run: arguments ifFail: failBlock) linesDo: [:each |
		result add: each].
	^ result
)
runStream: arguments = (

	| resultStream |
	resultStream:: run: arguments ifSuccess: [:stdout :stderr | stdout] ifFailure: [:stdout :stderr | halt].
	^ (MultiByteBinaryOrTextStream with: resultStream contents encoding: 'utf8') reset
)) : ()'accessing'
ignoredFilename = (

	^ '.ignore'
)
launcher = (

	cachedLauncher = nil ifTrue: [
		cachedLauncher::  Launcher new
			command: commandLine;
			yourself].
	^ cachedLauncher
)'actions'
writeStream: stream toFileNamed: filename = (

	(CrLfFileStream forceNewFileNamed: (repository repositoryDirectory / filename) pathName)
		ascii;
		nextPutAll: stream contents;
		close.
)'subclassResponsibility'
commandLine = (

	subclassResponsibility
)
defaultArguments = (

	subclassResponsibility
)'testing'
isFilenameIgnored: filename = (

	^ filename = ignoredFilename
)) : ()
class AbstractHistorian named: historianName = (|

	public name = historianName.
|)
(
class AbstractHistorianChange onVersion: v = ("Encapsulates the action of committing a new version"|

newVersion = v.
|)
('accessing'
changedMirrors = (

	| filteredZippedMirrors |
	"TODO: Move zippedMirrors + allEqual into intermediate Project/StoreSnapshot abstraction. Check for senders of allEqual:"
	filteredZippedMirrors:: zippedMirrors reject: [:each |
		nil = each first
			or: [Differencer allEqual: each]].
	^ filteredZippedMirrors collect: [:each | each first]
)
deletedOriginalMirrors = (

	| filteredZippedMirrors |
	filteredZippedMirrors:: zippedMirrors select: [:each | nil = each first].
	^ filteredZippedMirrors collect: [:each | each second]
)
historian = (

	^ outer AbstractHistorian historian
)'actions'
commit = (

	subclassResponsibility
)'private'
zippedMirrors = (

	"try zippedMirrorsWith:"
	^ newVersion zipMirrors: {newVersion mirrors. historian version mirrors}.
)) : ()'accessing'
hash = (

	^ name hash
)
historian = (

	^ self
)
repository = (

	^ outer AbstractRepository repository
)
versionsIncomingFrom: otherHistorian = (

	^ version versionsIncomingFrom: otherHistorian version
)'actions'
commit: v = (

	"Commits a new version and sets the historian to it. We might want to do this using
	setTo:ifFail: only. We could dispatch on the version to determine whether the version is new and has to be committed."
	| change |
	(v parents includes: self version) ifFalse: [logger error: 'Trying to commit non-child version'].
	change:: HistorianChange onVersion: v.
	change commit
)
loadIntoImage = (

	version loadIntoImage.
	makeCurrentHistorian
)'subclassResponsibility'
HistorianChange = (

	subclassResponsibility
)
createIfFail: failBlock = (

	subclassResponsibility
)
makeCurrentHistorian = (

	subclassResponsibility
)
version = (

	subclassResponsibility
)'testing'
= other = (

	^ repository = other repository and: [name = other name]
)
canForwardTo: otherVersion = (

	^ (version = otherVersion version) not and: [
		version isAncestorOf: otherVersion version]
)) : ()'accessing'
command = (

	nil = cachedCommand ifTrue: [
		cachedCommand:: Command new.].
	^ cachedCommand
)
hash = (

	^ self repositoryId hash
)
historianNamed: historianName ifFail: failBlock = (

	^ historians detect: [:each | each name = historianName] ifNone: failBlock
)
repository = (

	^ self
)'actions'
createNewVersion = (

	^ NewVersion new
)
newHistorianNamed: historianName setTo: initialVersion ifFail: failBlock = (

	(historians anySatisfy: [:each | each name = historianName]) ifTrue: [
		^ failBlock value].
	^ (Historian named: historianName version: initialVersion)
		createIfFail: failBlock;
		yourself
)
newHistorianNamed: historianName trackingHistorian: trackedHistorian setTo: initialVersion ifFail: failBlock = (

	| result |
	result:: newHistorianNamed: historianName setTo: initialVersion ifFail: failBlock.
	nil = trackedHistorian ifFalse: [
		result trackedHistorian: trackedHistorian].
	^ result
)'subclassResponsibility'
Historian = (

	subclassResponsibility
)
clone: repositoryLocation = (

	subclassResponsibility
)
historianNamed: name versionId: versionId = (

	"Implemented in abstract subclasses"
	subclassResponsibility
)
historians = (

	subclassResponsibility
)
logStream = (

	subclassResponsibility
)
repositoryType = (

	subclassResponsibility
)'testing'
= other = (

	^ self repositoryId = other repositoryId and: [
		self repositoryType = other repositoryType]
)) : ()
class NewVersion = Version (
"A version that has not yet been committed."|
	parents
	mirrors
	message
|)
('accessing'
hash = (

	^ message hash
)'testing'
= other = (

	"TODO: Move zippedMirrors + allEqual into intermediate Project/StoreSnapshot abstraction. Check for senders of allEqual:"
	^ other message = message and: [ | zippedMirrors |
		zippedMirrors:: self zipMirrors: {self mirrors. other mirrors}.
		(zippedMirrors allSatisfy: [:each | Differencer allEqual: each]) and: [
			other parents asSet = parents asSet]]
)
commonAncestorWith: version = (

	parents size = 0 ifTrue: [logger halt: 'no parents set'].
	^ parents inject: version into: [:acc :each | acc commonAncestorWith: each]
)) : ()
class Version = ("Common functionality shared by all versions

Subclasses must provide:
- parents
- mirrors
- hash
- =
- commonAncestorWith:

Generic implementations could be provided for hash, =, commonAncestorWith: if needed at some point."|
|)
('accessing'
commonAncestorWith: otherVersion = (

	subclassResponsibility
)
diffsFrom: version = (

	| zippedMirrors |
	zippedMirrors:: zippedMirrorsWith: version.
	^ zippedMirrors collect: [:each |
		Differencer compare: each last to:each first withAncestor: each second]
)
diffsFromFirstParent = (

	^ diffsFrom: parents first
)
diffsTo: version = (

	^ version diffsFrom: self
)
hash = (

	subclassResponsibility
)
mirrors = (

	subclassResponsibility
)
parents = (

	subclassResponsibility
)
versionsIncomingFrom: otherVersion = (

	"The name isn't too descriptive. But withAncestorsNotContainedIn: (works the other way) isn't that good, either"
	"The implementation is slow and can be optimized to traverse ancestors in parallel, should efficiency become a problem."
	^ otherVersion withAncestors copyWithoutAll: self withAncestors asSet
)
withAncestors = (

	"While traversing our ancestors we must keep track of ancestors that we already added to the result. We're using an iterative approach for traversing through the ancestors, as a recursive algorithm was too slow."
	| result position ancestorsAlreadyAdded |

	result:: OrderedCollection new.
	position:: 1.
	ancestorsAlreadyAdded:: Set new.	
	result add: self.

	[position > result size] whileFalse: [ | current |
		current:: result at: position.
		position:: position + 1.
		current parents do: [:each |
			(ancestorsAlreadyAdded includes: each) ifFalse: [
				ancestorsAlreadyAdded add: each.
				result add: each]]].
	^ result		
)
zipMirrors: mirrorCollections = (

	| sortBlock |
	sortBlock:: [:a :b | a filename asString <= b filename asString]. "filename not name because a module and package might share a name"
	^ genericZip: mirrorCollections sortBlock: sortBlock
)
zippedMirrorsWith: other = (

	| commonAncestor |
	commonAncestor:: commonAncestorWith: other.
	^ zipMirrors: {mirrors. commonAncestor mirrors. other mirrors}.
)'private'
genericZip: partitions sortBlock: sortBlock = (

	"Taken from my parsing code"
	| streams result partitionsHavingSmallest |
	result:: OrderedCollection new.
	partitionsHavingSmallest:: OrderedCollection new.
	streams:: partitions collect: [:each |
		(each asSortedCollection: sortBlock) readStream].
	[streams allSatisfy: [:each | each atEnd]] whileFalse: [ | smallest zipped  |
		partitionsHavingSmallest reset.
		smallest:: nil.
		streams doWithIndex: [:stream :i | | c |
			stream atEnd ifFalse: [
				c:: stream peek.
				(smallest isNil or: [sortBlock value: c value: smallest]) ifTrue: [
					(smallest isNil or: [(sortBlock value: smallest value: c) not]) ifTrue: [
						smallest:: c.
						partitionsHavingSmallest reset].
					partitionsHavingSmallest add: i]]].
		zipped:: Array ofSize: partitions size. "Object allocation"
		partitionsHavingSmallest do: [:i | | stream |
			stream:: streams at: i.
			zipped at: i put: stream next].
		result add: zipped].
	^ result
)'testing'
= other = (

	subclassResponsibility
)
isAncestorOf: version = (

	^ self = (self commonAncestorWith: version)
)) : ()'accessing'
sourceMirrors = (

	^ importedSourceMirrors
)'subclassResponsibility'
LocalRepository = (

	subclassResponsibility
)
RemoteRepository = (

	subclassResponsibility
)) : ()
class Logger = (|
	logMonitor = Monitor new.
	logCounter ::= 0.
|)
('as yet unclassified'
error: msg = (
	Error signal: msg
)
halt: message = (

	log: 'HALT: ', message.
	halt
)
info: message = (

	log: 'INFO: ', message.
)
log: message = (

	"logMonitor critical: [
		logCounter:: logCounter + 1.
		Transcript cr; show: '[', logCounter asString, ' | ', Time now asString, ']', message.]."
)
log: message around: block = (

	| result |
	log: '[BEGIN]', message.
	result:: block value.
	log: '[END]', message.
	^ result
)
warn: message = (

	log: 'WARNING: ', message
)) : ()'accessing'
sourceMirrors = (

	^ importedSourceMirrors
)'actions'
forkAndRemember: block = (

	[
		| process |
		process:: Processor activeProcess.
		processes add: process.
		block ensure: [processes remove: process]] fork
)
shutdown = (

	"Might currently be called multiple times"
	"Don't shut down the mirror loader for now, as we're reinstantiating VCS without doing so for the SourceMirrors"
)) : ()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.