Added SCMAbstractPackageRevision>>changeSet.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 14 Mar 2014 22:59:53 +0000
changeset 411 858944cebec4
parent 397 579b4fd3e9a9
child 412 2bff8b2fe2af
Added SCMAbstractPackageRevision>>changeSet. It returns a ChangeSet containing all code of the package at that particular revision. Currently, code of Java extension methods is not returned. This will be fixed in next commits once we make HGChangesetFile more like Filename. Some work on SCMAbstractPackageRevision>>changeSet - not yet finished. *** More work on SCMAbstractPackageRevision>>changeSet
common/Make.proto
common/Make.spec
common/SCMAbstractPackageModel.st
common/SCMAbstractPackageRevision.st
common/SCMAbstractPackageWorkingCopy.st
common/SCMError.st
common/SCMPackageModelError.st
common/SCMPackageModelWarning.st
common/SCMWarning.st
common/abbrev.stc
common/bc.mak
common/common.rc
common/libInit.cc
common/stx_libscm_common.st
mercurial/HGInvalidVersionError.st
mercurial/HGPackageRevision.st
mercurial/HGStXTests.st
mercurial/mercurial.rc
--- a/common/Make.proto	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/Make.proto	Fri Mar 14 22:59:53 2014 +0000
@@ -156,11 +156,15 @@
 $(OUTDIR)SCMCommonPackageModelGroup.$(O) SCMCommonPackageModelGroup.$(H): SCMCommonPackageModelGroup.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)SCMCommonSourceCodeManagerUtilities.$(O) SCMCommonSourceCodeManagerUtilities.$(H): SCMCommonSourceCodeManagerUtilities.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/SourceCodeManagerUtilities.$(H) $(STCHDR)
 $(OUTDIR)SCMCompatModeQuery.$(O) SCMCompatModeQuery.$(H): SCMCompatModeQuery.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Query.$(H) $(STCHDR)
+$(OUTDIR)SCMError.$(O) SCMError.$(H): SCMError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)SCMWarning.$(O) SCMWarning.$(H): SCMWarning.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)stx_libscm_common.$(O) stx_libscm_common.$(H): stx_libscm_common.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractCommitDialog.$(O) SCMAbstractCommitDialog.$(H): SCMAbstractCommitDialog.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractDialog.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractFileoutLikeTask.$(O) SCMAbstractFileoutLikeTask.$(H): SCMAbstractFileoutLikeTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractTask.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractPackageRevision.$(O) SCMAbstractPackageRevision.$(H): SCMAbstractPackageRevision.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractPackageWorkingCopy.$(O) SCMAbstractPackageWorkingCopy.$(H): SCMAbstractPackageWorkingCopy.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
+$(OUTDIR)SCMPackageModelError.$(O) SCMPackageModelError.$(H): SCMPackageModelError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMError.$(H) $(STCHDR)
+$(OUTDIR)SCMPackageModelWarning.$(O) SCMPackageModelWarning.$(H): SCMPackageModelWarning.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMWarning.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractCommitTask.$(O) SCMAbstractCommitTask.$(H): SCMAbstractCommitTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractFileoutLikeTask.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractTask.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic3/ChangeSet.$(H) $(STCHDR)
 
--- a/common/Make.spec	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/Make.spec	Fri Mar 14 22:59:53 2014 +0000
@@ -59,11 +59,15 @@
 	SCMCommonPackageModelGroup \
 	SCMCommonSourceCodeManagerUtilities \
 	SCMCompatModeQuery \
+	SCMError \
+	SCMWarning \
 	stx_libscm_common \
 	SCMAbstractCommitDialog \
 	SCMAbstractFileoutLikeTask \
 	SCMAbstractPackageRevision \
 	SCMAbstractPackageWorkingCopy \
+	SCMPackageModelError \
+	SCMPackageModelWarning \
 	SCMAbstractCommitTask \
 
 
@@ -79,11 +83,15 @@
     $(OUTDIR_SLASH)SCMCommonPackageModelGroup.$(O) \
     $(OUTDIR_SLASH)SCMCommonSourceCodeManagerUtilities.$(O) \
     $(OUTDIR_SLASH)SCMCompatModeQuery.$(O) \
+    $(OUTDIR_SLASH)SCMError.$(O) \
+    $(OUTDIR_SLASH)SCMWarning.$(O) \
     $(OUTDIR_SLASH)stx_libscm_common.$(O) \
     $(OUTDIR_SLASH)SCMAbstractCommitDialog.$(O) \
     $(OUTDIR_SLASH)SCMAbstractFileoutLikeTask.$(O) \
     $(OUTDIR_SLASH)SCMAbstractPackageRevision.$(O) \
     $(OUTDIR_SLASH)SCMAbstractPackageWorkingCopy.$(O) \
