mercurial/HGStXTests.st
changeset 812 10b0181c33fb
parent 809 1bbcf42198c6
child 814 f082e56d6ff7
equal deleted inserted replaced
810:c04f9722d89f 812:10b0181c33fb
  2324 
  2324 
  2325     UserPreferences current hgUseSharedRepositories: true.       
  2325     UserPreferences current hgUseSharedRepositories: true.       
  2326 
  2326 
  2327     "/ 1. load package
  2327     "/ 1. load package
  2328     repo := self repositoryNamed: 'mocks/hg/p1'.
  2328     repo := self repositoryNamed: 'mocks/hg/p1'.
       
  2329     self skipIf: repo hasExtensionEvolve not description: 'No evolve extension'.
       
  2330 
  2329     self assert: (Smalltalk loadPackage:'mocks:hg/p1').
  2331     self assert: (Smalltalk loadPackage:'mocks:hg/p1').
  2330     self dumpRepositoryLog: repo.
  2332     self dumpRepositoryLog: repo.
  2331     self deny:   ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1').
  2333     self deny:   ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1').
  2332 
  2334 
  2333     "/ 2. modify and commit normally (using HGCommitTask)
  2335     "/ 2. modify and commit normally (using HGCommitTask)
  2347     wc := pm temporaryWorkingCopy.
  2349     wc := pm temporaryWorkingCopy.
  2348     self assert: wc changeset id = (repo @ 2) id.
  2350     self assert: wc changeset id = (repo @ 2) id.
  2349     ( wc / 'notes.txt' ) writingFileDo:[:s | s nextPutAll:'some notes' ].
  2351     ( wc / 'notes.txt' ) writingFileDo:[:s | s nextPutAll:'some notes' ].
  2350     wc track: (Array with:( wc / 'notes.txt' )).
  2352     wc track: (Array with:( wc / 'notes.txt' )).
  2351     wc commit: testSelector , '-3' files: #('notes.txt') author: testSelector amend: true.
  2353     wc commit: testSelector , '-3' files: #('notes.txt') author: testSelector amend: true.
  2352     self assert: wc changeset id = (repo @ 3) id.
  2354     self dumpRepositoryLog: repo.     
       
  2355     self assert: wc changeset id = (repo changesetsMatching: 'tip') first id.
  2353 
  2356 
  2354     "/ 4. modify and commit normally again
  2357     "/ 4. modify and commit normally again
  2355     ((Smalltalk at:#MockHGP1Bar) compile:'zork ^ 100' classified:'test') package: (Smalltalk at:#MockHGP1Bar) package.
  2358     ((Smalltalk at:#MockHGP1Bar) compile:'zork ^ 100' classified:'test') package: (Smalltalk at:#MockHGP1Bar) package.
  2356     pm := HGPackageWorkingCopy named: 'mocks:hg/p1'.
  2359     pm := HGPackageWorkingCopy named: 'mocks:hg/p1'.
  2357     ct := pm commitTask.
  2360     ct := pm commitTask.
  2365     self should: [ ct do ] raise: HGObsoleteRevisionError.
  2368     self should: [ ct do ] raise: HGObsoleteRevisionError.
  2366 
  2369 
  2367     "/ update the logical revision and try again.
  2370     "/ update the logical revision and try again.
  2368     ct doUpdateLogicalRevisionTo: ct changesetSuccessors anElement id.
  2371     ct doUpdateLogicalRevisionTo: ct changesetSuccessors anElement id.
  2369     ct do.
  2372     ct do.
  2370     self assert: wc changeset id = (repo @ 4) id.
  2373     self assert: wc changeset id = (repo changesetsMatching: 'tip') first id.
  2371 
  2374 
  2372     "Created: / 07-02-2018 / 22:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2375     "Created: / 07-02-2018 / 22:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2373     "Modified: / 08-02-2018 / 22:18:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2376     "Modified: / 22-03-2018 / 22:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2377     "Modified: / 06-03-2018 / 11:48:11 / jv"
       
  2378 !
       
  2379 
       
  2380 test_commit_31b
       
  2381     "
       
  2382     Test that the HGCommitTask >> #changesetSuccessors returns
       
  2383     an empty set in case evolve extension is not enabled.
       
  2384     "
       
  2385 
       
  2386     | repo pm ct |
       
  2387 
       
  2388     UserPreferences current hgUseSharedRepositories: true.       
       
  2389 
       
  2390     "/ 1. load package
       
  2391     repo := self repositoryNamed: 'mocks/hg/p1'.
       
  2392     self skipIf: repo hasExtensionEvolve description: 'evolve extension enabled'.
       
  2393 
       
  2394     self assert: (Smalltalk loadPackage:'mocks:hg/p1').
       
  2395     self dumpRepositoryLog: repo.
       
  2396     self deny:   ((repo @ 1 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1').
       
  2397 
       
  2398     "/ 2. modify and commit normally (using HGCommitTask)
       
  2399     ((Smalltalk at:#MockHGP1Bar) compile:'zork ^ 1' classified:'test') package: (Smalltalk at:#MockHGP1Bar) package.
       
  2400     pm := HGPackageWorkingCopy named: 'mocks:hg/p1'.
       
  2401     ct := pm commitTask.
       
  2402     self assert: ct isPackageLogicalRevisonObsolete not.
       
  2403     self assert: ct changesetSuccessors isEmpty.
       
  2404     ct message: testSelector , '-2'.
       
  2405     ct do.
       
  2406     self dumpRepositoryLog: repo.
       
  2407 
       
  2408     self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 1').
       
  2409     self assert: (Smalltalk at:#mocks_hg_p1) hgLogicalRevision revno = 2.
       
  2410 
       
  2411     "Created: / 22-03-2018 / 22:49:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2374 !
  2412 !
  2375 
  2413 
  2376 test_commit_issue63
  2414 test_commit_issue63
  2377     "
  2415     "
  2378     Issue #63: Windowns specific classes are lost when build files are generated under Unix
  2416     Issue #63: Windowns specific classes are lost when build files are generated under Unix