[PATCH] test-tag: enable for Windows

Adrian Buehlmann adrian at cadifra.com
Sat Jun 2 09:55:08 CDT 2012


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1338648404 -7200
# Node ID 2c1cb3d59c43581cb6d27a8216005ee862498f9c
# Parent  96f6639987c2bc61c959ef9983b7d5221671e7fc
test-tag: enable for Windows

diff --git a/tests/dummyeditor.py b/tests/dummyeditor.py
new file mode 100644
--- /dev/null
+++ b/tests/dummyeditor.py
@@ -0,0 +1,5 @@
+import sys
+f = open(sys.argv[1], 'wb')
+f.write("first line written by dummyeditor\n")
+f.write("second line written by dummyeditor\n")
+f.close()
diff --git a/tests/test-tag.t b/tests/test-tag.t
--- a/tests/test-tag.t
+++ b/tests/test-tag.t
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
   $ hg init test
   $ cd test
 
@@ -214,16 +212,10 @@
 
 test custom commit messages
 
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
-  > echo "custom tag message" > "$1"
-  > echo "second line" >> "$1"
-  > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
+  $ HGEDITOR="python \"$TESTDIR/dummyeditor.py\"" hg tag custom-tag -e
   $ hg log -l1 --template "{desc}\n"
-  custom tag message
-  second line
+  first line written by dummyeditor
+  second line written by dummyeditor
 
 
 local tag with .hgtags modified
@@ -235,7 +227,6 @@
   $ hg st
   M .hgtags
   ? .hgtags.orig
-  ? editor
   $ hg tag --local baz
   $ hg revert --no-backup .hgtags
 
@@ -303,9 +294,11 @@
 
 commit hook on tag used to be run without write lock - issue3344
 
+  $ HGPATH="$TESTDIR/../hg"
+
   $ hg init repo-tag
   $ hg init repo-tag-target
-  $ hg -R repo-tag --config hooks.commit="hg push \"`pwd`/repo-tag-target\"" tag tag
+  $ hg -R repo-tag --config hooks.commit="python \"$HGPATH\" push \"`pwd`/repo-tag-target\"" tag tag
   pushing to $TESTTMP/repo-tag-target
   searching for changes
   adding changesets


More information about the Mercurial-devel mailing list