Test qnew --git
authorPatrick Mezard <pmezard@gmail.com>
Sat, 28 Jul 2007 20:15:54 +0200
changeset 5026 48ebd6a83994
parent 5025 7041869a1bf6
child 5027 17d71a79a257
Test qnew --git
tests/test-mq
tests/test-mq.out
--- a/tests/test-mq	Sat Jul 28 20:15:54 2007 +0200
+++ b/tests/test-mq	Sat Jul 28 20:15:54 2007 +0200
@@ -338,6 +338,33 @@
 cat .hg/patches/bar
 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
 
+echo % create a git patch
+echo a > alexander
+hg add alexander
+hg qnew -f --git addalexander
+cat .hg/patches/addalexander | grep diff
+
+echo % create a git binary patch
+cat > writebin.py <<EOF
+import sys
+path = sys.argv[1]
+open(path, 'wb').write('BIN\x00ARY')
+EOF
+python writebin.py bucephalus
+
+python "$TESTDIR/md5sum.py" bucephalus
+hg add bucephalus
+hg qnew -f --git addbucephalus
+cat .hg/patches/addbucephalus | grep diff
+
+echo % check binary patches can be popped and pushed
+hg qpop
+! test -f bucephalus || echo % bucephalus should not be there
+hg qpush
+test -f bucephalus || echo % bucephalus should be there
+python "$TESTDIR/md5sum.py" bucephalus
+
+
 echo '% strip again'
 cd ..
 hg init strip
--- a/tests/test-mq.out	Sat Jul 28 20:15:54 2007 +0200
+++ b/tests/test-mq.out	Sat Jul 28 20:15:54 2007 +0200
@@ -360,6 +360,16 @@
 @@ -0,0 +1,1 @@
 +bar
 3 barney (foo)
+% create a git patch
+diff --git a/alexander b/alexander
+% create a git binary patch
+8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
+diff --git a/bucephalus b/bucephalus
+% check binary patches can be popped and pushed
+Now at: addalexander
+applying addbucephalus
+Now at: addbucephalus
+8ba2a2f3e77b55d03051ff9c24ad65e7  bucephalus
 % strip again
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 merging foo