+    $(OUTDIR_SLASH)SCMPackageModelError.$(O) \
+    $(OUTDIR_SLASH)SCMPackageModelWarning.$(O) \
     $(OUTDIR_SLASH)SCMAbstractCommitTask.$(O) \
     $(OUTDIR_SLASH)extensions.$(O) \
 
--- a/common/SCMAbstractPackageModel.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/SCMAbstractPackageModel.st	Fri Mar 14 22:59:53 2014 +0000
@@ -113,6 +113,15 @@
 
 !SCMAbstractPackageModel methodsFor:'accessing'!
 
+abbrevs
+    "Returns a Dictionary mapping class name to an abbrev entry object.
+     This object should at least respond to #fileName"
+
+    ^ self subclassResponsibility
+
+    "Created: / 14-03-2014 / 22:02:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 construct: aString
     "Create a package model for subpackage named aString"
 
@@ -132,6 +141,16 @@
     "Modified: / 03-12-2012 / 14:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+definition
+    "Returns a sort of project definition object.
+     It has to at least understand #classNamesAndAttributes and
+     #xtensionMethodNames."
+
+    ^ self subclassResponsibility
+
+    "Created: / 14-03-2014 / 21:57:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 name
     ^ name
 !
@@ -168,14 +187,63 @@
 
 !SCMAbstractPackageModel methodsFor:'accessing-containers'!
 
+containerFor: aString
+    "Return a container as Filename with given name"    
+
+    ^ self containerFor: aString ifAbsent: [ self error: 'No container named ', aString ]
+
+    "Modified: / 14-03-2014 / 22:15:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+containerFor: aString ifAbsent: aBlock
+    "Return a container as Filename with given name. If there's no such
+     container, evaluates a block"    
+
+    ^ self subclassResponsibility
+
+    "Created: / 14-03-2014 / 22:15:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+containerForProjectDefinition
+    ^ self containerFor: (ProjectDefinition initialClassNameForDefinitionOf: name) , '.st'
+
+    "Created: / 13-03-2014 / 23:02:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 22:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+containerNameForClass:cls
+    ^self
+        containerNameForClassNamed: cls theNonMetaclass fullName
+        language: cls programmingLanguage
+
+    "Created: / 07-10-2012 / 10:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-11-2012 / 00:46:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 containerNameForClassNamed: nm language: lang
     ^String streamContents:[:s|
+        | xlated |
+
+        "/ Here, consult abbreviation file...
+        lang isSmalltalk ifTrue:[
+            | abbrev |
+
+            abbrev := self abbrevs at: nm ifAbsent:[ nil ].
+            abbrev notNil ifTrue:[ 
+                xlated := abbrev fileName.
+            ].
+        ].
+        xlated isNil ifTrue:[ 
+            xlated := (nm copyReplaceAll:$: with: $_).
+        ].
+
         s nextPutAll: (nm copyReplaceAll:$: with: $_).
         s nextPut: $..
         s nextPutAll: lang sourceFileSuffix
     ]
 
     "Created: / 15-11-2012 / 00:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 22:00:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 containerNameForExtensions
--- a/common/SCMAbstractPackageRevision.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/SCMAbstractPackageRevision.st	Fri Mar 14 22:59:53 2014 +0000
@@ -19,12 +19,26 @@
 "{ Package: 'stx:libscm/common' }"
 
 SCMAbstractPackageModel subclass:#SCMAbstractPackageRevision
-	instanceVariableNames:''
+	instanceVariableNames:'definition classNamesAndAttributes abbrevs'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SCM-Common-StX'
 !
 
+Object subclass:#AbbrevEntry
+	instanceVariableNames:'className fileName category numClassInstVars'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:SCMAbstractPackageRevision
+!
+
+Object subclass:#ProjectDefinition
+	instanceVariableNames:'classNamesAndAttributes extensionMethodNames'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:SCMAbstractPackageRevision
+!
+
 !SCMAbstractPackageRevision class methodsFor:'documentation'!
 
 copyright
@@ -74,6 +88,107 @@
     "Modified: / 05-03-2014 / 22:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SCMAbstractPackageRevision methodsFor:'accessing'!
