[PATCH 2 of 2] Add tests for ui.patch regression

Patrick Mezard pmezard at gmail.com
Tue Jun 19 10:44:43 CDT 2007


# HG changeset patch
# User Patrick Mezard <pmezard at gmail.com>
# Date 1182266300 -7200
# Node ID 2a7af17f0d3d3eb55cd4bf4753c871b6926ff200
# Parent  52322ecd604f0829cb78cb45b6c20492f0707cf9
Add tests for ui.patch regression.

diff -r 52322ecd604f -r 2a7af17f0d3d tests/test-patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-patch	Tue Jun 19 17:18:20 2007 +0200
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+cat > patchtool.py <<EOF
+import sys
+print 'Using custom patch'
+if '--binary' in sys.argv:
+    print '--binary found !'
+EOF
+
+echo "[ui]" >> $HGRCPATH
+echo "patch=python ../patchtool.py" >> $HGRCPATH
+
+hg init a
+cd a
+echo a > a
+hg commit -Ama -d '1 0'
+echo b >> a
+hg commit -Amb -d '2 0'
+cd ..
+
+# This test check that:
+# - custom patch commands with arguments actually works
+# - patch code does not try to add weird arguments like
+# --binary when custom patch commands are used. For instance
+# --binary is added by default under win32.
+
+echo % check custom patch options are honored
+hg --cwd a export -o ../a.diff tip
+hg clone -r 0 a b
+
+hg --cwd b import -v ../a.diff
+
+
+
+
+
diff -r 52322ecd604f -r 2a7af17f0d3d tests/test-patch.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-patch.out	Tue Jun 19 17:18:20 2007 +0200
@@ -0,0 +1,11 @@
+adding a
+% check custom patch options are honored
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+applying ../a.diff
+Using custom patch
+nothing changed


More information about the Mercurial-devel mailing list