test-hgweb-diffs: partially adapt for Windows
authorAdrian Buehlmann <adrian@cadifra.com>
Wed, 04 Jul 2012 12:43:13 +0200
changeset 17109 7ba2b9435da9
parent 17108 1894dac619de
child 17110 722fd97f6645
test-hgweb-diffs: partially adapt for Windows Since chmod isn't supported on Windows (or vfat), I'm importing a here-doc instead (<<EOF ..). Option --bypass on import of the here-doc is required on Windows (or vfat) to bypass the working directory (see hg help import). Not using --bypass would lose the mode changing bits. I've had to insert a --bypass on the preexisting import call futher down in the test, because importing a patch with --exact and mode changes will fail on Windows (and vfat). As the point of this test is not to test commit, I'm using the import procedure for all platforms unconditionally, that is, I'm intentionally not keeping the original sequence of hg and chmod calls for platforms that support exec either, which saves us having to insert an #if exec ... #else ... #endif.
tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t	Sat Jun 16 22:34:06 2012 -0400
+++ b/tests/test-hgweb-diffs.t	Wed Jul 04 12:43:13 2012 +0200
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" serve execbit || exit 80
+  $ "$TESTDIR/hghave" serve || exit 80
 
 setting up repo
 
@@ -12,9 +12,22 @@
 
 change permissions for git diffs
 
-  $ chmod +x a
-  $ hg rm b
-  $ hg ci -Amb
+  $ hg import -q --bypass - <<EOF
+  > # HG changeset patch
+  > # User test
+  > # Date 0 0
+  > b
+  > 
+  > diff --git a/a b/a
+  > old mode 100644
+  > new mode 100755
+  > diff --git a/b b/b
+  > deleted file mode 100644
+  > --- a/b
+  > +++ /dev/null
+  > @@ -1,1 +0,0 @@
+  > -b
+  > EOF
 
 set up hgweb
 
@@ -548,7 +561,7 @@
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd test1
-  $ hg import -q --exact http://localhost:$HGPORT/rev/1
+  $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
 
 raw revision with diff block numbers