+
+abbrevs
+
+    abbrevs isNil ifTrue:[
+        | abbrev_stc |
+        abbrevs := Dictionary new.
+        abbrev_stc := self containerFor: 'abbrev.stc' ifAbsent:[ nil ].
+        abbrev_stc notNil ifTrue:[
+            abbrev_stc readingFileDo:[:stream |
+                Smalltalk
+                    withAbbreviationsFromStream:stream contents asString readStream
+                    do:[:nm :fn :pkg :cat :sz|
+                        abbrevs at: nm put: (AbbrevEntry new className:nm fileName:fn category:cat numClassInstVars:sz)
+                    ]
+            ].
+        ].
+    ].
+    ^ abbrevs
+
+    "Created: / 14-03-2014 / 09:57:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 22:18:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+changeSet
+    "Returns a ChangeSet representing (Smalltalk) code of this
+     package. For virtual packages, return nil."
+
+    | changeset container |
+
+    "/ If virtual, return nil. Q: Shouldn't it be better to throw an exception?
+    self isVirtual ifTrue:[ ^ nil ].
+
+    changeset := ChangeSet new.
+    "/ Add all classes...
+    self definition classNamesDo:[:name |
+        container := self containerNameForClassNamed: name language: SmalltalkLanguage instance.
+        container := self containerFor: container ifAbsent:[ nil ].
+        container notNil ifTrue:[
+           container readingFileDo:[:s|
+               changeset addAll: (ChangeSet fromStream: s)
+           ]
+        ] ifFalse:[ 
+            SCMPackageModelWarning newException
+                messageText: 'Missing class container for ', name;
+                parameter: (Array with: self with: name);
+                raiseRequest.
+        ].
+    ].
+
+    "/ Add all extensions...
+    container := self containerNameForExtensions.
+    container := self containerFor: container ifAbsent:[ nil ].
+    definition extensionMethodNames notEmpty ifTrue:[ 
+        container notNil ifTrue:[
+           container readingFileDo:[:s|
+               changeset addAll: (ChangeSet fromStream: s)
+           ]
+        ] ifFalse:[ 
+            SCMPackageModelWarning newException
+                messageText: 'Missing container for extensions';
+                parameter: (Array with: self);
+                raiseRequest.
+        ].
+    ] ifFalse:[ 
+        container notNil ifTrue:[
+           container readingFileDo:[:s|
+               changeset addAll: (ChangeSet fromStream: s)
+           ].
+           SCMPackageModelWarning newException
+               messageText: 'Project definition does not specify any extensions but extension container found';
+               parameter: (Array with: self);
+               raiseRequest.
+        ]
+    ].
+    ^ changeset
+
+    "Created: / 13-03-2014 / 22:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 22:47:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+definition
+    "Returns a kind of ProjectDefinition object that keeps some metadata
+     about the package, namely class names and list of extension methods.
+     For virtual packages, return nil."
+
+    "/ If virtual, return nil. Q: Shouldn't it be better to throw an exception?
+    self isVirtual ifTrue:[ ^ nil ].
+
+    definition isNil ifTrue:[
+        | changeset |
+
+        self containerForProjectDefinition readingFileDo:[:s|  
+            definition := SCMAbstractPackageRevision::ProjectDefinition fromStream: s    
+        ].
+    ].
+    ^ definition
+
+    "Created: / 14-03-2014 / 10:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SCMAbstractPackageRevision methodsFor:'accessing-private'!
 
 childNamed: aString
@@ -84,6 +199,16 @@
     "Created: / 07-03-2014 / 23:01:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SCMAbstractPackageRevision methodsFor:'private'!
+
+classNames
+    ^ OrderedCollection streamContents:[:s|
+        self classNamesDo:[:e | s nextPut: e ]  
+    ]
+
+    "Created: / 14-03-2014 / 09:20:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !SCMAbstractPackageRevision methodsFor:'testing'!
 
 isVirtual
@@ -97,3 +222,133 @@
     "Created: / 07-03-2014 / 23:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!SCMAbstractPackageRevision::AbbrevEntry methodsFor:'accessing'!
