mercurial/HGStXTests.st
changeset 174 0d293012a897
parent 156 725d8bc65e48
child 176 78124cee58da
--- a/mercurial/HGStXTests.st	Sat Jan 12 14:10:22 2013 +0000
+++ b/mercurial/HGStXTests.st	Mon Jan 14 13:56:09 2013 +0000
@@ -599,6 +599,35 @@
     "
 
     "Created: / 10-12-2012 / 03:28:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_commit_07
+    "
+        Tests commit to an empty repository
+    "
+
+    | repo cls pm ct |
+
+    repo := self repositoryNamed: 'mocks/hg/p4_empty' unpack: false.
+    self dumpRepositoryLog: repo. 
+
+    cls := Object subclass:#MockHGP4_EmptyFoo instanceVariableNames:'' classVariableNames:'' poolDictionaries:''.
+    cls package: #'mocks:hg/p4_empty'.
+    (cls compile:'zork ^ 1' classified:'test') package: #'mocks:hg/p4_empty'.
+
+    pm := HGPackageModel named: #'mocks:hg/p4_empty'.
+    ct := pm commitTask.
+    ct message:'test_commit_07'.
+    ct do.
+    self dumpRepositoryLog: repo. 
+
+    "
+        repo workingCopy browse
+    "
+    self assert: ((repo @ 0 / 'MockHGP4_EmptyFoo.st') contents asString includesString:'zork ^ 1').
+    self assert: (Smalltalk at:#mocks_hg_p4_empty) hgLogicalRevision revno = 0.
+
+    "Created: / 14-01-2013 / 13:20:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGStXTests methodsFor:'tests - manager API'!