annotate tests/test-fastimport-nonascii @ 47:7ff36dc9f0b1

Massive rework to use infrastructure provided by convert extension. fastimport no longer stages changes in the repository's working copy; instead, it now works like any other convert source: the imported history is kept in memory (except for file contents) and then processed by the 'convert' extension.
author Greg Ward <greg-hg@gerg.ca>
date Sat, 16 May 2009 12:57:22 -0400
parents 3048a2dcf68a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
1 #!/bin/sh
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
2
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
3 # Test dumps with non-ASCII characters in various places.
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
4 #
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
5 # This file, including the fastimport dumps in it and the
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
6 # associated .out file, are all encoded in UTF-8.
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
7
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
8 . $TESTDIR/fastimport-common
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
9
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
10 echo "% import dump with non-ASCII committer"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
11 cat > committer.dump <<__EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
12 commit refs/heads/master
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
13 mark :1
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
14 committer Jean-Fran??ois <jf@example.com> 1007132290 +0000
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
15 data 4
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
16 foo
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
17
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
18 __EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
19
47
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
20 # N.B. it's import to run fastimport without overriding HGENCODING,
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
21 # because we need to be sure that UTF-8 metadata is correctly converted
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
22 # even when the default encoding is ASCII. The catch is that the
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
23 # converted commit messages will be mangled as they are printed to
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
24 # stdout. That's OK. The real test is when we run hg log, and there we
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
25 # set HGENCODING to ensure that hg accurately prints what's in the
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
26 # repository.
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
27
38
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
28 hg init committer
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
29 cd committer
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
30 hg --traceback fastimport ../committer.dump
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
31 echo "% log with non-ASCII committer"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
32 HGENCODING=utf-8 hg log
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
33 cd ..
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
34
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
35 echo "% import dump with non-ASCII author"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
36 cat > author.dump <<__EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
37 commit refs/heads/master
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
38 mark :1
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
39 author J??rgen <juergen@example.org> 1250000000 +0400
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
40 committer Dave <dave@example.org> 1250000030 +0400
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
41 data 5
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
42 blah
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
43
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
44 __EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
45
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
46 hg init author
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
47 cd author
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
48 hg --traceback fastimport ../author.dump
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
49 echo "% log with non-ASCII author"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
50 HGENCODING=utf-8 hg log
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
51 cd ..
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
52
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
53 echo "% import dump with non-ASCII message"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
54 cat > message.dump <<__EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
55 commit refs/heads/master
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
56 mark :1
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
57 committer Dave <dave@example.org> 1250000030 +0400
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
58 data 60
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
59 fix na??ve implementation that ??le threw together for ???5
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
60
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
61 M 644 inline foo.txt
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
62 data 6
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
63 hello
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
64
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
65
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
66 __EOF__
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
67
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
68 hg init message
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
69 cd message
47
7ff36dc9f0b1 Massive rework to use infrastructure provided by convert extension.
Greg Ward <greg-hg@gerg.ca>
parents: 38
diff changeset
70 hg --traceback fastimport ../message.dump | sed "s|$HGTMP|HGTMP|g"
38
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
71 echo "% log with non-ASCII message"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
72 HGENCODING=utf-8 hg log
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
73 echo "% manifest"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
74 hg manifest -r0
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
75 echo "% contents of foo.txt"
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
76 hg cat -r0 foo.txt
3048a2dcf68a Test that fastimport dumps with non-ASCII characters import OK.
Greg Ward <greg-hg@gerg.ca>
parents:
diff changeset
77 cd ..