+
+category
+    ^ category
+!
+
+className
+    ^ className
+!
+
+className:classNameArg fileName:fileNameArg category:categoryArg numClassInstVars:numClassInstVarsArg
+    className := classNameArg.
+    fileName := fileNameArg.
+    category := categoryArg.
+    numClassInstVars := numClassInstVarsArg.
+
+    "Created: / 18-08-2011 / 14:18:30 / cg"
+!
+
+fileName
+    ^ fileName
+!
+
+numClassInstVars
+    ^ numClassInstVars
+
+    "Created: / 18-08-2011 / 14:18:37 / cg"
+! !
+
+!SCMAbstractPackageRevision::ProjectDefinition class methodsFor:'documentation'!
+
+documentation
+"
+    SCMAbstractPackageRevision::ProjectDefinition is kind of light-weight
+    project definition in keeping meta-data about package.
+
+    It has, to some extent, protocol compatible with ProjectDefinition
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+        ProjectDefinition
+
+"
+! !
+
+!SCMAbstractPackageRevision::ProjectDefinition class methodsFor:'instance creation'!
+
+fromChangeSet:aChangeSet
+    "Returns new definition based on data in changeset"
+
+    ^ self new initializeFromChangeSet: aChangeSet
+
+    "Created: / 14-03-2014 / 10:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+fromStream:aStream
+    ^ self fromChangeSet: (ChangeSet fromStream: aStream)
+
+    "Created: / 14-03-2014 / 10:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SCMAbstractPackageRevision::ProjectDefinition methodsFor:'accessing'!
+
+classNamesAndAttributes
+    ^ classNamesAndAttributes
+!
+
+classNamesAndAttributes:anArray
+    classNamesAndAttributes := anArray.
+!
+
+extensionMethodNames
+    ^ extensionMethodNames ? #()
+
+    "Created: / 14-03-2014 / 17:40:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+extensionMethodNames:anArray
+    extensionMethodNames := anArray.
+
+    "Created: / 14-03-2014 / 17:40:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SCMAbstractPackageRevision::ProjectDefinition methodsFor:'initialization'!
+
+initializeFromChangeSet: aChangeSet
+    aChangeSet do:[:change | 
+        (change isMethodCodeChange and:[ change selector = 'classNamesAndAttributes' ]) ifTrue:[ 
+            classNamesAndAttributes := Compiler evaluate: (change source copyFrom: 'classNamesAndAttributes' size + 1).
+        ].
+        (change isMethodCodeChange and:[ change selector = 'extensionMethodNames' ]) ifTrue:[ 
+            extensionMethodNames := Compiler evaluate: (change source copyFrom: 'extensionMethodNames' size + 1).
+        ].
+    ].
+
+    "Created: / 14-03-2014 / 10:08:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 17:35:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!SCMAbstractPackageRevision::ProjectDefinition methodsFor:'private'!
+
+classNamesAndAttributesDo: aBlock
+    classNamesAndAttributes do:[:entry |
+        |className attributes|
+
+        entry isArray ifFalse:[
+            className := entry.
+            attributes := #().
+        ] ifTrue:[
+            className := entry first.
+            attributes := entry copyFrom:2.
+        ].
+        aBlock value: className value: attributes
+     ].
+
+    "Created: / 14-03-2014 / 09:19:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+classNamesDo: aBlock
+    self classNamesAndAttributesDo:[:name :attributes | aBlock value: name ].
+
+    "Created: / 14-03-2014 / 09:19:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/common/SCMAbstractPackageWorkingCopy.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/SCMAbstractPackageWorkingCopy.st	Fri Mar 14 22:59:53 2014 +0000
@@ -102,6 +102,12 @@
 
 !SCMAbstractPackageWorkingCopy methodsFor:'accessing'!
 
+abbrevs
+    ^ self definition abbrevs
+
+    "Created: / 14-03-2014 / 22:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 classes
 
     ^self classesIncludingPrivate reject:[:cls|cls owningClass notNil]
@@ -229,27 +235,19 @@
 
 !SCMAbstractPackageWorkingCopy methodsFor:'accessing-containers'!
 
-containerFilenameFor: containerName
-
-    ^self temporaryWorkingCopyRoot / containerName
-
-    "Created: / 09-10-2008 / 20:25:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 01-12-2012 / 00:24:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
+containerFor: aString ifAbsent: aBlock
+    "Return a container as Filename with given name. If there's no such
+     container, evaluates a block"            
 
-containerNameForClass:cls
-    ^self
-        containerNameForClassNamed: cls theNonMetaclass fullName
-        language: cls programmingLanguage
+    ^self temporaryWorkingCopyRoot / aString
 
-    "Created: / 07-10-2012 / 10:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 15-11-2012 / 00:46:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 14-03-2014 / 22:18:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 containerWriteStreamFor: containerName
     | filename directory |
 
-    filename := self containerFilenameFor: containerName.
+    filename := self containerFor: containerName.
     (directory := filename directory) exists ifFalse:[
         directory recursiveMakeDirectory
     ].
@@ -258,7 +256,7 @@
         yourself
 
     "Created: / 09-10-2008 / 20:24:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 04-09-2012 / 23:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-03-2014 / 22:56:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 containerWriteStreamForClass:cls
@@ -277,14 +275,14 @@
 containerWriteStreamForExtensions: aProgrammingLanguage javaClass: aJavaClass
     | container |
 
