vcssync: require Mercurial 4.0+ to run hg related tests (
bug 1333616); r?glob
We wrote this code with 4.0 in mind. The tests mostly pass on 3.8
and 3.9. But I don't want to give the illusion of support. So let's
explicitly require Mercurial 4.0+ to run all Mercurial related
vcssync tests.
MozReview-Commit-ID: Jaxa8zl0xAb
--- a/vcssync/tests/test-linearize-git-to-hg-arg-errors.t
+++ b/vcssync/tests/test-linearize-git-to-hg-arg-errors.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
Git source URL does not exist
$ linearize-git-to-hg file://$TESTTMP/does/not/exist master dummy dummy
Initialized empty Git repository in $TESTTMP/dummy/
fatal: '$TESTTMP/does/not/exist' does not appear to be a git repository
--- a/vcssync/tests/test-linearize-git-to-hg-basic.t
+++ b/vcssync/tests/test-linearize-git-to-hg-basic.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
$ git --git-dir grepo/.git log --graph --format=oneline
* a447b9b0ff25bf17daab1c7edae4a998eca0adac dummy commit 1 after merge
* fc30a4fbd1fe16d4c84ca50119e0c404c13967a3 Merge branch 'head2'
|\
--- a/vcssync/tests/test-linearize-git-to-hg-copy-metadata.t
+++ b/vcssync/tests/test-linearize-git-to-hg-copy-metadata.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ cat >> $HGRCPATH << EOF
> [diff]
> git = true
> EOF
$ standardgitrepo grepo > /dev/null 2>&1
--- a/vcssync/tests/test-linearize-git-to-hg-move-to-subdir.t
+++ b/vcssync/tests/test-linearize-git-to-hg-move-to-subdir.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
--move-to-subdir will move files in git repo to subdirectory in hg
$ linearize-git-to-hg --move-to-subdir subdir file://$TESTTMP/grepo master grepo-source grepo-dest-0 > /dev/null 2>&1
$ hg --cwd grepo-dest-0 files -r tip
--- a/vcssync/tests/test-linearize-git-to-hg-push-git.t
+++ b/vcssync/tests/test-linearize-git-to-hg-push-git.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
$ git init --bare grepo-mirror
Initialized empty Git repository in $TESTTMP/grepo-mirror/
--git-push-url will mirror the local Git repo to a remote after changes
--- a/vcssync/tests/test-linearize-git-to-hg-push-hg.t
+++ b/vcssync/tests/test-linearize-git-to-hg-push-hg.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
$ hg init hg-mirror
--hg-push-url will push the hg repo to the specified after linearizing
--- a/vcssync/tests/test-linearize-git-to-hg-source-annotations.t
+++ b/vcssync/tests/test-linearize-git-to-hg-source-annotations.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardgitrepo grepo > /dev/null 2>&1
Note: since source repo is in $TESTTMP which is dynamic, commit SHA-1s aren't stable!
$ linearize-git-to-hg --source-repo-key Source-Repo --source-revision-key Source-Revision file://$TESTTMP/grepo master grepo-source grepo-dest
Initialized empty Git repository in $TESTTMP/grepo-source/
From file://$TESTTMP/grepo
--- a/vcssync/tests/test-overlay-hg-basic.t
+++ b/vcssync/tests/test-overlay-hg-basic.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir
repo does not exist; cloning http://localhost:$HGPORT/overlay-dest
requesting all changes
adding changesets
--- a/vcssync/tests/test-overlay-hg-clone-missing.t
+++ b/vcssync/tests/test-overlay-hg-clone-missing.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
Local clone will be created if necessary
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> local_path --into subdir
local_path does not exist; cloning http://localhost:$HGPORT/overlay-dest
--- a/vcssync/tests/test-overlay-hg-dest-mismatch.t
+++ b/vcssync/tests/test-overlay-hg-dest-mismatch.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into destdir > /dev/null 2>&1
$ hg -R repo push
pushing to http://localhost:$HGPORT/overlay-dest
--- a/vcssync/tests/test-overlay-hg-new-both.t
+++ b/vcssync/tests/test-overlay-hg-new-both.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir > /dev/null 2>&1
$ hg -R repo push
pushing to http://localhost:$HGPORT/overlay-dest
--- a/vcssync/tests/test-overlay-hg-new-dest.t
+++ b/vcssync/tests/test-overlay-hg-new-dest.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir > /dev/null 2>&1
New changeset in dest will be pulled and overlay will reperformed on it
--- a/vcssync/tests/test-overlay-hg-new-source.t
+++ b/vcssync/tests/test-overlay-hg-new-source.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir > /dev/null 2>&1
$ hg -R repo push
pushing to http://localhost:$HGPORT/overlay-dest
--- a/vcssync/tests/test-overlay-hg-push-fail.t
+++ b/vcssync/tests/test-overlay-hg-push-fail.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir >/dev/null 2>&1
Create a server-side hook that fails the push to simulate a failure
--- a/vcssync/tests/test-overlay-hg-push-lingering.t
+++ b/vcssync/tests/test-overlay-hg-push-lingering.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
Leave overlayed changesets in local repo then attempt to push in a later
invocation. This simulates failure to push on a previous run.
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir >/dev/null 2>&1
--- a/vcssync/tests/test-overlay-hg-push-race.t
+++ b/vcssync/tests/test-overlay-hg-push-race.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir >/dev/null 2>&1
Create a new dest-like repo and add a changeset to it.
This simulates losing a push race to another client.
--- a/vcssync/tests/test-overlay-hg-push-result.t
+++ b/vcssync/tests/test-overlay-hg-push-result.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
--result-push-url will push results after overlay
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir --result-push-url http://localhost:$HGPORT/overlay-dest
repo does not exist; cloning http://localhost:$HGPORT/overlay-dest
--- a/vcssync/tests/test-overlay-hg-push-unicode.t
+++ b/vcssync/tests/test-overlay-hg-push-unicode.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
Test unicode in commit descriptions
$ cd server/overlay-source
$ echo 1 > file2
$ hg commit --encoding utf-8 -A -m 'add file2 with unicode ใในใ'
--- a/vcssync/tests/test-overlay-hg-strip.t
+++ b/vcssync/tests/test-overlay-hg-strip.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
Seed local clone
$ overlay-hg-repos http://localhost:$HGPORT/overlay-source http://localhost:$HGPORT/overlay-dest \
> repo --into subdir > /dev/null 2>&1
--- a/vcssync/tests/test-servo-overlay-treestatus.t
+++ b/vcssync/tests/test-servo-overlay-treestatus.t
@@ -1,8 +1,10 @@
+#require hg40+
+
$ . $TESTDIR/vcssync/tests/helpers.sh
$ standardoverlayenv > /dev/null 2>&1
test tree open
$ TEST_TREESTATUS=open TEST_NOVENDOR=1 \
> servo-overlay http://localhost:$HGPORT/overlay-source \
> http://localhost:$HGPORT/overlay-dest repo --into subdir \