mercurial/HGTests.st
changeset 107 c92f7674485e
parent 106 99be3b5a40da
child 115 b1ed2d29054b
equal deleted inserted replaced
106:99be3b5a40da 107:c92f7674485e
   246     self assert: cs parent2 id revno = 4.
   246     self assert: cs parent2 id revno = 4.
   247 
   247 
   248     "Created: / 27-11-2012 / 20:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   248     "Created: / 27-11-2012 / 20:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   249 ! !
   249 ! !
   250 
   250 
       
   251 !HGTests methodsFor:'tests - commit'!
       
   252 
       
   253 test_commit_02
       
   254     "
       
   255                     base    (r4)
       
   256         1) modify & commit  (r5)
       
   257         2) update wc to r4
       
   258         3) modifty & commit (r6)
       
   259 
       
   260         check:  i) before 1) only one head r4
       
   261                 ii) after 3) two heads r5, r6, both with parent r4
       
   262             
       
   263     "
       
   264 
       
   265     | repo wc heads |
       
   266 
       
   267     repo := self repositoryNamed:'test_repo_01'.
       
   268     wc := repo workingCopy. 
       
   269     heads := wc heads.
       
   270     self assert: wc changeset id revno == 4.
       
   271     self assert: heads size == 1.
       
   272     self assert: heads anElement id revno = 4.
       
   273     ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_02 1'. ].
       
   274     wc commit:'test_commit_02 commit 1'.
       
   275 
       
   276     wc update: 4.
       
   277 
       
   278     self assert: wc changeset id revno == 4.
       
   279     ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_02 2'. ].
       
   280 
       
   281     wc commit:'test_commit_02 commit 2'.
       
   282 
       
   283     heads := wc heads.
       
   284     self assert: heads size == 2.
       
   285     self assert: heads first parent1 == (repo @ 4).
       
   286     self assert: heads second parent1 == (repo @ 4).
       
   287 
       
   288 
       
   289 
       
   290 
       
   291 
       
   292 
       
   293 
       
   294 
       
   295 
       
   296 
       
   297      "
       
   298      UserPreferences fileBrowserClass openOn: repo directory.
       
   299     "
       
   300 
       
   301     "Created: / 27-11-2012 / 10:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   302     "Modified: / 27-11-2012 / 21:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   303 ! !
       
   304 
   251 !HGTests methodsFor:'tests - heads'!
   305 !HGTests methodsFor:'tests - heads'!
   252 
   306 
   253 test_heads_01
   307 test_heads_01
   254     "
   308     "
   255     Test listing repository heads
   309     Test listing repository heads