-    container := self containerFilenameFor: (self containerNameForExtensions: aProgrammingLanguage javaClass: aJavaClass).
+    container := self containerFor: (self containerNameForExtensions: aProgrammingLanguage javaClass: aJavaClass).
     container directory exists ifFalse:[
          container directory recursiveMakeDirectory.
     ].
     ^ container writeStream
 
     "Created: / 04-09-2012 / 23:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 24-09-2013 / 12:07:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-03-2014 / 22:55:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 containers
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/SCMError.st	Fri Mar 14 22:59:53 2014 +0000
@@ -0,0 +1,50 @@
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'stx:libscm/common' }"
+
+Error subclass:#SCMError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SCM-Common-StX-Exceptions'
+!
+
+!SCMError class methodsFor:'documentation'!
+
+copyright
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/SCMPackageModelError.st	Fri Mar 14 22:59:53 2014 +0000
@@ -0,0 +1,50 @@
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'stx:libscm/common' }"
+
+SCMError subclass:#SCMPackageModelError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SCM-Common-StX-Exceptions'
+!
+
+!SCMPackageModelError class methodsFor:'documentation'!
+
+copyright
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/SCMPackageModelWarning.st	Fri Mar 14 22:59:53 2014 +0000
@@ -0,0 +1,50 @@
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'stx:libscm/common' }"
+
+SCMWarning subclass:#SCMPackageModelWarning
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SCM-Common-StX-Exceptions'
+!
+
+!SCMPackageModelWarning class methodsFor:'documentation'!
+
+copyright
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/SCMWarning.st	Fri Mar 14 22:59:53 2014 +0000
@@ -0,0 +1,68 @@
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'stx:libscm/common' }"
+
+Notification subclass:#SCMWarning
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SCM-Common-StX-Exceptions'
+!
+
+!SCMWarning class methodsFor:'documentation'!
+
+copyright
+"
+stx:libscm - a new source code management library for Smalltalk/X
+Copyright (C) 2012-2013 Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
+!SCMWarning methodsFor:'default actions'!
+
+defaultAction
+    "Default action for warnings: log warning using system logger and
+     show on Transcript (if Transcript is a view)"
+
+    | message |
+
+    message := self description.
+    Logger log: message severity: #warning facility: 'SCM'.
+    Transcript isView ifTrie:[  
+        Transcript show:'[SCM] Warning: '; showCR: message.
+    ].
+    self proceed.
+
+    "Created: / 14-03-2014 / 22:38:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
--- a/common/abbrev.stc	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/abbrev.stc	Fri Mar 14 22:59:53 2014 +0000
@@ -10,9 +10,13 @@
 SCMCommonPackageModelGroup SCMCommonPackageModelGroup stx:libscm/common 'SCM-Common-StX' 0
 SCMCommonSourceCodeManagerUtilities SCMCommonSourceCodeManagerUtilities stx:libscm/common 'SCM-Common-StX' 0
 SCMCompatModeQuery SCMCompatModeQuery stx:libscm/common 'SCM-Common-StX' 1
+SCMError SCMError stx:libscm/common 'SCM-Common-StX-Exceptions' 1
+SCMWarning SCMWarning stx:libscm/common 'SCM-Common-StX-Exceptions' 1
 stx_libscm_common stx_libscm_common stx:libscm/common '* Projects & Packages *' 3
 SCMAbstractCommitDialog SCMAbstractCommitDialog stx:libscm/common 'SCM-Common-StX-Interface' 1
 SCMAbstractFileoutLikeTask SCMAbstractFileoutLikeTask stx:libscm/common 'SCM-Common-StX-Tasks' 0
 SCMAbstractPackageRevision SCMAbstractPackageRevision stx:libscm/common 'SCM-Common-StX' 0
 SCMAbstractPackageWorkingCopy SCMAbstractPackageWorkingCopy stx:libscm/common 'SCM-Common-StX' 0
+SCMPackageModelError SCMPackageModelError stx:libscm/common 'SCM-Common-StX-Exceptions' 1
+SCMPackageModelWarning SCMPackageModelWarning stx:libscm/common 'SCM-Common-StX-Exceptions' 1
 SCMAbstractCommitTask SCMAbstractCommitTask stx:libscm/common 'SCM-Common-StX-Tasks' 0
