Show More
@@ -1322,22 +1322,10 b" def export(repo, revs, template='hg-%h.p" | |||||
1322 | def diffstat(patchlines): |
|
1322 | def diffstat(patchlines): | |
1323 | if not util.find_exe('diffstat'): |
|
1323 | if not util.find_exe('diffstat'): | |
1324 | return |
|
1324 | return | |
1325 | fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt") |
|
1325 | output = util.filter('\n'.join(patchlines), | |
1326 | try: |
|
1326 | 'diffstat -p1 -w79 2>%s' % util.nulldev) | |
1327 | p = util.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name) |
|
1327 | stat = [l.lstrip() for l in output.splitlines(True)] | |
1328 | try: |
|
1328 | last = stat.pop() | |
1329 | for line in patchlines: |
|
1329 | stat.insert(0, last) | |
1330 | p.tochild.write(line + "\n") |
|
1330 | stat = ''.join(stat) | |
1331 | p.tochild.close() |
|
1331 | return stat | |
1332 | if p.wait(): return |
|
|||
1333 | fp = os.fdopen(fd, 'r') |
|
|||
1334 | stat = [] |
|
|||
1335 | for line in fp: stat.append(line.lstrip()) |
|
|||
1336 | last = stat.pop() |
|
|||
1337 | stat.insert(0, last) |
|
|||
1338 | stat = ''.join(stat) |
|
|||
1339 | return stat |
|
|||
1340 | except: raise |
|
|||
1341 | finally: |
|
|||
1342 | try: os.unlink(name) |
|
|||
1343 | except: pass |
|
@@ -41,5 +41,5 b' http_proxy=localhost:$HGPORT2 hg clone -' | |||||
41 | echo %% do not use the proxy if it is in the no list |
|
41 | echo %% do not use the proxy if it is in the no list | |
42 | http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g |
|
42 | http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g | |
43 |
|
43 | |||
44 | cat proxy.log | sed -e 's/^.*\] /XXX /' |
|
44 | cat proxy.log | sed -e 's/^.*\] /XXX /' -e 's/:[0-9][0-9]*/:/' | |
45 | exit 0 |
|
45 | exit 0 |
@@ -57,18 +57,18 b' adding file changes' | |||||
57 | added 1 changesets with 1 changes to 1 files |
|
57 | added 1 changesets with 1 changes to 1 files | |
58 | updating working directory |
|
58 | updating working directory | |
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
60 |
XXX "GET http://localhost: |
|
60 | XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - | |
61 |
XXX "GET http://localhost: |
|
61 | XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - - | |
62 |
XXX "GET http://localhost: |
|
62 | XXX "GET http://localhost:/?cmd=stream_out HTTP/1.1" - - | |
63 |
XXX "GET http://localhost: |
|
63 | XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - | |
64 |
XXX "GET http://localhost: |
|
64 | XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - - | |
65 |
XXX "GET http://localhost: |
|
65 | XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - | |
66 |
XXX "GET http://localhost: |
|
66 | XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - | |
67 |
XXX "GET http://localhost: |
|
67 | XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - - | |
68 |
XXX "GET http://localhost: |
|
68 | XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - | |
69 |
XXX "GET http://localhost: |
|
69 | XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - | |
70 |
XXX "GET http://localhost: |
|
70 | XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - - | |
71 |
XXX "GET http://localhost: |
|
71 | XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - | |
72 |
XXX "GET http://localhost: |
|
72 | XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - | |
73 |
XXX "GET http://localhost: |
|
73 | XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - - | |
74 |
XXX "GET http://localhost: |
|
74 | XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - |
@@ -33,7 +33,14 b' hg add foo' | |||||
33 | hg diff > $HGTMP/url.diff |
|
33 | hg diff > $HGTMP/url.diff | |
34 | hg revert --no-backup foo |
|
34 | hg revert --no-backup foo | |
35 | rm foo |
|
35 | rm foo | |
36 | hg qimport file://$HGTMP/url.diff |
|
36 | # Under unix: file:///foobar/blah | |
|
37 | # Under windows: file:///c:/foobar/blah | |||
|
38 | patchurl=`echo $HGTMP/url.diff | tr '\\' /` | |||
|
39 | expr $patchurl : "\/" > /dev/null | |||
|
40 | if [ $? -ne 0 ]; then | |||
|
41 | patchurl='/'$patchurl | |||
|
42 | fi | |||
|
43 | hg qimport file://$patchurl | |||
37 | hg qun |
|
44 | hg qun | |
38 |
|
45 | |||
39 | echo % import patch that already exists |
|
46 | echo % import patch that already exists |
@@ -45,26 +45,26 b" hg email --date '1970-1-1 0:3' -n -f quu" | |||||
45 | fixheaders |
|
45 | fixheaders | |
46 |
|
46 | |||
47 | echo % utf-8 patch |
|
47 | echo % utf-8 patch | |
48 | python -c 'fp = open("utf", "w"); fp.write("h\xC3\xB6mma!\n"); fp.close();' |
|
48 | python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();' | |
49 | hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64' |
|
49 | hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64' | |
50 |
|
50 | |||
51 | echo % no mime encoding for email --test |
|
51 | echo % no mime encoding for email --test | |
52 | hg email --date '1970-1-1 0:4' -f quux -t foo -r tip -n | fixheaders > mailtest |
|
52 | hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | fixheaders > mailtest | |
53 | echo % md5sum of 8-bit output |
|
53 | echo % md5sum of 8-bit output | |
54 | $TESTDIR/md5sum.py mailtest |
|
54 | $TESTDIR/md5sum.py mailtest | |
55 | rm mailtest |
|
55 | rm mailtest | |
56 |
|
56 | |||
57 | echo % mime encoded mbox |
|
57 | echo % mime encoded mbox | |
58 | hg email --date '1970-1-1 0:4' -f quux -t foo -r tip -m mbox |
|
58 | hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox | |
59 | cat mbox | fixheaders |
|
59 | cat mbox | fixheaders | |
60 | rm mbox |
|
60 | rm mbox | |
61 |
|
61 | |||
62 | echo % iso-8859-1 patch |
|
62 | echo % iso-8859-1 patch | |
63 | python -c 'fp = open("isolatin", "w"); fp.write("h\xF6mma!\n"); fp.close();' |
|
63 | python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();' | |
64 | hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit' |
|
64 | hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit' | |
65 |
|
65 | |||
66 | echo % fake ascii mbox |
|
66 | echo % fake ascii mbox | |
67 | hg email --date '1970-1-1 0:5' -f quux -t foo -r tip -m mbox |
|
67 | hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox | |
68 | fixheaders < mbox > mboxfix |
|
68 | fixheaders < mbox > mboxfix | |
69 | echo % md5sum of 8-bit output |
|
69 | echo % md5sum of 8-bit output | |
70 | $TESTDIR/md5sum.py mboxfix |
|
70 | $TESTDIR/md5sum.py mboxfix |
@@ -150,7 +150,7 b' adding description' | |||||
150 | adding utf |
|
150 | adding utf | |
151 | % no mime encoding for email --test |
|
151 | % no mime encoding for email --test | |
152 | % md5sum of 8-bit output |
|
152 | % md5sum of 8-bit output | |
153 | a6a3c6b9b6009cea23871a7727a282ab mailtest |
|
153 | ad877786716d09fd7843cf0ed5e3d2a8 mailtest | |
154 | % mime encoded mbox |
|
154 | % mime encoded mbox | |
155 | This patch series consists of 1 patches. |
|
155 | This patch series consists of 1 patches. | |
156 |
|
156 | |||
@@ -166,6 +166,7 b' Message-Id: <c3c9e37db9f4fe4882cd.240@' | |||||
166 | Date: Thu, 01 Jan 1970 00:04:00 +0000 |
|
166 | Date: Thu, 01 Jan 1970 00:04:00 +0000 | |
167 | From: quux |
|
167 | From: quux | |
168 | To: foo |
|
168 | To: foo | |
|
169 | Cc: bar | |||
169 |
|
170 | |||
170 | IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj |
|
171 | IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj | |
171 | OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw |
|
172 | OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw | |
@@ -187,4 +188,4 b' This patch series consists of 1 patches.' | |||||
187 |
|
188 | |||
188 | Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ... |
|
189 | Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ... | |
189 | % md5sum of 8-bit output |
|
190 | % md5sum of 8-bit output | |
190 | 45cb4b77e02f39eb91955f5c95913d66 mboxfix |
|
191 | 90fae277a4a85255e8262174fcefb59f mboxfix |
General Comments 0
You need to be logged in to leave comments.
Login now