##// END OF EJS Templates
Merge with stable
Matt Mackall -
r9576:c156bf94 merge default
parent child Browse files
Show More
@@ -16,7 +16,9 b' try:'
16 # On darwin, getpreferredencoding ignores the locale environment and
16 # On darwin, getpreferredencoding ignores the locale environment and
17 # always returns mac-roman. We override this if the environment is
17 # always returns mac-roman. We override this if the environment is
18 # not C (has been customized by the user).
18 # not C (has been customized by the user).
19 locale.setlocale(locale.LC_CTYPE, '')
19 lc = locale.setlocale(locale.LC_CTYPE, '')
20 if lc == 'UTF-8':
21 locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
20 encoding = locale.getlocale()[1]
22 encoding = locale.getlocale()[1]
21 if not encoding:
23 if not encoding:
22 encoding = locale.getpreferredencoding() or 'ascii'
24 encoding = locale.getpreferredencoding() or 'ascii'
@@ -63,6 +63,10 b' def extract(ui, fileobj):'
63
63
64 subject = msg['Subject']
64 subject = msg['Subject']
65 user = msg['From']
65 user = msg['From']
66 if not subject and not user:
67 # Not an email, restore parsed headers if any
68 subject = '\n'.join(': '.join(h) for h in msg.items()) + '\n'
69
66 gitsendmail = 'git-send-email' in msg.get('X-Mailer', '')
70 gitsendmail = 'git-send-email' in msg.get('X-Mailer', '')
67 # should try to parse msg['Date']
71 # should try to parse msg['Date']
68 date = None
72 date = None
@@ -267,7 +267,7 b' def _removedirs(name):'
267 head, tail = os.path.split(head)
267 head, tail = os.path.split(head)
268 while head and tail:
268 while head and tail:
269 try:
269 try:
270 if osutil.listdir(name):
270 if osutil.listdir(head):
271 return
271 return
272 os.rmdir(head)
272 os.rmdir(head)
273 except:
273 except:
@@ -345,3 +345,23 b' hg init oddcreate'
345 cd oddcreate
345 cd oddcreate
346 hg import --no-commit ../create.patch
346 hg import --no-commit ../create.patch
347 cat foo
347 cat foo
348
349 echo % 'first line mistaken for email headers (issue 1859)'
350 hg init emailconfusion
351 cd emailconfusion
352 cat > a.patch <<EOF
353 module: summary
354
355 description
356
357
358 diff -r 000000000000 -r 9b4c1e343b55 test.txt
359 --- /dev/null
360 +++ b/a
361 @@ -0,0 +1,1 @@
362 +a
363 EOF
364 hg import -d '0 0' a.patch
365 hg parents -v
366 cd ..
367
@@ -295,3 +295,16 b' applying a.patch'
295 % create file when source is not /dev/null
295 % create file when source is not /dev/null
296 applying ../create.patch
296 applying ../create.patch
297 a
297 a
298 % first line mistaken for email headers (issue 1859)
299 applying a.patch
300 changeset: 0:5a681217c0ad
301 tag: tip
302 user: test
303 date: Thu Jan 01 00:00:00 1970 +0000
304 files: a
305 description:
306 module: summary
307
308 description
309
310
@@ -108,3 +108,12 b' remove -A test'
108 echo % dir, options -Af
108 echo % dir, options -Af
109 rm test/bar
109 rm test/bar
110 remove -Af test
110 remove -Af test
111
112 echo 'test remove dropping empty trees (issue1861)'
113 mkdir -p issue1861/b/c
114 echo x > issue1861/x
115 echo y > issue1861/b/c/y
116 hg ci -Am add
117 hg rm issue1861/b
118 hg ci -m remove
119 ls issue1861
@@ -111,3 +111,8 b' R test/foo'
111 ./foo
111 ./foo
112 ./test/foo
112 ./test/foo
113 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 test remove dropping empty trees (issue1861)
115 adding issue1861/b/c/y
116 adding issue1861/x
117 removing issue1861/b/c/y
118 x
General Comments 0
You need to be logged in to leave comments. Login now