--- a/common/bc.mak	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/bc.mak	Fri Mar 14 22:59:53 2014 +0000
@@ -85,11 +85,15 @@
 $(OUTDIR)SCMCommonPackageModelGroup.$(O) SCMCommonPackageModelGroup.$(H): SCMCommonPackageModelGroup.st $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)SCMCommonSourceCodeManagerUtilities.$(O) SCMCommonSourceCodeManagerUtilities.$(H): SCMCommonSourceCodeManagerUtilities.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic3\SourceCodeManagerUtilities.$(H) $(STCHDR)
 $(OUTDIR)SCMCompatModeQuery.$(O) SCMCompatModeQuery.$(H): SCMCompatModeQuery.st $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Query.$(H) $(STCHDR)
+$(OUTDIR)SCMError.$(O) SCMError.$(H): SCMError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)SCMWarning.$(O) SCMWarning.$(H): SCMWarning.st $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)stx_libscm_common.$(O) stx_libscm_common.$(H): stx_libscm_common.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractCommitDialog.$(O) SCMAbstractCommitDialog.$(H): SCMAbstractCommitDialog.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractDialog.$(H) $(INCLUDE_TOP)\stx\libview2\ApplicationModel.$(H) $(INCLUDE_TOP)\stx\libview2\Model.$(H) $(INCLUDE_TOP)\stx\libview2\SimpleDialog.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractFileoutLikeTask.$(O) SCMAbstractFileoutLikeTask.$(H): SCMAbstractFileoutLikeTask.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractTask.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractPackageRevision.$(O) SCMAbstractPackageRevision.$(H): SCMAbstractPackageRevision.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractPackageModel.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractPackageWorkingCopy.$(O) SCMAbstractPackageWorkingCopy.$(H): SCMAbstractPackageWorkingCopy.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractPackageModel.$(H) $(STCHDR)
+$(OUTDIR)SCMPackageModelError.$(O) SCMPackageModelError.$(H): SCMPackageModelError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMError.$(H) $(STCHDR)
+$(OUTDIR)SCMPackageModelWarning.$(O) SCMPackageModelWarning.$(H): SCMPackageModelWarning.st $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMWarning.$(H) $(STCHDR)
 $(OUTDIR)SCMAbstractCommitTask.$(O) SCMAbstractCommitTask.$(H): SCMAbstractCommitTask.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractFileoutLikeTask.$(H) $(INCLUDE_TOP)\stx\libscm\common\SCMAbstractTask.$(H) $(STCHDR)
 $(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic3\ChangeSet.$(H) $(STCHDR)
 
--- a/common/common.rc	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/common.rc	Fri Mar 14 22:59:53 2014 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Jan Vrany 2012\0"
       VALUE "ProductName", "Smalltalk/X SCM Support Library\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Sat, 08 Mar 2014 10:24:29 GMT\0"
+      VALUE "ProductDate", "Fri, 14 Mar 2014 10:10:19 GMT\0"
     END
 
   END
--- a/common/libInit.cc	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/libInit.cc	Fri Mar 14 22:59:53 2014 +0000
@@ -36,11 +36,15 @@
 _SCMCommonPackageModelGroup_Init(pass,__pRT__,snd);
 _SCMCommonSourceCodeManagerUtilities_Init(pass,__pRT__,snd);
 _SCMCompatModeQuery_Init(pass,__pRT__,snd);
+_SCMError_Init(pass,__pRT__,snd);
+_SCMWarning_Init(pass,__pRT__,snd);
 _stx_137libscm_137common_Init(pass,__pRT__,snd);
 _SCMAbstractCommitDialog_Init(pass,__pRT__,snd);
 _SCMAbstractFileoutLikeTask_Init(pass,__pRT__,snd);
 _SCMAbstractPackageRevision_Init(pass,__pRT__,snd);
 _SCMAbstractPackageWorkingCopy_Init(pass,__pRT__,snd);
+_SCMPackageModelError_Init(pass,__pRT__,snd);
+_SCMPackageModelWarning_Init(pass,__pRT__,snd);
 _SCMAbstractCommitTask_Init(pass,__pRT__,snd);
 
 _stx_137libscm_137common_extensions_Init(pass,__pRT__,snd);
--- a/common/stx_libscm_common.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/common/stx_libscm_common.st	Fri Mar 14 22:59:53 2014 +0000
@@ -115,6 +115,7 @@
 
     ^ #(
         #'stx:libjava'    "JavaVM - referenced by SCMAbstractFileoutLikeTask>>doRemoveOldContainersFor: "
+        #'stx:libscm/mercurial'    "HGError - referenced by SCMAbstractPackageRevision>>childNamed: "
         #'stx:libtool'    "Tools::ChangeSetDiffTool - referenced by SCMCommonSourceCodeManagerUtilities>>compareProject:withRepositoryVersionFrom: "
         #'stx:libview'    "Color - referenced by SCMAbstractCommitDialog>>browseWorkingCopyLabel "
         #'stx:libwidg'    "Button - referenced by SCMAbstractCommitDialog>>doRunSanityChecks "
@@ -151,11 +152,15 @@
         SCMCommonPackageModelGroup
         SCMCommonSourceCodeManagerUtilities
         SCMCompatModeQuery
+        SCMError
+        SCMWarning
         #'stx_libscm_common'
         SCMAbstractCommitDialog
         SCMAbstractFileoutLikeTask
         SCMAbstractPackageRevision
         SCMAbstractPackageWorkingCopy
+        SCMPackageModelError
+        SCMPackageModelWarning
         SCMAbstractCommitTask
     )
 !
