# HG changeset patch # User Anton Shestakov <av6@dwimlabs.net> # Date 1637245760 -10800 # Thu Nov 18 17:29:20 2021 +0300 # Node ID c1094cce56ed8102e52e62fb21b491ad2ce95aea # Parent 9198f447ecae9877133fb5756a3d58fdc713be86 tests: avoid case-folding issue in test-evolve-inmemory.t on windows When using debugdrawdag, each commit already creates a file with the same name as the commit description, i.e. changeset C creates file C with 'C' in it (no newline). Creating another file called c breaks this test on windows. So let's reuse the files already created by debugdrawdag. hg update reports one less file because now there's only C in C (yes, I also wanted to change commit descriptions, file names and their contents to be less ambiguous, but decided to be lazy). diff --git a/tests/test-evolve-inmemory.t b/tests/test-evolve-inmemory.t --- a/tests/test-evolve-inmemory.t +++ b/tests/test-evolve-inmemory.t @@ -17,9 +17,9 @@ $ hg init single-orphan $ cd single-orphan $ hg debugdrawdag <<'EOS' - > C # C/c = c\n - > B2 | # B2/b = b2\n - > | B # B/b = b\n + > C # C/C = C\n + > B2 | # B2/B = B2\n + > | B # B/B = B\n > \ / # replace: B -> B2 > A > EOS @@ -28,19 +28,19 @@ move:[3] C atop:[2] B2 $ hg glog - o 4:52da76e91abb draft tip + o 4:a2a0434af50b draft tip | C - | x 3:bc77848cde3a draft C + | x 3:46f17045c5ee draft C | | C - o | 2:377a194b9b8a draft B2 + o | 2:3d6c495db414 draft B2 | | B2 - | x 1:830b6315076c draft B + | x 1:caf23a7900cb draft B |/ B o 0:426bada5c675 draft A A - $ hg cat -r tip b c - b2 - c + $ hg cat -r tip B C + B2 + C $ cd .. Test that in-memory evolve works when there are conflicts @@ -49,13 +49,13 @@ $ hg init conflicts $ cd conflicts $ hg debugdrawdag <<'EOS' - > E # E/e = e\n + > E # E/E = E\n > | - > D # D/b = d\n + > D # D/B = D\n > | - > C # C/c = c\n - > B2 | # B2/b = b2\n - > | B # B/b = b\n + > C # C/C = C\n + > B2 | # B2/B = B2\n + > | B # B/B = B\n > \ / # replace: B -> B2 > A > EOS @@ -64,67 +64,67 @@ move:[3] C atop:[2] B2 move:[4] D - merging b + merging B hit merge conflicts; retrying merge in working copy - merging b - warning: conflicts while merging b! (edit, then use 'hg resolve --mark') + merging B + warning: conflicts while merging B! (edit, then use 'hg resolve --mark') unresolved merge conflicts (see 'hg help evolve.interrupted') [240] $ hg glog - @ 6:52da76e91abb draft tip + @ 6:a2a0434af50b draft tip | C - | * 5:eae7899dd92b draft E + | * 5:844900596917 draft E | | E - | % 4:57e51f6a6d36 draft D + | % 4:a75d38413966 draft D | | D - | x 3:bc77848cde3a draft C + | x 3:46f17045c5ee draft C | | C - o | 2:377a194b9b8a draft B2 + o | 2:3d6c495db414 draft B2 | | B2 - | x 1:830b6315076c draft B + | x 1:caf23a7900cb draft B |/ B o 0:426bada5c675 draft A A - $ cat c - c - $ cat b - <<<<<<< destination: 52da76e91abb - test: C - b2 + $ cat C + C + $ cat B + <<<<<<< destination: a2a0434af50b - test: C + B2 ======= - d - >>>>>>> evolving: 57e51f6a6d36 D - test: D - $ echo d2 > b + D + >>>>>>> evolving: a75d38413966 D - test: D + $ echo D2 > B $ hg resolve -m (no more unresolved files) continue: hg evolve --continue $ hg evolve --continue - evolving 4:57e51f6a6d36 "D" + evolving 4:a75d38413966 "D" move:[5] E atop:[7] D $ hg glog - o 8:3c658574f8ed draft tip + o 8:166afca01be8 draft tip | E - o 7:16e609b952e8 draft + o 7:4f84a36487e4 draft | D - o 6:52da76e91abb draft + o 6:a2a0434af50b draft | C - | x 5:eae7899dd92b draft E + | x 5:844900596917 draft E | | E - | x 4:57e51f6a6d36 draft D + | x 4:a75d38413966 draft D | | D - | x 3:bc77848cde3a draft C + | x 3:46f17045c5ee draft C | | C - o | 2:377a194b9b8a draft B2 + o | 2:3d6c495db414 draft B2 | | B2 - | x 1:830b6315076c draft B + | x 1:caf23a7900cb draft B |/ B o 0:426bada5c675 draft A A - $ hg cat -r tip b c e - d2 - c - e + $ hg cat -r tip B C E + D2 + C + E $ cd .. Test that in-memory merge is disabled if there's a precommit hook @@ -132,9 +132,9 @@ $ hg init precommit-hook $ cd precommit-hook $ hg debugdrawdag <<'EOS' - > C # C/c = c\n - > B2 | # B2/b = b2\n - > | B # B/b = b\n + > C # C/C = C\n + > B2 | # B2/B = B2\n + > | B # B/B = B\n > \ / # replace: B -> B2 > A > EOS @@ -149,20 +149,20 @@ $ hg evolve --config experimental.evolution.in-memory=force --update move:[3] C atop:[2] B2 - working directory is now at 52da76e91abb + working directory is now at a2a0434af50b $ hg glog - @ 4:52da76e91abb draft tip + @ 4:a2a0434af50b draft tip | C - | x 3:bc77848cde3a draft C + | x 3:46f17045c5ee draft C | | C - o | 2:377a194b9b8a draft B2 + o | 2:3d6c495db414 draft B2 | | B2 - | x 1:830b6315076c draft B + | x 1:caf23a7900cb draft B |/ B o 0:426bada5c675 draft A A $ hg co tip^ - 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg amend -m B3 1 new orphan changesets The hook is run with in-memory=yes @@ -170,17 +170,17 @@ move:[4] C atop:[5] B3 running precommit hook - working directory is now at aeee7323c054 + working directory is now at 24f38f1ca271 $ hg glog - @ 6:aeee7323c054 draft tip + @ 6:24f38f1ca271 draft tip | C - o 5:908ce5f9d7eb draft + o 5:b43c30321752 draft | B3 - | x 3:bc77848cde3a draft C + | x 3:46f17045c5ee draft C | | C - +---x 2:377a194b9b8a draft B2 + +---x 2:3d6c495db414 draft B2 | | B2 - | x 1:830b6315076c draft B + | x 1:caf23a7900cb draft B |/ B o 0:426bada5c675 draft A A # HG changeset patch # User Anton Shestakov <av6@dwimlabs.net> # Date 1637246178 -10800 # Thu Nov 18 17:36:18 2021 +0300 # Node ID 85a16667f19b5aa4206be54ef276361aa884853f # Parent c1094cce56ed8102e52e62fb21b491ad2ce95aea tests: move a windows message up, to where it appears on heptapod ci I'm assuming something changed since fd2d61769bd0 and this line appears at the new place, but if it goes back to the old place we'll need to duplicate it. diff --git a/tests/test-evolve-progress.t b/tests/test-evolve-progress.t --- a/tests/test-evolve-progress.t +++ b/tests/test-evolve-progress.t @@ -122,8 +122,8 @@ resolving manifests branchmerge: True, force: True, partial: False ancestor: 152c368c622b, local: f8d7d38c0a88+, remote: df5d742141b0 + starting 4 threads for background file closing (?) preserving a for resolve of a - starting 4 threads for background file closing (?) a: versions differ -> m (premerge) updating: a 1/1 files (100.00%) picked tool ':merge' for a (binary False symlink False changedelete False) # HG changeset patch # User Anton Shestakov <av6@dwimlabs.net> # Date 1637781825 -10800 # Wed Nov 24 22:23:45 2021 +0300 # Node ID cf2b582c1764cca4d3a1287ba8678b740c84f70b # Parent 85a16667f19b5aa4206be54ef276361aa884853f tests: run echo through sh -c, to make output the same on windows Otherwise it outputs "running precommit hook"\r (note the quote signs). diff --git a/tests/test-evolve-inmemory.t b/tests/test-evolve-inmemory.t --- a/tests/test-evolve-inmemory.t +++ b/tests/test-evolve-inmemory.t @@ -141,7 +141,7 @@ 1 new orphan changesets $ cat >> .hg/hgrc <<EOF > [hooks] - > precommit = echo "running precommit hook" + > precommit = sh -c "echo 'running precommit hook'" > EOF The hook is not run with in-memory=force $ hg co B2 # HG changeset patch # User Anton Shestakov <av6@dwimlabs.net> # Date 1637246448 -10800 # Thu Nov 18 17:40:48 2021 +0300 # Node ID ff19717f985efccf081ffe82e2d2f7a8d2c6029d # Parent cf2b582c1764cca4d3a1287ba8678b740c84f70b ci: add windows-py3 tests diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -93,3 +93,29 @@ - dist/* only: - tags + +.windows_runtests_template: &windows_runtests + before_script: + - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.t > C:/Temp/check-tests.txt' + script: + - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && contrib/update-hg-repo.sh C:/Temp/hg' + - > + C:/MinGW/msys/1.0/bin/sh.exe --login -c ' + cd "$OLDPWD" && + evo_branch=$(hg identify --branch) && + hg_branch=${HG_BRANCH:-$(tests/testlib/map-hg-rev.sh "$evo_branch")} && + hg -R C:/Temp/hg update "$hg_branch" && + hg_rev=$(hg log -R C:/Temp/hg -r . -T "\{node\}") && + echo testing with mercurial branch="$hg_branch", revision="$hg_rev"' + - Invoke-Expression "$Env:PYTHON --version" + - echo "$Env:RUNTEST_ARGS" + - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && HGMODULEPOLICY="$TEST_HGMODULEPOLICY" $PYTHON C:/Temp/hg/tests/run-tests.py --color=always $RUNTEST_ARGS' + +windows-py3: + <<: *windows_runtests + tags: + - windows + variables: + PYTHON: py -3 + RUNTEST_ARGS: "--blacklist C:/Temp/check-tests.txt" + TEST_HGMODULEPOLICY: "c" diff --git a/contrib/update-hg-repo.sh b/contrib/update-hg-repo.sh new file mode 100755 --- /dev/null +++ b/contrib/update-hg-repo.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if hg root -R "$1"; then + hg pull -R "$1" +else + rm -rf "$1" + hg clone https://mirror.octobus.net/hg "$1" +fi