# HG changeset patch # User Patrick Mezard # Date 1255040979 -7200 # Node ID 012f1244cd4cdb9135ba0d5659d7a724137d0a31 # Parent 4333b97444193012ed5eaea1a6c69b4209b5f248# Parent b8352a3617f3a5040decd14f15db57e2462bc204 Merge with crew-stable diff -r 4333b9744419 -r 012f1244cd4c mercurial/patch.py --- a/mercurial/patch.py Wed Oct 07 22:50:20 2009 +0200 +++ b/mercurial/patch.py Fri Oct 09 00:29:39 2009 +0200 @@ -63,6 +63,10 @@ subject = msg['Subject'] user = msg['From'] + if not subject and not user: + # Not an email, restore parsed headers if any + subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n' + gitsendmail = 'git-send-email' in msg.get('X-Mailer', '') # should try to parse msg['Date'] date = None diff -r 4333b9744419 -r 012f1244cd4c mercurial/windows.py --- a/mercurial/windows.py Wed Oct 07 22:50:20 2009 +0200 +++ b/mercurial/windows.py Fri Oct 09 00:29:39 2009 +0200 @@ -267,7 +267,7 @@ head, tail = os.path.split(head) while head and tail: try: - if osutil.listdir(name): + if osutil.listdir(head): return os.rmdir(head) except: diff -r 4333b9744419 -r 012f1244cd4c tests/test-import --- a/tests/test-import Wed Oct 07 22:50:20 2009 +0200 +++ b/tests/test-import Fri Oct 09 00:29:39 2009 +0200 @@ -345,3 +345,24 @@ cd oddcreate hg import --no-commit ../create.patch cat foo +cd .. + +echo % 'first line mistaken for email headers (issue 1859)' +hg init emailconfusion +cd emailconfusion +cat > a.patch < issue1861/x +echo y > issue1861/b/c/y +hg ci -Am add +hg rm issue1861/b +hg ci -m remove +ls issue1861 diff -r 4333b9744419 -r 012f1244cd4c tests/test-remove.out --- a/tests/test-remove.out Wed Oct 07 22:50:20 2009 +0200 +++ b/tests/test-remove.out Fri Oct 09 00:29:39 2009 +0200 @@ -111,3 +111,8 @@ ./foo ./test/foo 2 files updated, 0 files merged, 0 files removed, 0 files unresolved +test remove dropping empty trees (issue1861) +adding issue1861/b/c/y +adding issue1861/x +removing issue1861/b/c/y +x