--- a/mercurial/HGInvalidVersionError.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/mercurial/HGInvalidVersionError.st	Fri Mar 14 22:59:53 2014 +0000
@@ -48,3 +48,10 @@
 "
 ! !
 
+!HGInvalidVersionError class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/mercurial/HGPackageRevision.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/mercurial/HGPackageRevision.st	Fri Mar 14 22:59:53 2014 +0000
@@ -83,6 +83,19 @@
     "Created: / 05-03-2014 / 23:45:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!HGPackageRevision methodsFor:'accessing-containers'!
+
+containerFor: aString ifAbsent: aBlock
+    "Return a container as Filename with given name. If there's no such
+     container, evaluates a block"            
+
+    ^ (changesetRoot children includesKey: aString)   
+        ifTrue:[ changesetRoot / aString ]
+        ifFalse:[ aBlock value ]
+
+    "Created: / 14-03-2014 / 22:17:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !HGPackageRevision methodsFor:'accessing-hierarchy'!
 
 children
--- a/mercurial/HGStXTests.st	Sat Mar 08 10:29:38 2014 +0000
+++ b/mercurial/HGStXTests.st	Fri Mar 14 22:59:53 2014 +0000
@@ -2858,6 +2858,185 @@
     self assert: p7n3n2rev isVirtual not.
 
     "Created: / 08-03-2014 / 10:11:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_01
