Mercurial > public > mercurial-scm > hg
diff tests/test-win32text @ 8147:441dc7becd43
win32text: be more careful about rejecting violating changesets
We now try to walk changesets in reverse order from newest to oldest,
so that if we see a file multiple times, we treat the newest version
as canonical.
This should prevent us from rejecting a changegroup that contains an
unacceptable commit followed later by a commit that fixes the problem.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Fri, 24 Apr 2009 00:06:01 -0700 |
parents | b71a52f101dc |
children | 6c82beaaa11a |
line wrap: on
line diff
--- a/tests/test-win32text Thu Apr 23 15:40:10 2009 -0500 +++ b/tests/test-win32text Fri Apr 24 00:06:01 2009 -0700 @@ -1,5 +1,8 @@ #!/bin/sh +hg init t +cd t + cat > unix2dos.py <<EOF import sys @@ -14,7 +17,6 @@ print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>')) EOF -hg init echo '[hooks]' >> .hg/hgrc echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc @@ -23,14 +25,41 @@ echo hello > f hg add f +echo commit should succeed hg ci -m 1 -d'0 0' echo +hg clone . ../zoz +cp .hg/hgrc ../zoz/.hg + python unix2dos.py f +echo commit should fail +hg ci -m 2.1 -d'0 0' +echo + +mv .hg/hgrc .hg/hgrc.bak +echo commits should succeed hg ci -m 2 -d'0 0' -hg revert -a +hg cp f g +hg ci -m 2.2 -d'0 0' echo +echo push should fail +hg push ../zoz +echo + +mv .hg/hgrc.bak .hg/hgrc +echo hello > f +hg rm g +echo commit should succeed +hg ci -m 2.3 -d'0 0' +echo + +echo push should succeed +hg push ../zoz +echo + +echo and now for something completely different mkdir d echo hello > d/f2 python unix2dos.py d/f2