Mercurial > hg-stable
changeset 11784:8a1943685dfb
tests: unify test-patch
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Thu, 12 Aug 2010 15:12:25 +0900 |
parents | 599a78030fa8 |
children | 7d9be960cd9a |
files | tests/test-patch tests/test-patch.out tests/test-patch.t |
diffstat | 3 files changed, 41 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-patch Thu Aug 12 15:07:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -#!/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 - - - - -
--- a/tests/test-patch.out Thu Aug 12 15:07:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -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 -updating to branch default -1 files updated, 0 files merged, 0 files removed, 0 files unresolved -applying ../a.diff -Using custom patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-patch.t Thu Aug 12 15:12:25 2010 +0900 @@ -0,0 +1,41 @@ + $ 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' + adding a + $ 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. + +check custom patch options are honored + + $ hg --cwd a export -o ../a.diff tip + $ hg clone -r 0 a b + requesting all changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + + $ hg --cwd b import -v ../a.diff + applying ../a.diff + Using custom patch +