+    | repo p6rev p6cs |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6rev := (repo @ 1) rootPackage.
+    p6cs  := p6rev changeSet.
+
+    self assert: p6cs size == 21.
+
+    "01"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'MocksHGP6Bar' ] ] ).
+    "02"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar' and:[ c selector == #bar ] ] ]).
+    "03"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar' and:[ c selector == #name ] ] ]).
+    "04"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar class' and:[ c selector == #version_HG ] ] ]).
+
+    "05"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'MocksHGP6Foo' ] ] ).
+    "06"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo1 ] ] ]).
+    "07"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo2 ] ] ]).
+    "08"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo3 ] ] ]).
+    "09"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo class' and:[ c selector == #version_HG ] ] ]).
+
+    "10"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'mocks_hg_p6' ] ] ).
+    "11"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #excludedFromPreRequisites ] ] ]).
+    "12"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #mandatoryPreRequisites ] ] ]).
+    "13"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #referencedPreRequisites ] ] ]).
+    "14"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #subProjects ] ] ]).
+    "15"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #classNamesAndAttributes ] ] ]).
+    "16"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #extensionMethodNames ] ] ]).
+    "17"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #description ] ] ]).
+    "18"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #legalCopyright ] ] ]).
+    "19"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #productName ] ] ]).
+    "20"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #version_HG ] ] ]).
+    "21"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #companyName ] ] ]).
+
+    "Created: / 13-03-2014 / 22:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-03-2014 / 21:04:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_02
+    | repo p6rev p6cs |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6rev := (repo @ 5) rootPackage.
+    p6cs  := p6rev changeSet.
+
+    self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'Object' and:[ c selector == #greet ] ] ]).
+
+    "Created: / 14-03-2014 / 21:19:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_03
+    | repo p6hgcs p6rev p6cs |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6hgcs := repo @ 1.
+    "/ Simulate missing abbrev.stc...  
+    p6hgcs root children removeKey: 'abbrev.stc'.
+
+    p6rev := p6hgcs rootPackage.
+    p6cs  := p6rev changeSet.
+
+    self assert: p6cs size == 21.
+
+    "01"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'MocksHGP6Bar' ] ] ).
+    "02"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar' and:[ c selector == #bar ] ] ]).
+    "03"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar' and:[ c selector == #name ] ] ]).
+    "04"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Bar class' and:[ c selector == #version_HG ] ] ]).
+
+    "05"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'MocksHGP6Foo' ] ] ).
+    "06"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo1 ] ] ]).
+    "07"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo2 ] ] ]).
+    "08"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo3 ] ] ]).
+    "09"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo class' and:[ c selector == #version_HG ] ] ]).
+
+    "10"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'mocks_hg_p6' ] ] ).
+    "11"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #excludedFromPreRequisites ] ] ]).
+    "12"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #mandatoryPreRequisites ] ] ]).
+    "13"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #referencedPreRequisites ] ] ]).
+    "14"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #subProjects ] ] ]).
+    "15"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #classNamesAndAttributes ] ] ]).
+    "16"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #extensionMethodNames ] ] ]).
+    "17"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #description ] ] ]).
+    "18"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #legalCopyright ] ] ]).
+    "19"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #productName ] ] ]).
+    "20"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #version_HG ] ] ]).
+    "21"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #companyName ] ] ]).
+
+    "Created: / 14-03-2014 / 21:46:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_04
+    | repo p6hgcs p6rev p6cs warnings |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6hgcs := repo @ 1.
+    "/ Simulate missing class (listed in classNamesAndAttributes)
+    p6hgcs root children removeKey: 'MocksHGP6Bar.st'.
+
+    p6rev := p6hgcs rootPackage.
+    warnings := OrderedCollection new.
+    [
+        p6cs := p6rev changeSet.
+    ] on: SCMWarning do:[:ex |
+        warnings add: ex.
+        ex proceed.
+    ].
+
+    self assert: p6cs size == 17.
+    self assert: warnings size == 1.
+
+    "05"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'MocksHGP6Foo' ] ] ).
+    "06"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo1 ] ] ]).
+    "07"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo2 ] ] ]).
+    "08"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo' and:[ c selector == #foo3 ] ] ]).
+    "09"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'MocksHGP6Foo class' and:[ c selector == #version_HG ] ] ]).
+
+    "10"self assert: (p6cs contains:[:c | c isClassDefinitionChange and:[ c className = 'mocks_hg_p6' ] ] ).
+    "11"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #excludedFromPreRequisites ] ] ]).
+    "12"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #mandatoryPreRequisites ] ] ]).
+    "13"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #referencedPreRequisites ] ] ]).
+    "14"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #subProjects ] ] ]).
+    "15"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #classNamesAndAttributes ] ] ]).
+    "16"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #extensionMethodNames ] ] ]).
+    "17"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #description ] ] ]).
+    "18"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #legalCopyright ] ] ]).
+    "19"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #productName ] ] ]).
+    "20"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #version_HG ] ] ]).
+    "21"self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'mocks_hg_p6 class' and:[ c selector == #companyName ] ] ]).
+
+    "Created: / 14-03-2014 / 22:39:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_05
+    | repo p6hgcs p6rev p6cs warnings |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6hgcs := repo @ 5.
+    "/ Simulate missing extensions.st
+    p6hgcs root children removeKey: 'extensions.st'.
+
+    p6rev := p6hgcs rootPackage.
+    warnings := OrderedCollection new.
+    [
+        p6cs := p6rev changeSet.
+    ] on: SCMWarning do:[:ex |
+        warnings add: ex.
+        ex proceed.
+    ].
+
+    self assert: warnings size == 1.
+
+    self deny: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'Object' and:[ c selector == #greet ] ] ]).
+
+    "Created: / 14-03-2014 / 22:51:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_packagerev_changeset_06
+    | repo p6hgcs p6rev p6cs warnings |
+
+    repo := self repositoryNamed: 'mocks/hg/p6'.
+    p6hgcs := repo @ 5.
+    "/ Simulate empty extensionMethodNames but non-empty extensions.st
+    p6hgcs rootPackage definition extensionMethodNames: nil.  
+
+    p6rev := p6hgcs rootPackage.
+    warnings := OrderedCollection new.
+    [
+        p6cs := p6rev changeSet.
+    ] on: SCMWarning do:[:ex |
+        warnings add: ex.
+        ex proceed.
+    ].
+
+    self assert: warnings size == 1.
+
+    self assert: (p6cs contains:[:c | c isMethodCodeChange and:[ c className = 'Object' and:[ c selector == #greet ] ] ]).
+
+    "Created: / 14-03-2014 / 22:53:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGStXTests methodsFor:'utilities'!
--- a/mercurial/mercurial.rc	Sat Mar 08 10:29:38 2014 +0000
+++ b/mercurial/mercurial.rc	Fri Mar 14 22:59:53 2014 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Jan Vrany 2012\0"
       VALUE "ProductName", "Smalltalk/X Mercurial Integration\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Sat, 08 Mar 2014 10:24:27 GMT\0"
+      VALUE "ProductDate", "Fri, 14 Mar 2014 22:56:04 GMT\0"
     END
 
   END