mercurial/HGStXTests.st
changeset 548 cfbdb28f0fc7
parent 516 dad7345b8c70
child 549 50ead1eda69b
child 550 c5e8328a47f0
--- a/mercurial/HGStXTests.st	Wed Jun 03 08:32:13 2015 +0100
+++ b/mercurial/HGStXTests.st	Thu Jun 11 07:56:26 2015 +0100
@@ -1999,6 +1999,77 @@
     self assert: (repo @ 2 / '.hgignore') notNil.
 
     "Created: / 20-01-2015 / 08:01:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_26a
+    "
+    Test commit to a fresh repository
+    "
+
+    | repo pm ct |
+
+    repo := self repositoryNamed: 'mocks/hg/pfresh' init: true.
+
+    Object subclass: #MockHGPFreshFoo
+        instanceVariableNames: ''
+        classVariableNames: ''
+        poolDictionaries: ''
+        category: '* Mocks *'.
+
+    (Smalltalk at: #MockHGPFreshFoo) package: #'mocks/hg/pfresh'.
+
+    pm := HGPackageWorkingCopy named: 'mocks/hg/pfresh'.
+    ct := pm commitTask.
+    self assert: ct isCommitingNewHead not.
+    ct message:'test_commit_26a'.
+    ct do.
+    self dumpRepositoryLog: repo.
+
+    "
+        repo workingCopy browse
+    "
+    self assert: (repo @ 0 / 'MockHGPFreshFoo.st') notNil.
+    self assert: (repo @ 0 / 'mocks_hg_pfresh.st') notNil.
+    self assert: (repo @ 0 / 'Make.proto') notNil.
+    self assert: ((Smalltalk at: #'mocks_hg_pfresh') classNames includes: #MockHGPFreshFoo)
+
+    "Created: / 11-06-2015 / 06:26:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_26b
+    "
+    Test selective commit to a fresh repository
+    "
+
+    | repo pm ct |
+
+    repo := self repositoryNamed: 'mocks/hg/pfresh' init: true.
+
+    Object subclass: #MockHGPFreshFoo
+        instanceVariableNames: ''
+        classVariableNames: ''
+        poolDictionaries: ''
+        category: '* Mocks *'.
+
+    (Smalltalk at: #MockHGPFreshFoo) package: #'mocks/hg/pfresh'.
+
+    pm := HGPackageWorkingCopy named: 'mocks/hg/pfresh'.
+    ct := pm commitTask.
+    self assert: ct isCommitingNewHead not.
+    ct message:'test_commit_26b'.
+    ct classes: (Array with: (Smalltalk at: #MockHGPFreshFoo)).                      
+    ct do.
+    self dumpRepositoryLog: repo.
+
+    "
+        repo workingCopy browse
+    "
+    self assert: (repo @ 0 / 'MockHGPFreshFoo.st') notNil.
+    self assert: (repo @ 0 / 'mocks_hg_pfresh.st') notNil.
+    self assert: (repo @ 0 / 'Make.proto') notNil.
+    self assert: ((Smalltalk at: #'mocks_hg_pfresh') classNames includes: #MockHGPFreshFoo)
+
+    "Created: / 11-06-2015 / 06:29:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGStXTests methodsFor:'tests - commit - java'!