# HG changeset patch # User Matt Mackall # Date 2010-09-26 18:41:32 # Node ID 10c3385fa89eff4d5dc67ba8c57d7663116c2f6a # Parent 4263359f7eacee33b6373ce84af0c5a613622998 tests: unify test-eol-hook diff --git a/tests/test-eol-hook.out b/tests/test-eol-hook.out deleted file mode 100644 --- a/tests/test-eol-hook.out +++ /dev/null @@ -1,30 +0,0 @@ -updating to branch default -0 files updated, 0 files merged, 0 files removed, 0 files unresolved -% hg commit (LF a.txt) -% hg push -pushing to ../main -searching for changes -adding changesets -adding manifests -adding file changes -added 2 changesets with 2 changes to 2 files -% hg commit (CRLF a.txt) -% hg push -pushing to ../main -searching for changes -adding changesets -adding manifests -adding file changes -added 1 changesets with 1 changes to 1 files -error: pretxnchangegroup hook failed: a.txt should not have CRLF line endings -transaction abort! -rollback completed -abort: a.txt should not have CRLF line endings -% hg commit (LF a.txt) -% hg push -pushing to ../main -searching for changes -adding changesets -adding manifests -adding file changes -added 2 changesets with 2 changes to 1 files diff --git a/tests/test-eol-hook b/tests/test-eol-hook.t old mode 100755 new mode 100644 rename from tests/test-eol-hook rename to tests/test-eol-hook.t --- a/tests/test-eol-hook +++ b/tests/test-eol-hook.t @@ -1,47 +1,63 @@ -#!/bin/sh - -cat > $HGRCPATH < main/.hg/hgrc < $HGRCPATH < [diff] + > git = True + > EOF + $ hg init main + $ cat > main/.hg/hgrc < [extensions] + > eol = + > + > [hooks] + > pretxnchangegroup = python:hgext.eol.hook + > EOF + $ hg clone main fork + updating to branch default + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd fork -[hooks] -pretxnchangegroup = python:hgext.eol.hook -EOF - -hg clone main fork +Create repo + $ cat > .hgeol < [patterns] + > mixed.txt = BIN + > **.txt = native + > EOF + $ hg add .hgeol + $ hg commit -m 'Commit .hgeol' -cd fork -cat > .hgeol < a.txt + $ hg add a.txt + $ hg commit -m 'LF a.txt' + $ hg push ../main + pushing to ../main + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 2 files -printf "first\nsecond\nthird\n" > a.txt -hg add a.txt -echo "% hg commit (LF a.txt)" -hg commit -m 'LF a.txt' -echo "% hg push" -hg push ../main + $ printf "first\r\nsecond\r\nthird\n" > a.txt + $ hg commit -m 'CRLF a.txt' + $ hg push ../main + pushing to ../main + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + error: pretxnchangegroup hook failed: a.txt should not have CRLF line endings + transaction abort! + rollback completed + abort: a.txt should not have CRLF line endings + [255] -printf "first\r\nsecond\r\nthird\n" > a.txt -echo "% hg commit (CRLF a.txt)" -hg commit -m 'CRLF a.txt' -echo "% hg push" -hg push ../main - - -echo "% hg commit (LF a.txt)" -printf "first\nsecond\nthird\n" > a.txt -hg commit -m 'LF a.txt (fixed)' -echo "% hg push" -hg push ../main + $ printf "first\nsecond\nthird\n" > a.txt + $ hg commit -m 'LF a.txt (fixed)' + $ hg push ../main + pushing to ../main + searching for changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 1 files