Fixes for Mecruial 4.4: fixed test `#test_commit_28` & `#test_commit_08a`
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 01 Jan 2018 20:27:19 +0000
changeset 805 b890f24db9f0
parent 804 e73451884939
child 807 ef00a1303f73
Fixes for Mecruial 4.4: fixed test `#test_commit_28` & `#test_commit_08a` ...that hard-coded changeset sevirion mumbers. This broke on 4.4 as it apprarently usises different scheme for amending changesets (while preserving the semantics, indeed). The new test does not hardcode the changeset revnos but rather queries the `tip` revison.
mercurial/HGStXTests.st
mercurial/HGTests.st
--- a/mercurial/HGStXTests.st	Sat Dec 30 09:17:25 2017 +0000
+++ b/mercurial/HGStXTests.st	Mon Jan 01 20:27:19 2018 +0000
@@ -2167,7 +2167,7 @@
     Simple commit amending
     "
 
-    | repo pm ct |
+    | repo pm ct tip |
 
     UserPreferences current hgUseSharedRepositories: true. 
 
@@ -2198,7 +2198,7 @@
     ((Smalltalk at:#MockHGP1Bar) compile:'zork ^ 2' classified:'test') package: (Smalltalk at:#MockHGP1Bar) package.
     ct := pm commitTask.
     self assert: ct isCommitingNewHead not.
-    ct message:'test_commit_28'.
+    ct message:'test_commit_28 (amended)'.
     ct amend: true.
     ct do.
     self dumpRepositoryLog: repo.
@@ -2206,17 +2206,13 @@
     "
     repo workingCopy browse
     "
-    repo hasExtensionEvolve ifFalse:[
-        self assert: ((repo @ 2 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 2').
-        self assert: (Smalltalk at:#mocks_hg_p1) hgLogicalRevision revno = 2.
-    ] ifTrue:[ 
-        self assert: ((repo @ 4 / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 2').
-        self assert: (Smalltalk at:#mocks_hg_p1) hgLogicalRevision revno = 4.
-
-    ].
+    tip := (repo changesetsMatching:'tip') anElement.
+
+    self assert: ((tip / 'MockHGP1Bar.st') contents asString includesString:'zork ^ 2').
+    self assert: (Smalltalk at:#mocks_hg_p1) hgLogicalRevision revno = tip id revno.
 
     "Created: / 25-08-2015 / 16:16:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 12-05-2016 / 00:37:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-01-2018 / 20:18:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 test_commit_29
--- a/mercurial/HGTests.st	Sat Dec 30 09:17:25 2017 +0000
+++ b/mercurial/HGTests.st	Mon Jan 01 20:27:19 2018 +0000
@@ -1103,7 +1103,7 @@
     Test amending    
     "
 
-    | repo wc heads |
+    | repo wc heads tip |
 
     repo := self repositoryNamed:'test_repo_01'.
     wc := repo workingCopy.
@@ -1121,30 +1121,17 @@
 
     wc commit:'test_commit_02 commit 2' files: nil author: nil amend: true.
 
-    repo hasExtensionEvolve ifFalse:[ 
-        self assert: wc changeset id revno == 5 .
-    ] ifTrue:[ 
-        self assert: wc changeset id revno == 7 .
-    ].
+    tip := (repo changesetsMatching:'tip') anElement.     
+    self assert: wc changeset id revno == tip id revno .
     self assert: wc changeset parent1 id revno == 4 .
 
 
-
-
-
-
-
-
-
-
-
-
      "
      UserPreferences fileBrowserClass openOn: repo directory.
     "
 
     "Created: / 25-08-2015 / 16:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 12-05-2016 / 00:39:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-01-2018 / 20:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGTests methodsFor:'tests - mercurial'!