##// END OF EJS Templates
tests: use (esc) instead of other kinds of string escaping
Mads Kiilerich -
r12943:7439ea41 stable
parent child Browse files
Show More
@@ -1,144 +1,144 b''
1
1
2 $ "$TESTDIR/hghave" darcs || exit 80
2 $ "$TESTDIR/hghave" darcs || exit 80
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "convert=" >> $HGRCPATH
4 $ echo "convert=" >> $HGRCPATH
5 $ echo 'graphlog =' >> $HGRCPATH
5 $ echo 'graphlog =' >> $HGRCPATH
6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
6 $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
7 $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
7 $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
8
8
9 skip if we can't import elementtree
9 skip if we can't import elementtree
10
10
11 $ mkdir dummy
11 $ mkdir dummy
12 $ mkdir dummy/_darcs
12 $ mkdir dummy/_darcs
13 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
13 $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
14 > echo 'skipped: missing feature: elementtree module'
14 > echo 'skipped: missing feature: elementtree module'
15 > exit 80
15 > exit 80
16 > fi
16 > fi
17
17
18 try converting darcs1 repository
18 try converting darcs1 repository
19
19
20 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
20 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
21 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
21 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
22 darcs-1.0 repository format is unsupported, please upgrade
22 darcs-1.0 repository format is unsupported, please upgrade
23
23
24 initialize darcs repo
24 initialize darcs repo
25
25
26 $ mkdir darcs-repo
26 $ mkdir darcs-repo
27 $ cd darcs-repo
27 $ cd darcs-repo
28 $ darcs init
28 $ darcs init
29 $ echo a > a
29 $ echo a > a
30 $ darcs record -a -l -m p0
30 $ darcs record -a -l -m p0
31 Finished recording patch 'p0'
31 Finished recording patch 'p0'
32 $ cd ..
32 $ cd ..
33
33
34 branch and update
34 branch and update
35
35
36 $ darcs get darcs-repo darcs-clone >/dev/null
36 $ darcs get darcs-repo darcs-clone >/dev/null
37 $ cd darcs-clone
37 $ cd darcs-clone
38 $ echo c >> a
38 $ echo c >> a
39 $ echo c > c
39 $ echo c > c
40 $ darcs record -a -l -m p1.1
40 $ darcs record -a -l -m p1.1
41 Finished recording patch 'p1.1'
41 Finished recording patch 'p1.1'
42 $ cd ..
42 $ cd ..
43
43
44 update source
44 update source
45
45
46 $ cd darcs-repo
46 $ cd darcs-repo
47 $ echo b >> a
47 $ echo b >> a
48 $ echo b > b
48 $ echo b > b
49 $ darcs record -a -l -m p1.2
49 $ darcs record -a -l -m p1.2
50 Finished recording patch 'p1.2'
50 Finished recording patch 'p1.2'
51
51
52 $ darcs pull -a ../darcs-clone
52 $ darcs pull -a ../darcs-clone
53 Backing up ./a(-darcs-backup0)
53 Backing up ./a(-darcs-backup0)
54 We have conflicts in the following files:
54 We have conflicts in the following files:
55 ./a
55 ./a
56 Finished pulling and applying.
56 Finished pulling and applying.
57 $ sleep 1
57 $ sleep 1
58 $ echo e > a
58 $ echo e > a
59 $ echo f > f
59 $ echo f > f
60 $ mkdir dir
60 $ mkdir dir
61 $ echo d > dir/d
61 $ echo d > dir/d
62 $ echo d > dir/d2
62 $ echo d > dir/d2
63 $ darcs record -a -l -m p2
63 $ darcs record -a -l -m p2
64 Finished recording patch 'p2'
64 Finished recording patch 'p2'
65
65
66 test file and directory move
66 test file and directory move
67
67
68 $ darcs mv f ff
68 $ darcs mv f ff
69
69
70 Test remove + move
70 Test remove + move
71
71
72 $ darcs remove dir/d2
72 $ darcs remove dir/d2
73 $ rm dir/d2
73 $ rm dir/d2
74 $ darcs mv dir dir2
74 $ darcs mv dir dir2
75 $ darcs record -a -l -m p3
75 $ darcs record -a -l -m p3
76 Finished recording patch 'p3'
76 Finished recording patch 'p3'
77
77
78 test utf-8 commit message and author
78 test utf-8 commit message and author
79
79
80 $ echo g > g
80 $ echo g > g
81
81
82 darcs is encoding agnostic, so it takes whatever bytes it's given
82 darcs is encoding agnostic, so it takes whatever bytes it's given
83
83
84 $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
84 $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
85 Finished recording patch 'p4: desc \xc3\xb1' (esc)
85 Finished recording patch 'p4: desc \xc3\xb1' (esc)
86
86
87 Test latin-1 commit message
87 Test latin-1 commit message
88
88
89 $ echo h > h
89 $ echo h > h
90 $ printf "p5: desc " > ../p5
90 $ printf "p5: desc " > ../p5
91 $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5
91 $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5
92 $ darcs record -a -l --logfile ../p5
92 $ darcs record -a -l --logfile ../p5
93 Finished recording patch 'p5: desc \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' (esc)
93 Finished recording patch 'p5: desc \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' (esc)
94
94
95 $ glog()
95 $ glog()
96 > {
96 > {
97 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
97 > HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
98 > }
98 > }
99 $ cd ..
99 $ cd ..
100 $ hg convert darcs-repo darcs-repo-hg
100 $ hg convert darcs-repo darcs-repo-hg
101 initializing destination darcs-repo-hg repository
101 initializing destination darcs-repo-hg repository
102 scanning source...
102 scanning source...
103 sorting...
103 sorting...
104 converting...
104 converting...
105 6 p0
105 6 p0
106 5 p1.2
106 5 p1.2
107 4 p1.1
107 4 p1.1
108 3 p2
108 3 p2
109 2 p3
109 2 p3
110 1 p4: desc ?
110 1 p4: desc ?
111 0 p5: desc ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
111 0 p5: desc ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
112
112
113 The converter does not currently handle patch conflicts very well.
113 The converter does not currently handle patch conflicts very well.
114 When they occur, it reverts *all* changes and moves forward,
114 When they occur, it reverts *all* changes and moves forward,
115 letting the conflict resolving patch fix collisions.
115 letting the conflict resolving patch fix collisions.
116 Unfortunately, non-conflicting changes, like the addition of the
116 Unfortunately, non-conflicting changes, like the addition of the
117 "c" file in p1.1 patch are reverted too.
117 "c" file in p1.1 patch are reverted too.
118 Just to say that manifest not listing "c" here is a bug.
118 Just to say that manifest not listing "c" here is a bug.
119
119
120 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6 | "$TESTDIR"/printrepr.py
120 $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6
121 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h
121 o 6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h (esc)
122 |
122 |
123 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5 | "$TESTDIR"/printrepr.py
123 $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5
124 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g
124 o 5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g (esc)
125 |
125 |
126 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
126 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
127 |
127 |
128 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
128 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
129 |
129 |
130 o 2 "p1.1" (test@example.org) files:
130 o 2 "p1.1" (test@example.org) files:
131 |
131 |
132 o 1 "p1.2" (test@example.org) files: a b
132 o 1 "p1.2" (test@example.org) files: a b
133 |
133 |
134 o 0 "p0" (test@example.org) files: a
134 o 0 "p0" (test@example.org) files: a
135
135
136
136
137 $ hg up -q -R darcs-repo-hg
137 $ hg up -q -R darcs-repo-hg
138 $ hg -R darcs-repo-hg manifest --debug
138 $ hg -R darcs-repo-hg manifest --debug
139 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
139 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
140 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
140 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
141 37406831adc447ec2385014019599dfec953c806 644 dir2/d
141 37406831adc447ec2385014019599dfec953c806 644 dir2/d
142 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
142 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
143 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
143 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
144 fe6f8b4f507fe3eb524c527192a84920a4288dac 644 h
144 fe6f8b4f507fe3eb524c527192a84920a4288dac 644 h
@@ -1,135 +1,135 b''
1
1
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
3
3
4 $ cat > $HGRCPATH <<EOF
4 $ cat > $HGRCPATH <<EOF
5 > [extensions]
5 > [extensions]
6 > convert =
6 > convert =
7 > graphlog =
7 > graphlog =
8 > EOF
8 > EOF
9
9
10 $ svnadmin create svn-repo
10 $ svnadmin create svn-repo
11 $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump"
11 $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump"
12
12
13 Convert while testing all possible outputs
13 Convert while testing all possible outputs
14
14
15 $ hg --debug convert svn-repo A-hg
15 $ hg --debug convert svn-repo A-hg
16 initializing destination A-hg repository
16 initializing destination A-hg repository
17 reparent to file://*/svn-repo (glob)
17 reparent to file://*/svn-repo (glob)
18 run hg sink pre-conversion action
18 run hg sink pre-conversion action
19 scanning source...
19 scanning source...
20 found trunk at 'trunk'
20 found trunk at 'trunk'
21 found tags at 'tags'
21 found tags at 'tags'
22 found branches at 'branches'
22 found branches at 'branches'
23 found branch branch\xc3\xa9 at 5 (esc)
23 found branch branch\xc3\xa9 at 5 (esc)
24 found branch branch\xc3\xa9e at 6 (esc)
24 found branch branch\xc3\xa9e at 6 (esc)
25 scanning: 1 revisions
25 scanning: 1 revisions
26 reparent to file://*/svn-repo/trunk (glob)
26 reparent to file://*/svn-repo/trunk (glob)
27 fetching revision log for "/trunk" from 4 to 0
27 fetching revision log for "/trunk" from 4 to 0
28 parsing revision 4 (2 changes)
28 parsing revision 4 (2 changes)
29 parsing revision 3 (4 changes)
29 parsing revision 3 (4 changes)
30 parsing revision 2 (3 changes)
30 parsing revision 2 (3 changes)
31 parsing revision 1 (3 changes)
31 parsing revision 1 (3 changes)
32 no copyfrom path, don't know what to do.
32 no copyfrom path, don't know what to do.
33 '/branches' is not under '/trunk', ignoring
33 '/branches' is not under '/trunk', ignoring
34 '/tags' is not under '/trunk', ignoring
34 '/tags' is not under '/trunk', ignoring
35 scanning: 2 revisions
35 scanning: 2 revisions
36 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
36 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
37 fetching revision log for "/branches/branch\xc3\xa9" from 5 to 0 (esc)
37 fetching revision log for "/branches/branch\xc3\xa9" from 5 to 0 (esc)
38 parsing revision 5 (1 changes)
38 parsing revision 5 (1 changes)
39 reparent to file://*/svn-repo (glob)
39 reparent to file://*/svn-repo (glob)
40 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
40 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
41 found parent of branch /branches/branch\xc3\xa9 at 4: /trunk (esc)
41 found parent of branch /branches/branch\xc3\xa9 at 4: /trunk (esc)
42 scanning: 3 revisions
42 scanning: 3 revisions
43 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
43 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
44 fetching revision log for "/branches/branch\xc3\xa9e" from 6 to 0 (esc)
44 fetching revision log for "/branches/branch\xc3\xa9e" from 6 to 0 (esc)
45 parsing revision 6 (1 changes)
45 parsing revision 6 (1 changes)
46 reparent to file://*/svn-repo (glob)
46 reparent to file://*/svn-repo (glob)
47 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
47 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
48 found parent of branch /branches/branch\xc3\xa9e at 5: /branches/branch\xc3\xa9 (esc)
48 found parent of branch /branches/branch\xc3\xa9e at 5: /branches/branch\xc3\xa9 (esc)
49 scanning: 4 revisions
49 scanning: 4 revisions
50 scanning: 5 revisions
50 scanning: 5 revisions
51 scanning: 6 revisions
51 scanning: 6 revisions
52 sorting...
52 sorting...
53 converting...
53 converting...
54 5 init projA
54 5 init projA
55 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
55 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1
56 converting: 0/6 revisions (0.00%)
56 converting: 0/6 revisions (0.00%)
57 4 hello
57 4 hello
58 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
58 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
59 converting: 1/6 revisions (16.67%)
59 converting: 1/6 revisions (16.67%)
60 reparent to file://*/svn-repo/trunk (glob)
60 reparent to file://*/svn-repo/trunk (glob)
61 scanning paths: /trunk/\xc3\xa0 0/3 (0.00%) (esc)
61 scanning paths: /trunk/\xc3\xa0 0/3 (0.00%) (esc)
62 scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 (33.33%) (esc)
62 scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 (33.33%) (esc)
63 scanning paths: /trunk/\xc3\xa9 2/3 (66.67%) (esc)
63 scanning paths: /trunk/\xc3\xa9 2/3 (66.67%) (esc)
64 \xc3\xa0/e\xcc\x81 (esc)
64 \xc3\xa0/e\xcc\x81 (esc)
65 getting files: \xc3\xa0/e\xcc\x81 1/2 (50.00%) (esc)
65 getting files: \xc3\xa0/e\xcc\x81 1/2 (50.00%) (esc)
66 \xc3\xa9 (esc)
66 \xc3\xa9 (esc)
67 getting files: \xc3\xa9 2/2 (100.00%) (esc)
67 getting files: \xc3\xa9 2/2 (100.00%) (esc)
68 3 copy files
68 3 copy files
69 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
69 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
70 converting: 2/6 revisions (33.33%)
70 converting: 2/6 revisions (33.33%)
71 scanning paths: /trunk/\xc3\xa0 0/4 (0.00%) (esc)
71 scanning paths: /trunk/\xc3\xa0 0/4 (0.00%) (esc)
72 gone from -1
72 gone from -1
73 reparent to file://*/svn-repo (glob)
73 reparent to file://*/svn-repo (glob)
74 reparent to file://*/svn-repo/trunk (glob)
74 reparent to file://*/svn-repo/trunk (glob)
75 scanning paths: /trunk/\xc3\xa8 1/4 (25.00%) (esc)
75 scanning paths: /trunk/\xc3\xa8 1/4 (25.00%) (esc)
76 copied to \xc3\xa8 from \xc3\xa9@2 (esc)
76 copied to \xc3\xa8 from \xc3\xa9@2 (esc)
77 scanning paths: /trunk/\xc3\xa9 2/4 (50.00%) (esc)
77 scanning paths: /trunk/\xc3\xa9 2/4 (50.00%) (esc)
78 gone from -1
78 gone from -1
79 reparent to file://*/svn-repo (glob)
79 reparent to file://*/svn-repo (glob)
80 reparent to file://*/svn-repo/trunk (glob)
80 reparent to file://*/svn-repo/trunk (glob)
81 scanning paths: /trunk/\xc3\xb9 3/4 (75.00%) (esc)
81 scanning paths: /trunk/\xc3\xb9 3/4 (75.00%) (esc)
82 mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc)
82 mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc)
83 \xc3\xa0/e\xcc\x81 (esc)
83 \xc3\xa0/e\xcc\x81 (esc)
84 getting files: \xc3\xa0/e\xcc\x81 1/4 (25.00%) (esc)
84 getting files: \xc3\xa0/e\xcc\x81 1/4 (25.00%) (esc)
85 \xc3\xa8 (esc)
85 \xc3\xa8 (esc)
86 getting files: \xc3\xa8 2/4 (50.00%) (esc)
86 getting files: \xc3\xa8 2/4 (50.00%) (esc)
87 \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc)
87 \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc)
88 \xc3\xa9 (esc)
88 \xc3\xa9 (esc)
89 getting files: \xc3\xa9 3/4 (75.00%) (esc)
89 getting files: \xc3\xa9 3/4 (75.00%) (esc)
90 \xc3\xb9/e\xcc\x81 (esc)
90 \xc3\xb9/e\xcc\x81 (esc)
91 getting files: \xc3\xb9/e\xcc\x81 4/4 (100.00%) (esc)
91 getting files: \xc3\xb9/e\xcc\x81 4/4 (100.00%) (esc)
92 \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc)
92 \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc)
93 2 remove files
93 2 remove files
94 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
94 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
95 converting: 3/6 revisions (50.00%)
95 converting: 3/6 revisions (50.00%)
96 scanning paths: /trunk/\xc3\xa8 0/2 (0.00%) (esc)
96 scanning paths: /trunk/\xc3\xa8 0/2 (0.00%) (esc)
97 gone from -1
97 gone from -1
98 reparent to file://*/svn-repo (glob)
98 reparent to file://*/svn-repo (glob)
99 reparent to file://*/svn-repo/trunk (glob)
99 reparent to file://*/svn-repo/trunk (glob)
100 scanning paths: /trunk/\xc3\xb9 1/2 (50.00%) (esc)
100 scanning paths: /trunk/\xc3\xb9 1/2 (50.00%) (esc)
101 gone from -1
101 gone from -1
102 reparent to file://*/svn-repo (glob)
102 reparent to file://*/svn-repo (glob)
103 reparent to file://*/svn-repo/trunk (glob)
103 reparent to file://*/svn-repo/trunk (glob)
104 \xc3\xa8 (esc)
104 \xc3\xa8 (esc)
105 getting files: \xc3\xa8 1/2 (50.00%) (esc)
105 getting files: \xc3\xa8 1/2 (50.00%) (esc)
106 \xc3\xb9/e\xcc\x81 (esc)
106 \xc3\xb9/e\xcc\x81 (esc)
107 getting files: \xc3\xb9/e\xcc\x81 2/2 (100.00%) (esc)
107 getting files: \xc3\xb9/e\xcc\x81 2/2 (100.00%) (esc)
108 1 branch to branch?
108 1 branch to branch?
109 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
109 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
110 converting: 4/6 revisions (66.67%)
110 converting: 4/6 revisions (66.67%)
111 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
111 reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
112 scanning paths: /branches/branch\xc3\xa9 0/1 (0.00%) (esc)
112 scanning paths: /branches/branch\xc3\xa9 0/1 (0.00%) (esc)
113 0 branch to branch?e
113 0 branch to branch?e
114 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
114 source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
115 converting: 5/6 revisions (83.33%)
115 converting: 5/6 revisions (83.33%)
116 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
116 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
117 scanning paths: /branches/branch\xc3\xa9e 0/1 (0.00%) (esc)
117 scanning paths: /branches/branch\xc3\xa9e 0/1 (0.00%) (esc)
118 reparent to file://*/svn-repo (glob)
118 reparent to file://*/svn-repo (glob)
119 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
119 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
120 reparent to file://*/svn-repo (glob)
120 reparent to file://*/svn-repo (glob)
121 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
121 reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
122 updating tags
122 updating tags
123 .hgtags
123 .hgtags
124 run hg sink post-conversion action
124 run hg sink post-conversion action
125 $ cd A-hg
125 $ cd A-hg
126 $ hg up
126 $ hg up
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
128
128
129 Check tags are in UTF-8
129 Check tags are in UTF-8
130
130
131 $ python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
131 $ cat .hgtags
132 '221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
132 221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e (esc)
133 '7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
133 7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9 (esc)
134
134
135 $ cd ..
135 $ cd ..
@@ -1,125 +1,125 b''
1 Test adding .hgeol
1 Test adding .hgeol
2
2
3 $ cat > $HGRCPATH <<EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = 1
5 > git = 1
6 > EOF
6 > EOF
7 $ seteol () {
7 $ seteol () {
8 > if [ $1 = "LF" ]; then
8 > if [ $1 = "LF" ]; then
9 > EOL='\n'
9 > EOL='\n'
10 > else
10 > else
11 > EOL='\r\n'
11 > EOL='\r\n'
12 > fi
12 > fi
13 > }
13 > }
14 $ makerepo () {
14 $ makerepo () {
15 > echo
15 > echo
16 > echo "# ==== setup repository ===="
16 > echo "# ==== setup repository ===="
17 > echo '% hg init'
17 > echo '% hg init'
18 > hg init repo
18 > hg init repo
19 > cd repo
19 > cd repo
20 > printf "first\nsecond\nthird\n" > a.txt
20 > printf "first\nsecond\nthird\n" > a.txt
21 > hg commit -d '100 0' --addremove -m 'LF commit'
21 > hg commit -d '100 0' --addremove -m 'LF commit'
22 > cd ..
22 > cd ..
23 > }
23 > }
24 $ dotest () {
24 $ dotest () {
25 > seteol $1
25 > seteol $1
26 > echo
26 > echo
27 > echo "% hg clone repo repo-$1"
27 > echo "% hg clone repo repo-$1"
28 > hg clone repo repo-$1
28 > hg clone repo repo-$1
29 > cd repo-$1
29 > cd repo-$1
30 > cat > .hg/hgrc <<EOF
30 > cat > .hg/hgrc <<EOF
31 > [extensions]
31 > [extensions]
32 > eol =
32 > eol =
33 > [eol]
33 > [eol]
34 > native = LF
34 > native = LF
35 > EOF
35 > EOF
36 > cat > .hgeol <<EOF
36 > cat > .hgeol <<EOF
37 > [patterns]
37 > [patterns]
38 > **.txt = native
38 > **.txt = native
39 > [repository]
39 > [repository]
40 > native = $1
40 > native = $1
41 > EOF
41 > EOF
42 > echo '% hg add .hgeol'
42 > echo '% hg add .hgeol'
43 > hg add .hgeol
43 > hg add .hgeol
44 > echo '% hg status'
44 > echo '% hg status'
45 > hg status
45 > hg status
46 > echo '% hg commit'
46 > echo '% hg commit'
47 > hg commit -d '200 0' -m 'Added .hgeol file'
47 > hg commit -d '200 0' -m 'Added .hgeol file'
48 > echo '% hg status'
48 > echo '% hg status'
49 > hg status
49 > hg status
50 > echo '% hg tip -p'
50 > echo '% hg tip -p'
51 > hg tip -p | python $TESTDIR/printrepr.py
51 > hg tip -p
52 > cd ..
52 > cd ..
53 > rm -r repo-$1
53 > rm -r repo-$1
54 > }
54 > }
55 $ makerepo
55 $ makerepo
56
56
57 # ==== setup repository ====
57 # ==== setup repository ====
58 % hg init
58 % hg init
59 adding a.txt
59 adding a.txt
60 $ dotest LF
60 $ dotest LF
61
61
62 % hg clone repo repo-LF
62 % hg clone repo repo-LF
63 updating to branch default
63 updating to branch default
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 % hg add .hgeol
65 % hg add .hgeol
66 % hg status
66 % hg status
67 A .hgeol
67 A .hgeol
68 % hg commit
68 % hg commit
69 % hg status
69 % hg status
70 % hg tip -p
70 % hg tip -p
71 changeset: 1:33503edb53b0
71 changeset: 1:33503edb53b0
72 tag: tip
72 tag: tip
73 user: test
73 user: test
74 date: Thu Jan 01 00:03:20 1970 +0000
74 date: Thu Jan 01 00:03:20 1970 +0000
75 summary: Added .hgeol file
75 summary: Added .hgeol file
76
76
77 diff --git a/.hgeol b/.hgeol
77 diff --git a/.hgeol b/.hgeol
78 new file mode 100644
78 new file mode 100644
79 --- /dev/null
79 --- /dev/null
80 +++ b/.hgeol
80 +++ b/.hgeol
81 @@ -0,0 +1,4 @@
81 @@ -0,0 +1,4 @@
82 +[patterns]
82 +[patterns]
83 +**.txt = native
83 +**.txt = native
84 +[repository]
84 +[repository]
85 +native = LF
85 +native = LF
86
86
87 $ dotest CRLF
87 $ dotest CRLF
88
88
89 % hg clone repo repo-CRLF
89 % hg clone repo repo-CRLF
90 updating to branch default
90 updating to branch default
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 % hg add .hgeol
92 % hg add .hgeol
93 % hg status
93 % hg status
94 M a.txt
94 M a.txt
95 A .hgeol
95 A .hgeol
96 % hg commit
96 % hg commit
97 % hg status
97 % hg status
98 % hg tip -p
98 % hg tip -p
99 changeset: 1:6e64eaa9eb23
99 changeset: 1:6e64eaa9eb23
100 tag: tip
100 tag: tip
101 user: test
101 user: test
102 date: Thu Jan 01 00:03:20 1970 +0000
102 date: Thu Jan 01 00:03:20 1970 +0000
103 summary: Added .hgeol file
103 summary: Added .hgeol file
104
104
105 diff --git a/.hgeol b/.hgeol
105 diff --git a/.hgeol b/.hgeol
106 new file mode 100644
106 new file mode 100644
107 --- /dev/null
107 --- /dev/null
108 +++ b/.hgeol
108 +++ b/.hgeol
109 @@ -0,0 +1,4 @@
109 @@ -0,0 +1,4 @@
110 +[patterns]
110 +[patterns]
111 +**.txt = native
111 +**.txt = native
112 +[repository]
112 +[repository]
113 +native = CRLF
113 +native = CRLF
114 diff --git a/a.txt b/a.txt
114 diff --git a/a.txt b/a.txt
115 --- a/a.txt
115 --- a/a.txt
116 +++ b/a.txt
116 +++ b/a.txt
117 @@ -1,3 +1,3 @@
117 @@ -1,3 +1,3 @@
118 -first
118 -first
119 -second
119 -second
120 -third
120 -third
121 +first\r
121 +first\r (esc)
122 +second\r
122 +second\r (esc)
123 +third\r
123 +third\r (esc)
124
124
125 $ rm -r repo
125 $ rm -r repo
@@ -1,77 +1,77 b''
1 Testing cloning with the EOL extension
1 Testing cloning with the EOL extension
2
2
3 $ cat > $HGRCPATH <<EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = True
5 > git = True
6 >
6 >
7 > [extensions]
7 > [extensions]
8 > eol =
8 > eol =
9 >
9 >
10 > [eol]
10 > [eol]
11 > native = CRLF
11 > native = CRLF
12 > EOF
12 > EOF
13
13
14 setup repository
14 setup repository
15
15
16 $ hg init repo
16 $ hg init repo
17 $ cd repo
17 $ cd repo
18 $ cat > .hgeol <<EOF
18 $ cat > .hgeol <<EOF
19 > [patterns]
19 > [patterns]
20 > **.txt = native
20 > **.txt = native
21 > EOF
21 > EOF
22 $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
22 $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
23 $ hg commit --addremove -m 'checkin'
23 $ hg commit --addremove -m 'checkin'
24 adding .hgeol
24 adding .hgeol
25 adding a.txt
25 adding a.txt
26
26
27 Clone
27 Clone
28
28
29 $ cd ..
29 $ cd ..
30 $ hg clone repo repo-2
30 $ hg clone repo repo-2
31 updating to branch default
31 updating to branch default
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ cd repo-2
33 $ cd repo-2
34 $ python $TESTDIR/printrepr.py < a.txt
34 $ cat a.txt
35 first\r
35 first\r (esc)
36 second\r
36 second\r (esc)
37 third\r
37 third\r (esc)
38 $ hg cat a.txt | python $TESTDIR/printrepr.py
38 $ hg cat a.txt
39 first
39 first
40 second
40 second
41 third
41 third
42 $ hg remove .hgeol
42 $ hg remove .hgeol
43 $ hg commit -m 'remove eol'
43 $ hg commit -m 'remove eol'
44 $ hg push --quiet
44 $ hg push --quiet
45 $ cd ..
45 $ cd ..
46
46
47 Test clone of repo with .hgeol in working dir, but no .hgeol in tip
47 Test clone of repo with .hgeol in working dir, but no .hgeol in tip
48
48
49 $ hg clone repo repo-3
49 $ hg clone repo repo-3
50 updating to branch default
50 updating to branch default
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 $ cd repo-3
52 $ cd repo-3
53
53
54 $ python $TESTDIR/printrepr.py < a.txt
54 $ cat a.txt
55 first
55 first
56 second
56 second
57 third
57 third
58
58
59 Test clone of revision with .hgeol
59 Test clone of revision with .hgeol
60
60
61 $ cd ..
61 $ cd ..
62 $ hg clone -r 0 repo repo-4
62 $ hg clone -r 0 repo repo-4
63 adding changesets
63 adding changesets
64 adding manifests
64 adding manifests
65 adding file changes
65 adding file changes
66 added 1 changesets with 2 changes to 2 files
66 added 1 changesets with 2 changes to 2 files
67 updating to branch default
67 updating to branch default
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 $ cd repo-4
69 $ cd repo-4
70 $ cat .hgeol
70 $ cat .hgeol
71 [patterns]
71 [patterns]
72 **.txt = native
72 **.txt = native
73
73
74 $ python $TESTDIR/printrepr.py < a.txt
74 $ cat a.txt
75 first\r
75 first\r (esc)
76 second\r
76 second\r (esc)
77 third\r
77 third\r (esc)
@@ -1,400 +1,400 b''
1 Test EOL patching
1 Test EOL patching
2
2
3 $ cat > $HGRCPATH <<EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = 1
5 > git = 1
6 > EOF
6 > EOF
7
7
8 Set up helpers
8 Set up helpers
9
9
10 $ seteol () {
10 $ seteol () {
11 > if [ $1 = "LF" ]; then
11 > if [ $1 = "LF" ]; then
12 > EOL='\n'
12 > EOL='\n'
13 > else
13 > else
14 > EOL='\r\n'
14 > EOL='\r\n'
15 > fi
15 > fi
16 > }
16 > }
17
17
18 $ makerepo () {
18 $ makerepo () {
19 > seteol $1
19 > seteol $1
20 > echo
20 > echo
21 > echo "# ==== setup $1 repository ===="
21 > echo "# ==== setup $1 repository ===="
22 > echo '% hg init'
22 > echo '% hg init'
23 > hg init repo
23 > hg init repo
24 > cd repo
24 > cd repo
25 > cat > .hgeol <<EOF
25 > cat > .hgeol <<EOF
26 > [repository]
26 > [repository]
27 > native = $1
27 > native = $1
28 > [patterns]
28 > [patterns]
29 > unix.txt = LF
29 > unix.txt = LF
30 > win.txt = CRLF
30 > win.txt = CRLF
31 > **.txt = native
31 > **.txt = native
32 > EOF
32 > EOF
33 > printf "first\r\nsecond\r\nthird\r\n" > win.txt
33 > printf "first\r\nsecond\r\nthird\r\n" > win.txt
34 > printf "first\nsecond\nthird\n" > unix.txt
34 > printf "first\nsecond\nthird\n" > unix.txt
35 > printf "first${EOL}second${EOL}third${EOL}" > native.txt
35 > printf "first${EOL}second${EOL}third${EOL}" > native.txt
36 > hg commit --addremove -m 'checkin'
36 > hg commit --addremove -m 'checkin'
37 > cd ..
37 > cd ..
38 > }
38 > }
39
39
40 $ dotest () {
40 $ dotest () {
41 > seteol $1
41 > seteol $1
42 > echo
42 > echo
43 > echo "% hg clone repo repo-$1"
43 > echo "% hg clone repo repo-$1"
44 > hg clone --noupdate repo repo-$1
44 > hg clone --noupdate repo repo-$1
45 > cd repo-$1
45 > cd repo-$1
46 > cat > .hg/hgrc <<EOF
46 > cat > .hg/hgrc <<EOF
47 > [extensions]
47 > [extensions]
48 > eol =
48 > eol =
49 > [eol]
49 > [eol]
50 > native = $1
50 > native = $1
51 > EOF
51 > EOF
52 > hg update
52 > hg update
53 > echo '% printrepr.py native.txt'
53 > echo '% native.txt'
54 > python $TESTDIR/printrepr.py < native.txt
54 > cat native.txt
55 > echo '% printrepr.py unix.txt'
55 > echo '% unix.txt'
56 > python $TESTDIR/printrepr.py < unix.txt
56 > cat unix.txt
57 > echo '% printrepr.py win.txt'
57 > echo '% win.txt'
58 > python $TESTDIR/printrepr.py < win.txt
58 > cat win.txt
59 > printf "first${EOL}third${EOL}" > native.txt
59 > printf "first${EOL}third${EOL}" > native.txt
60 > printf "first\r\nthird\r\n" > win.txt
60 > printf "first\r\nthird\r\n" > win.txt
61 > printf "first\nthird\n" > unix.txt
61 > printf "first\nthird\n" > unix.txt
62 > echo '% hg diff'
62 > echo '% hg diff'
63 > hg diff > p
63 > hg diff > p
64 > python $TESTDIR/printrepr.py < p
64 > cat p
65 > echo '% hg revert'
65 > echo '% hg revert'
66 > hg revert --all
66 > hg revert --all
67 > echo '% hg import'
67 > echo '% hg import'
68 > hg import -m 'patch' p
68 > hg import -m 'patch' p
69 > echo '% printrepr.py native.txt'
69 > echo '% native.txt'
70 > python $TESTDIR/printrepr.py < native.txt
70 > cat native.txt
71 > echo '% printrepr.py unix.txt'
71 > echo '% unix.txt'
72 > python $TESTDIR/printrepr.py < unix.txt
72 > cat unix.txt
73 > echo '% printrepr.py win.txt'
73 > echo '% win.txt'
74 > python $TESTDIR/printrepr.py < win.txt
74 > cat win.txt
75 > echo '% hg diff -c tip'
75 > echo '% hg diff -c tip'
76 > hg diff -c tip | python $TESTDIR/printrepr.py
76 > hg diff -c tip
77 > cd ..
77 > cd ..
78 > rm -r repo-$1
78 > rm -r repo-$1
79 > }
79 > }
80
80
81 Run tests
81 Run tests
82
82
83 $ makerepo LF
83 $ makerepo LF
84
84
85 # ==== setup LF repository ====
85 # ==== setup LF repository ====
86 % hg init
86 % hg init
87 adding .hgeol
87 adding .hgeol
88 adding native.txt
88 adding native.txt
89 adding unix.txt
89 adding unix.txt
90 adding win.txt
90 adding win.txt
91 $ dotest LF
91 $ dotest LF
92
92
93 % hg clone repo repo-LF
93 % hg clone repo repo-LF
94 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 % printrepr.py native.txt
95 % native.txt
96 first
96 first
97 second
97 second
98 third
98 third
99 % printrepr.py unix.txt
99 % unix.txt
100 first
100 first
101 second
101 second
102 third
102 third
103 % printrepr.py win.txt
103 % win.txt
104 first\r
104 first\r (esc)
105 second\r
105 second\r (esc)
106 third\r
106 third\r (esc)
107 % hg diff
107 % hg diff
108 diff --git a/native.txt b/native.txt
108 diff --git a/native.txt b/native.txt
109 --- a/native.txt
109 --- a/native.txt
110 +++ b/native.txt
110 +++ b/native.txt
111 @@ -1,3 +1,2 @@
111 @@ -1,3 +1,2 @@
112 first
112 first
113 -second
113 -second
114 third
114 third
115 diff --git a/unix.txt b/unix.txt
115 diff --git a/unix.txt b/unix.txt
116 --- a/unix.txt
116 --- a/unix.txt
117 +++ b/unix.txt
117 +++ b/unix.txt
118 @@ -1,3 +1,2 @@
118 @@ -1,3 +1,2 @@
119 first
119 first
120 -second
120 -second
121 third
121 third
122 diff --git a/win.txt b/win.txt
122 diff --git a/win.txt b/win.txt
123 --- a/win.txt
123 --- a/win.txt
124 +++ b/win.txt
124 +++ b/win.txt
125 @@ -1,3 +1,2 @@
125 @@ -1,3 +1,2 @@
126 first\r
126 first\r (esc)
127 -second\r
127 -second\r (esc)
128 third\r
128 third\r (esc)
129 % hg revert
129 % hg revert
130 reverting native.txt
130 reverting native.txt
131 reverting unix.txt
131 reverting unix.txt
132 reverting win.txt
132 reverting win.txt
133 % hg import
133 % hg import
134 applying p
134 applying p
135 % printrepr.py native.txt
135 % native.txt
136 first
136 first
137 third
137 third
138 % printrepr.py unix.txt
138 % unix.txt
139 first
139 first
140 third
140 third
141 % printrepr.py win.txt
141 % win.txt
142 first\r
142 first\r (esc)
143 third\r
143 third\r (esc)
144 % hg diff -c tip
144 % hg diff -c tip
145 diff --git a/native.txt b/native.txt
145 diff --git a/native.txt b/native.txt
146 --- a/native.txt
146 --- a/native.txt
147 +++ b/native.txt
147 +++ b/native.txt
148 @@ -1,3 +1,2 @@
148 @@ -1,3 +1,2 @@
149 first
149 first
150 -second
150 -second
151 third
151 third
152 diff --git a/unix.txt b/unix.txt
152 diff --git a/unix.txt b/unix.txt
153 --- a/unix.txt
153 --- a/unix.txt
154 +++ b/unix.txt
154 +++ b/unix.txt
155 @@ -1,3 +1,2 @@
155 @@ -1,3 +1,2 @@
156 first
156 first
157 -second
157 -second
158 third
158 third
159 diff --git a/win.txt b/win.txt
159 diff --git a/win.txt b/win.txt
160 --- a/win.txt
160 --- a/win.txt
161 +++ b/win.txt
161 +++ b/win.txt
162 @@ -1,3 +1,2 @@
162 @@ -1,3 +1,2 @@
163 first\r
163 first\r (esc)
164 -second\r
164 -second\r (esc)
165 third\r
165 third\r (esc)
166 $ dotest CRLF
166 $ dotest CRLF
167
167
168 % hg clone repo repo-CRLF
168 % hg clone repo repo-CRLF
169 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 % printrepr.py native.txt
170 % native.txt
171 first\r
171 first\r (esc)
172 second\r
172 second\r (esc)
173 third\r
173 third\r (esc)
174 % printrepr.py unix.txt
174 % unix.txt
175 first
175 first
176 second
176 second
177 third
177 third
178 % printrepr.py win.txt
178 % win.txt
179 first\r
179 first\r (esc)
180 second\r
180 second\r (esc)
181 third\r
181 third\r (esc)
182 % hg diff
182 % hg diff
183 diff --git a/native.txt b/native.txt
183 diff --git a/native.txt b/native.txt
184 --- a/native.txt
184 --- a/native.txt
185 +++ b/native.txt
185 +++ b/native.txt
186 @@ -1,3 +1,2 @@
186 @@ -1,3 +1,2 @@
187 first
187 first
188 -second
188 -second
189 third
189 third
190 diff --git a/unix.txt b/unix.txt
190 diff --git a/unix.txt b/unix.txt
191 --- a/unix.txt
191 --- a/unix.txt
192 +++ b/unix.txt
192 +++ b/unix.txt
193 @@ -1,3 +1,2 @@
193 @@ -1,3 +1,2 @@
194 first
194 first
195 -second
195 -second
196 third
196 third
197 diff --git a/win.txt b/win.txt
197 diff --git a/win.txt b/win.txt
198 --- a/win.txt
198 --- a/win.txt
199 +++ b/win.txt
199 +++ b/win.txt
200 @@ -1,3 +1,2 @@
200 @@ -1,3 +1,2 @@
201 first\r
201 first\r (esc)
202 -second\r
202 -second\r (esc)
203 third\r
203 third\r (esc)
204 % hg revert
204 % hg revert
205 reverting native.txt
205 reverting native.txt
206 reverting unix.txt
206 reverting unix.txt
207 reverting win.txt
207 reverting win.txt
208 % hg import
208 % hg import
209 applying p
209 applying p
210 % printrepr.py native.txt
210 % native.txt
211 first\r
211 first\r (esc)
212 third\r
212 third\r (esc)
213 % printrepr.py unix.txt
213 % unix.txt
214 first
214 first
215 third
215 third
216 % printrepr.py win.txt
216 % win.txt
217 first\r
217 first\r (esc)
218 third\r
218 third\r (esc)
219 % hg diff -c tip
219 % hg diff -c tip
220 diff --git a/native.txt b/native.txt
220 diff --git a/native.txt b/native.txt
221 --- a/native.txt
221 --- a/native.txt
222 +++ b/native.txt
222 +++ b/native.txt
223 @@ -1,3 +1,2 @@
223 @@ -1,3 +1,2 @@
224 first
224 first
225 -second
225 -second
226 third
226 third
227 diff --git a/unix.txt b/unix.txt
227 diff --git a/unix.txt b/unix.txt
228 --- a/unix.txt
228 --- a/unix.txt
229 +++ b/unix.txt
229 +++ b/unix.txt
230 @@ -1,3 +1,2 @@
230 @@ -1,3 +1,2 @@
231 first
231 first
232 -second
232 -second
233 third
233 third
234 diff --git a/win.txt b/win.txt
234 diff --git a/win.txt b/win.txt
235 --- a/win.txt
235 --- a/win.txt
236 +++ b/win.txt
236 +++ b/win.txt
237 @@ -1,3 +1,2 @@
237 @@ -1,3 +1,2 @@
238 first\r
238 first\r (esc)
239 -second\r
239 -second\r (esc)
240 third\r
240 third\r (esc)
241 $ rm -r repo
241 $ rm -r repo
242 $ makerepo CRLF
242 $ makerepo CRLF
243
243
244 # ==== setup CRLF repository ====
244 # ==== setup CRLF repository ====
245 % hg init
245 % hg init
246 adding .hgeol
246 adding .hgeol
247 adding native.txt
247 adding native.txt
248 adding unix.txt
248 adding unix.txt
249 adding win.txt
249 adding win.txt
250 $ dotest LF
250 $ dotest LF
251
251
252 % hg clone repo repo-LF
252 % hg clone repo repo-LF
253 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 % printrepr.py native.txt
254 % native.txt
255 first
255 first
256 second
256 second
257 third
257 third
258 % printrepr.py unix.txt
258 % unix.txt
259 first
259 first
260 second
260 second
261 third
261 third
262 % printrepr.py win.txt
262 % win.txt
263 first\r
263 first\r (esc)
264 second\r
264 second\r (esc)
265 third\r
265 third\r (esc)
266 % hg diff
266 % hg diff
267 diff --git a/native.txt b/native.txt
267 diff --git a/native.txt b/native.txt
268 --- a/native.txt
268 --- a/native.txt
269 +++ b/native.txt
269 +++ b/native.txt
270 @@ -1,3 +1,2 @@
270 @@ -1,3 +1,2 @@
271 first\r
271 first\r (esc)
272 -second\r
272 -second\r (esc)
273 third\r
273 third\r (esc)
274 diff --git a/unix.txt b/unix.txt
274 diff --git a/unix.txt b/unix.txt
275 --- a/unix.txt
275 --- a/unix.txt
276 +++ b/unix.txt
276 +++ b/unix.txt
277 @@ -1,3 +1,2 @@
277 @@ -1,3 +1,2 @@
278 first
278 first
279 -second
279 -second
280 third
280 third
281 diff --git a/win.txt b/win.txt
281 diff --git a/win.txt b/win.txt
282 --- a/win.txt
282 --- a/win.txt
283 +++ b/win.txt
283 +++ b/win.txt
284 @@ -1,3 +1,2 @@
284 @@ -1,3 +1,2 @@
285 first\r
285 first\r (esc)
286 -second\r
286 -second\r (esc)
287 third\r
287 third\r (esc)
288 % hg revert
288 % hg revert
289 reverting native.txt
289 reverting native.txt
290 reverting unix.txt
290 reverting unix.txt
291 reverting win.txt
291 reverting win.txt
292 % hg import
292 % hg import
293 applying p
293 applying p
294 % printrepr.py native.txt
294 % native.txt
295 first
295 first
296 third
296 third
297 % printrepr.py unix.txt
297 % unix.txt
298 first
298 first
299 third
299 third
300 % printrepr.py win.txt
300 % win.txt
301 first\r
301 first\r (esc)
302 third\r
302 third\r (esc)
303 % hg diff -c tip
303 % hg diff -c tip
304 diff --git a/native.txt b/native.txt
304 diff --git a/native.txt b/native.txt
305 --- a/native.txt
305 --- a/native.txt
306 +++ b/native.txt
306 +++ b/native.txt
307 @@ -1,3 +1,2 @@
307 @@ -1,3 +1,2 @@
308 first\r
308 first\r (esc)
309 -second\r
309 -second\r (esc)
310 third\r
310 third\r (esc)
311 diff --git a/unix.txt b/unix.txt
311 diff --git a/unix.txt b/unix.txt
312 --- a/unix.txt
312 --- a/unix.txt
313 +++ b/unix.txt
313 +++ b/unix.txt
314 @@ -1,3 +1,2 @@
314 @@ -1,3 +1,2 @@
315 first
315 first
316 -second
316 -second
317 third
317 third
318 diff --git a/win.txt b/win.txt
318 diff --git a/win.txt b/win.txt
319 --- a/win.txt
319 --- a/win.txt
320 +++ b/win.txt
320 +++ b/win.txt
321 @@ -1,3 +1,2 @@
321 @@ -1,3 +1,2 @@
322 first\r
322 first\r (esc)
323 -second\r
323 -second\r (esc)
324 third\r
324 third\r (esc)
325 $ dotest CRLF
325 $ dotest CRLF
326
326
327 % hg clone repo repo-CRLF
327 % hg clone repo repo-CRLF
328 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 % printrepr.py native.txt
329 % native.txt
330 first\r
330 first\r (esc)
331 second\r
331 second\r (esc)
332 third\r
332 third\r (esc)
333 % printrepr.py unix.txt
333 % unix.txt
334 first
334 first
335 second
335 second
336 third
336 third
337 % printrepr.py win.txt
337 % win.txt
338 first\r
338 first\r (esc)
339 second\r
339 second\r (esc)
340 third\r
340 third\r (esc)
341 % hg diff
341 % hg diff
342 diff --git a/native.txt b/native.txt
342 diff --git a/native.txt b/native.txt
343 --- a/native.txt
343 --- a/native.txt
344 +++ b/native.txt
344 +++ b/native.txt
345 @@ -1,3 +1,2 @@
345 @@ -1,3 +1,2 @@
346 first\r
346 first\r (esc)
347 -second\r
347 -second\r (esc)
348 third\r
348 third\r (esc)
349 diff --git a/unix.txt b/unix.txt
349 diff --git a/unix.txt b/unix.txt
350 --- a/unix.txt
350 --- a/unix.txt
351 +++ b/unix.txt
351 +++ b/unix.txt
352 @@ -1,3 +1,2 @@
352 @@ -1,3 +1,2 @@
353 first
353 first
354 -second
354 -second
355 third
355 third
356 diff --git a/win.txt b/win.txt
356 diff --git a/win.txt b/win.txt
357 --- a/win.txt
357 --- a/win.txt
358 +++ b/win.txt
358 +++ b/win.txt
359 @@ -1,3 +1,2 @@
359 @@ -1,3 +1,2 @@
360 first\r
360 first\r (esc)
361 -second\r
361 -second\r (esc)
362 third\r
362 third\r (esc)
363 % hg revert
363 % hg revert
364 reverting native.txt
364 reverting native.txt
365 reverting unix.txt
365 reverting unix.txt
366 reverting win.txt
366 reverting win.txt
367 % hg import
367 % hg import
368 applying p
368 applying p
369 % printrepr.py native.txt
369 % native.txt
370 first\r
370 first\r (esc)
371 third\r
371 third\r (esc)
372 % printrepr.py unix.txt
372 % unix.txt
373 first
373 first
374 third
374 third
375 % printrepr.py win.txt
375 % win.txt
376 first\r
376 first\r (esc)
377 third\r
377 third\r (esc)
378 % hg diff -c tip
378 % hg diff -c tip
379 diff --git a/native.txt b/native.txt
379 diff --git a/native.txt b/native.txt
380 --- a/native.txt
380 --- a/native.txt
381 +++ b/native.txt
381 +++ b/native.txt
382 @@ -1,3 +1,2 @@
382 @@ -1,3 +1,2 @@
383 first\r
383 first\r (esc)
384 -second\r
384 -second\r (esc)
385 third\r
385 third\r (esc)
386 diff --git a/unix.txt b/unix.txt
386 diff --git a/unix.txt b/unix.txt
387 --- a/unix.txt
387 --- a/unix.txt
388 +++ b/unix.txt
388 +++ b/unix.txt
389 @@ -1,3 +1,2 @@
389 @@ -1,3 +1,2 @@
390 first
390 first
391 -second
391 -second
392 third
392 third
393 diff --git a/win.txt b/win.txt
393 diff --git a/win.txt b/win.txt
394 --- a/win.txt
394 --- a/win.txt
395 +++ b/win.txt
395 +++ b/win.txt
396 @@ -1,3 +1,2 @@
396 @@ -1,3 +1,2 @@
397 first\r
397 first\r (esc)
398 -second\r
398 -second\r (esc)
399 third\r
399 third\r (esc)
400 $ rm -r repo
400 $ rm -r repo
@@ -1,152 +1,152 b''
1 Test EOL update
1 Test EOL update
2
2
3 $ cat > $HGRCPATH <<EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = 1
5 > git = 1
6 > EOF
6 > EOF
7
7
8 $ seteol () {
8 $ seteol () {
9 > if [ $1 = "LF" ]; then
9 > if [ $1 = "LF" ]; then
10 > EOL='\n'
10 > EOL='\n'
11 > else
11 > else
12 > EOL='\r\n'
12 > EOL='\r\n'
13 > fi
13 > fi
14 > }
14 > }
15
15
16 $ makerepo () {
16 $ makerepo () {
17 > echo
17 > echo
18 > echo "# ==== setup repository ===="
18 > echo "# ==== setup repository ===="
19 > echo '% hg init'
19 > echo '% hg init'
20 > hg init repo
20 > hg init repo
21 > cd repo
21 > cd repo
22 >
22 >
23 > cat > .hgeol <<EOF
23 > cat > .hgeol <<EOF
24 > [patterns]
24 > [patterns]
25 > **.txt = LF
25 > **.txt = LF
26 > EOF
26 > EOF
27 >
27 >
28 > printf "first\nsecond\nthird\n" > a.txt
28 > printf "first\nsecond\nthird\n" > a.txt
29 > hg commit --addremove -m 'LF commit'
29 > hg commit --addremove -m 'LF commit'
30 >
30 >
31 > cat > .hgeol <<EOF
31 > cat > .hgeol <<EOF
32 > [patterns]
32 > [patterns]
33 > **.txt = CRLF
33 > **.txt = CRLF
34 > EOF
34 > EOF
35 >
35 >
36 > printf "first\r\nsecond\r\nthird\r\n" > a.txt
36 > printf "first\r\nsecond\r\nthird\r\n" > a.txt
37 > hg commit -m 'CRLF commit'
37 > hg commit -m 'CRLF commit'
38 >
38 >
39 > cd ..
39 > cd ..
40 > }
40 > }
41
41
42 $ dotest () {
42 $ dotest () {
43 > seteol $1
43 > seteol $1
44 >
44 >
45 > echo
45 > echo
46 > echo "% hg clone repo repo-$1"
46 > echo "% hg clone repo repo-$1"
47 > hg clone --noupdate repo repo-$1
47 > hg clone --noupdate repo repo-$1
48 > cd repo-$1
48 > cd repo-$1
49 >
49 >
50 > cat > .hg/hgrc <<EOF
50 > cat > .hg/hgrc <<EOF
51 > [extensions]
51 > [extensions]
52 > eol =
52 > eol =
53 > EOF
53 > EOF
54 >
54 >
55 > hg update
55 > hg update
56 >
56 >
57 > echo '% printrepr.py a.txt (before)'
57 > echo '% a.txt (before)'
58 > python $TESTDIR/printrepr.py < a.txt
58 > cat a.txt
59 >
59 >
60 > printf "first${EOL}third${EOL}" > a.txt
60 > printf "first${EOL}third${EOL}" > a.txt
61 >
61 >
62 > echo '% printrepr.py a.txt (after)'
62 > echo '% a.txt (after)'
63 > python $TESTDIR/printrepr.py < a.txt
63 > cat a.txt
64 > echo '% hg diff'
64 > echo '% hg diff'
65 > hg diff | python $TESTDIR/printrepr.py
65 > hg diff
66 >
66 >
67 > echo '% hg update 0'
67 > echo '% hg update 0'
68 > hg update 0
68 > hg update 0
69 >
69 >
70 > echo '% printrepr.py a.txt'
70 > echo '% a.txt'
71 > python $TESTDIR/printrepr.py < a.txt
71 > cat a.txt
72 > echo '% hg diff'
72 > echo '% hg diff'
73 > hg diff | python $TESTDIR/printrepr.py
73 > hg diff
74 >
74 >
75 >
75 >
76 > cd ..
76 > cd ..
77 > rm -r repo-$1
77 > rm -r repo-$1
78 > }
78 > }
79
79
80 $ makerepo
80 $ makerepo
81
81
82 # ==== setup repository ====
82 # ==== setup repository ====
83 % hg init
83 % hg init
84 adding .hgeol
84 adding .hgeol
85 adding a.txt
85 adding a.txt
86 $ dotest LF
86 $ dotest LF
87
87
88 % hg clone repo repo-LF
88 % hg clone repo repo-LF
89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 % printrepr.py a.txt (before)
90 % a.txt (before)
91 first\r
91 first\r (esc)
92 second\r
92 second\r (esc)
93 third\r
93 third\r (esc)
94 % printrepr.py a.txt (after)
94 % a.txt (after)
95 first
95 first
96 third
96 third
97 % hg diff
97 % hg diff
98 diff --git a/a.txt b/a.txt
98 diff --git a/a.txt b/a.txt
99 --- a/a.txt
99 --- a/a.txt
100 +++ b/a.txt
100 +++ b/a.txt
101 @@ -1,3 +1,2 @@
101 @@ -1,3 +1,2 @@
102 first\r
102 first\r (esc)
103 -second\r
103 -second\r (esc)
104 third\r
104 third\r (esc)
105 % hg update 0
105 % hg update 0
106 merging a.txt
106 merging a.txt
107 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
108 % printrepr.py a.txt
108 % a.txt
109 first
109 first
110 third
110 third
111 % hg diff
111 % hg diff
112 diff --git a/a.txt b/a.txt
112 diff --git a/a.txt b/a.txt
113 --- a/a.txt
113 --- a/a.txt
114 +++ b/a.txt
114 +++ b/a.txt
115 @@ -1,3 +1,2 @@
115 @@ -1,3 +1,2 @@
116 first
116 first
117 -second
117 -second
118 third
118 third
119 $ dotest CRLF
119 $ dotest CRLF
120
120
121 % hg clone repo repo-CRLF
121 % hg clone repo repo-CRLF
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 % printrepr.py a.txt (before)
123 % a.txt (before)
124 first\r
124 first\r (esc)
125 second\r
125 second\r (esc)
126 third\r
126 third\r (esc)
127 % printrepr.py a.txt (after)
127 % a.txt (after)
128 first\r
128 first\r (esc)
129 third\r
129 third\r (esc)
130 % hg diff
130 % hg diff
131 diff --git a/a.txt b/a.txt
131 diff --git a/a.txt b/a.txt
132 --- a/a.txt
132 --- a/a.txt
133 +++ b/a.txt
133 +++ b/a.txt
134 @@ -1,3 +1,2 @@
134 @@ -1,3 +1,2 @@
135 first\r
135 first\r (esc)
136 -second\r
136 -second\r (esc)
137 third\r
137 third\r (esc)
138 % hg update 0
138 % hg update 0
139 merging a.txt
139 merging a.txt
140 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
141 % printrepr.py a.txt
141 % a.txt
142 first
142 first
143 third
143 third
144 % hg diff
144 % hg diff
145 diff --git a/a.txt b/a.txt
145 diff --git a/a.txt b/a.txt
146 --- a/a.txt
146 --- a/a.txt
147 +++ b/a.txt
147 +++ b/a.txt
148 @@ -1,3 +1,2 @@
148 @@ -1,3 +1,2 @@
149 first
149 first
150 -second
150 -second
151 third
151 third
152 $ rm -r repo
152 $ rm -r repo
@@ -1,385 +1,385 b''
1 Test EOL extension
1 Test EOL extension
2
2
3 $ cat > $HGRCPATH <<EOF
3 $ cat > $HGRCPATH <<EOF
4 > [diff]
4 > [diff]
5 > git = True
5 > git = True
6 > EOF
6 > EOF
7
7
8 Set up helpers
8 Set up helpers
9
9
10 $ cat > switch-eol.py <<EOF
10 $ cat > switch-eol.py <<EOF
11 > import sys
11 > import sys
12 > try:
12 > try:
13 > import os, msvcrt
13 > import os, msvcrt
14 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
14 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
16 > except ImportError:
16 > except ImportError:
17 > pass
17 > pass
18 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
18 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
19 > print "%% switching encoding from %r to %r" % (old, new)
19 > print "%% switching encoding from %r to %r" % (old, new)
20 > for path in sys.argv[2:]:
20 > for path in sys.argv[2:]:
21 > data = file(path, 'rb').read()
21 > data = file(path, 'rb').read()
22 > data = data.replace(old, new)
22 > data = data.replace(old, new)
23 > file(path, 'wb').write(data)
23 > file(path, 'wb').write(data)
24 > EOF
24 > EOF
25
25
26 $ seteol () {
26 $ seteol () {
27 > if [ $1 = "LF" ]; then
27 > if [ $1 = "LF" ]; then
28 > EOL='\n'
28 > EOL='\n'
29 > else
29 > else
30 > EOL='\r\n'
30 > EOL='\r\n'
31 > fi
31 > fi
32 > }
32 > }
33
33
34 $ makerepo () {
34 $ makerepo () {
35 > seteol $1
35 > seteol $1
36 > echo "% setup $1 repository"
36 > echo "% setup $1 repository"
37 > hg init repo
37 > hg init repo
38 > cd repo
38 > cd repo
39 > cat > .hgeol <<EOF
39 > cat > .hgeol <<EOF
40 > [repository]
40 > [repository]
41 > native = $1
41 > native = $1
42 > [patterns]
42 > [patterns]
43 > mixed.txt = BIN
43 > mixed.txt = BIN
44 > **.txt = native
44 > **.txt = native
45 > EOF
45 > EOF
46 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
46 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
47 > hg commit --addremove -m 'checkin'
47 > hg commit --addremove -m 'checkin'
48 > echo
48 > echo
49 > cd ..
49 > cd ..
50 > }
50 > }
51
51
52 $ dotest () {
52 $ dotest () {
53 > seteol $1
53 > seteol $1
54 > echo "% hg clone repo repo-$1"
54 > echo "% hg clone repo repo-$1"
55 > hg clone --noupdate repo repo-$1
55 > hg clone --noupdate repo repo-$1
56 > cd repo-$1
56 > cd repo-$1
57 > cat > .hg/hgrc <<EOF
57 > cat > .hg/hgrc <<EOF
58 > [extensions]
58 > [extensions]
59 > eol =
59 > eol =
60 > [eol]
60 > [eol]
61 > native = $1
61 > native = $1
62 > EOF
62 > EOF
63 > hg update
63 > hg update
64 > echo '% printrepr.py a.txt'
64 > echo '% a.txt'
65 > python $TESTDIR/printrepr.py < a.txt
65 > cat a.txt
66 > echo '% hg cat a.txt'
66 > echo '% hg cat a.txt'
67 > hg cat a.txt | python $TESTDIR/printrepr.py
67 > hg cat a.txt
68 > printf "fourth${EOL}" >> a.txt
68 > printf "fourth${EOL}" >> a.txt
69 > echo '% printrepr.py a.txt'
69 > echo '% a.txt'
70 > python $TESTDIR/printrepr.py < a.txt
70 > cat a.txt
71 > hg diff | python $TESTDIR/printrepr.py
71 > hg diff
72 > python ../switch-eol.py $1 a.txt
72 > python ../switch-eol.py $1 a.txt
73 > echo '% hg diff only reports a single changed line:'
73 > echo '% hg diff only reports a single changed line:'
74 > hg diff | python $TESTDIR/printrepr.py
74 > hg diff
75 > echo "% reverting back to $1 format"
75 > echo "% reverting back to $1 format"
76 > hg revert a.txt
76 > hg revert a.txt
77 > python $TESTDIR/printrepr.py < a.txt
77 > cat a.txt
78 > printf "first\r\nsecond\n" > mixed.txt
78 > printf "first\r\nsecond\n" > mixed.txt
79 > hg add mixed.txt
79 > hg add mixed.txt
80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
81 > hg commit -m 'binary file'
81 > hg commit -m 'binary file'
82 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
82 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
83 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
83 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
84 > hg commit -m 'inconsistent file'
84 > hg commit -m 'inconsistent file'
85 > echo "% hg commit --config eol.only-consistent=False (should work)"
85 > echo "% hg commit --config eol.only-consistent=False (should work)"
86 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
86 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
87 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
87 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
88 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
88 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
89 > hg commit -m 'binary file'
89 > hg commit -m 'binary file'
90 > cd ..
90 > cd ..
91 > rm -r repo-$1
91 > rm -r repo-$1
92 > }
92 > }
93
93
94 $ makemixedrepo () {
94 $ makemixedrepo () {
95 > echo
95 > echo
96 > echo "# setup $1 repository"
96 > echo "# setup $1 repository"
97 > hg init mixed
97 > hg init mixed
98 > cd mixed
98 > cd mixed
99 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
99 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
100 > printf "foo\nbar\nbaz\n" > unix.txt
100 > printf "foo\nbar\nbaz\n" > unix.txt
101 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
101 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
102 > hg commit --addremove -m 'created mixed files'
102 > hg commit --addremove -m 'created mixed files'
103 > echo "# setting repository-native EOLs to $1"
103 > echo "# setting repository-native EOLs to $1"
104 > cat > .hgeol <<EOF
104 > cat > .hgeol <<EOF
105 > [repository]
105 > [repository]
106 > native = $1
106 > native = $1
107 > [patterns]
107 > [patterns]
108 > **.txt = native
108 > **.txt = native
109 > EOF
109 > EOF
110 > hg commit --addremove -m 'added .hgeol'
110 > hg commit --addremove -m 'added .hgeol'
111 > cd ..
111 > cd ..
112 > }
112 > }
113
113
114 $ testmixed () {
114 $ testmixed () {
115 > echo
115 > echo
116 > echo "% hg clone mixed mixed-$1"
116 > echo "% hg clone mixed mixed-$1"
117 > hg clone mixed mixed-$1
117 > hg clone mixed mixed-$1
118 > cd mixed-$1
118 > cd mixed-$1
119 > echo '% hg status (eol extension not yet activated)'
119 > echo '% hg status (eol extension not yet activated)'
120 > hg status
120 > hg status
121 > cat > .hg/hgrc <<EOF
121 > cat > .hg/hgrc <<EOF
122 > [extensions]
122 > [extensions]
123 > eol =
123 > eol =
124 > [eol]
124 > [eol]
125 > native = $1
125 > native = $1
126 > EOF
126 > EOF
127 > echo '% hg status (eol activated)'
127 > echo '% hg status (eol activated)'
128 > hg status
128 > hg status
129 > echo '% hg commit'
129 > echo '% hg commit'
130 > hg commit -m 'synchronized EOLs'
130 > hg commit -m 'synchronized EOLs'
131 > echo '% hg status'
131 > echo '% hg status'
132 > hg status
132 > hg status
133 > cd ..
133 > cd ..
134 > rm -r mixed-$1
134 > rm -r mixed-$1
135 > }
135 > }
136
136
137 Basic tests
137 Basic tests
138
138
139 $ makerepo LF
139 $ makerepo LF
140 % setup LF repository
140 % setup LF repository
141 adding .hgeol
141 adding .hgeol
142 adding a.txt
142 adding a.txt
143
143
144 $ dotest LF
144 $ dotest LF
145 % hg clone repo repo-LF
145 % hg clone repo repo-LF
146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 % printrepr.py a.txt
147 % a.txt
148 first
148 first
149 second
149 second
150 third
150 third
151 % hg cat a.txt
151 % hg cat a.txt
152 first
152 first
153 second
153 second
154 third
154 third
155 % printrepr.py a.txt
155 % a.txt
156 first
156 first
157 second
157 second
158 third
158 third
159 fourth
159 fourth
160 diff --git a/a.txt b/a.txt
160 diff --git a/a.txt b/a.txt
161 --- a/a.txt
161 --- a/a.txt
162 +++ b/a.txt
162 +++ b/a.txt
163 @@ -1,3 +1,4 @@
163 @@ -1,3 +1,4 @@
164 first
164 first
165 second
165 second
166 third
166 third
167 +fourth
167 +fourth
168 % switching encoding from '\n' to '\r\n'
168 % switching encoding from '\n' to '\r\n'
169 % hg diff only reports a single changed line:
169 % hg diff only reports a single changed line:
170 diff --git a/a.txt b/a.txt
170 diff --git a/a.txt b/a.txt
171 --- a/a.txt
171 --- a/a.txt
172 +++ b/a.txt
172 +++ b/a.txt
173 @@ -1,3 +1,4 @@
173 @@ -1,3 +1,4 @@
174 first
174 first
175 second
175 second
176 third
176 third
177 +fourth
177 +fourth
178 % reverting back to LF format
178 % reverting back to LF format
179 first
179 first
180 second
180 second
181 third
181 third
182 % hg commit of inconsistent .txt file marked as binary (should work)
182 % hg commit of inconsistent .txt file marked as binary (should work)
183 % hg commit of inconsistent .txt file marked as native (should fail)
183 % hg commit of inconsistent .txt file marked as native (should fail)
184 abort: inconsistent newline style in a.txt
184 abort: inconsistent newline style in a.txt
185
185
186 % hg commit --config eol.only-consistent=False (should work)
186 % hg commit --config eol.only-consistent=False (should work)
187 % hg commit of binary .txt file marked as native (binary files always okay)
187 % hg commit of binary .txt file marked as native (binary files always okay)
188 $ dotest CRLF
188 $ dotest CRLF
189 % hg clone repo repo-CRLF
189 % hg clone repo repo-CRLF
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 % printrepr.py a.txt
191 % a.txt
192 first\r
192 first\r (esc)
193 second\r
193 second\r (esc)
194 third\r
194 third\r (esc)
195 % hg cat a.txt
195 % hg cat a.txt
196 first
196 first
197 second
197 second
198 third
198 third
199 % printrepr.py a.txt
199 % a.txt
200 first\r
200 first\r (esc)
201 second\r
201 second\r (esc)
202 third\r
202 third\r (esc)
203 fourth\r
203 fourth\r (esc)
204 diff --git a/a.txt b/a.txt
204 diff --git a/a.txt b/a.txt
205 --- a/a.txt
205 --- a/a.txt
206 +++ b/a.txt
206 +++ b/a.txt
207 @@ -1,3 +1,4 @@
207 @@ -1,3 +1,4 @@
208 first
208 first
209 second
209 second
210 third
210 third
211 +fourth
211 +fourth
212 % switching encoding from '\r\n' to '\n'
212 % switching encoding from '\r\n' to '\n'
213 % hg diff only reports a single changed line:
213 % hg diff only reports a single changed line:
214 diff --git a/a.txt b/a.txt
214 diff --git a/a.txt b/a.txt
215 --- a/a.txt
215 --- a/a.txt
216 +++ b/a.txt
216 +++ b/a.txt
217 @@ -1,3 +1,4 @@
217 @@ -1,3 +1,4 @@
218 first
218 first
219 second
219 second
220 third
220 third
221 +fourth
221 +fourth
222 % reverting back to CRLF format
222 % reverting back to CRLF format
223 first\r
223 first\r (esc)
224 second\r
224 second\r (esc)
225 third\r
225 third\r (esc)
226 % hg commit of inconsistent .txt file marked as binary (should work)
226 % hg commit of inconsistent .txt file marked as binary (should work)
227 % hg commit of inconsistent .txt file marked as native (should fail)
227 % hg commit of inconsistent .txt file marked as native (should fail)
228 abort: inconsistent newline style in a.txt
228 abort: inconsistent newline style in a.txt
229
229
230 % hg commit --config eol.only-consistent=False (should work)
230 % hg commit --config eol.only-consistent=False (should work)
231 % hg commit of binary .txt file marked as native (binary files always okay)
231 % hg commit of binary .txt file marked as native (binary files always okay)
232 $ rm -r repo
232 $ rm -r repo
233 $ makerepo CRLF
233 $ makerepo CRLF
234 % setup CRLF repository
234 % setup CRLF repository
235 adding .hgeol
235 adding .hgeol
236 adding a.txt
236 adding a.txt
237
237
238 $ dotest LF
238 $ dotest LF
239 % hg clone repo repo-LF
239 % hg clone repo repo-LF
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 % printrepr.py a.txt
241 % a.txt
242 first
242 first
243 second
243 second
244 third
244 third
245 % hg cat a.txt
245 % hg cat a.txt
246 first\r
246 first\r (esc)
247 second\r
247 second\r (esc)
248 third\r
248 third\r (esc)
249 % printrepr.py a.txt
249 % a.txt
250 first
250 first
251 second
251 second
252 third
252 third
253 fourth
253 fourth
254 diff --git a/a.txt b/a.txt
254 diff --git a/a.txt b/a.txt
255 --- a/a.txt
255 --- a/a.txt
256 +++ b/a.txt
256 +++ b/a.txt
257 @@ -1,3 +1,4 @@
257 @@ -1,3 +1,4 @@
258 first\r
258 first\r (esc)
259 second\r
259 second\r (esc)
260 third\r
260 third\r (esc)
261 +fourth\r
261 +fourth\r (esc)
262 % switching encoding from '\n' to '\r\n'
262 % switching encoding from '\n' to '\r\n'
263 % hg diff only reports a single changed line:
263 % hg diff only reports a single changed line:
264 diff --git a/a.txt b/a.txt
264 diff --git a/a.txt b/a.txt
265 --- a/a.txt
265 --- a/a.txt
266 +++ b/a.txt
266 +++ b/a.txt
267 @@ -1,3 +1,4 @@
267 @@ -1,3 +1,4 @@
268 first\r
268 first\r (esc)
269 second\r
269 second\r (esc)
270 third\r
270 third\r (esc)
271 +fourth\r
271 +fourth\r (esc)
272 % reverting back to LF format
272 % reverting back to LF format
273 first
273 first
274 second
274 second
275 third
275 third
276 % hg commit of inconsistent .txt file marked as binary (should work)
276 % hg commit of inconsistent .txt file marked as binary (should work)
277 % hg commit of inconsistent .txt file marked as native (should fail)
277 % hg commit of inconsistent .txt file marked as native (should fail)
278 abort: inconsistent newline style in a.txt
278 abort: inconsistent newline style in a.txt
279
279
280 % hg commit --config eol.only-consistent=False (should work)
280 % hg commit --config eol.only-consistent=False (should work)
281 % hg commit of binary .txt file marked as native (binary files always okay)
281 % hg commit of binary .txt file marked as native (binary files always okay)
282 $ dotest CRLF
282 $ dotest CRLF
283 % hg clone repo repo-CRLF
283 % hg clone repo repo-CRLF
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 % printrepr.py a.txt
285 % a.txt
286 first\r
286 first\r (esc)
287 second\r
287 second\r (esc)
288 third\r
288 third\r (esc)
289 % hg cat a.txt
289 % hg cat a.txt
290 first\r
290 first\r (esc)
291 second\r
291 second\r (esc)
292 third\r
292 third\r (esc)
293 % printrepr.py a.txt
293 % a.txt
294 first\r
294 first\r (esc)
295 second\r
295 second\r (esc)
296 third\r
296 third\r (esc)
297 fourth\r
297 fourth\r (esc)
298 diff --git a/a.txt b/a.txt
298 diff --git a/a.txt b/a.txt
299 --- a/a.txt
299 --- a/a.txt
300 +++ b/a.txt
300 +++ b/a.txt
301 @@ -1,3 +1,4 @@
301 @@ -1,3 +1,4 @@
302 first\r
302 first\r (esc)
303 second\r
303 second\r (esc)
304 third\r
304 third\r (esc)
305 +fourth\r
305 +fourth\r (esc)
306 % switching encoding from '\r\n' to '\n'
306 % switching encoding from '\r\n' to '\n'
307 % hg diff only reports a single changed line:
307 % hg diff only reports a single changed line:
308 diff --git a/a.txt b/a.txt
308 diff --git a/a.txt b/a.txt
309 --- a/a.txt
309 --- a/a.txt
310 +++ b/a.txt
310 +++ b/a.txt
311 @@ -1,3 +1,4 @@
311 @@ -1,3 +1,4 @@
312 first\r
312 first\r (esc)
313 second\r
313 second\r (esc)
314 third\r
314 third\r (esc)
315 +fourth\r
315 +fourth\r (esc)
316 % reverting back to CRLF format
316 % reverting back to CRLF format
317 first\r
317 first\r (esc)
318 second\r
318 second\r (esc)
319 third\r
319 third\r (esc)
320 % hg commit of inconsistent .txt file marked as binary (should work)
320 % hg commit of inconsistent .txt file marked as binary (should work)
321 % hg commit of inconsistent .txt file marked as native (should fail)
321 % hg commit of inconsistent .txt file marked as native (should fail)
322 abort: inconsistent newline style in a.txt
322 abort: inconsistent newline style in a.txt
323
323
324 % hg commit --config eol.only-consistent=False (should work)
324 % hg commit --config eol.only-consistent=False (should work)
325 % hg commit of binary .txt file marked as native (binary files always okay)
325 % hg commit of binary .txt file marked as native (binary files always okay)
326 $ rm -r repo
326 $ rm -r repo
327
327
328 Mixed tests
328 Mixed tests
329
329
330 $ makemixedrepo LF
330 $ makemixedrepo LF
331
331
332 # setup LF repository
332 # setup LF repository
333 adding unix.txt
333 adding unix.txt
334 adding win.txt
334 adding win.txt
335 # setting repository-native EOLs to LF
335 # setting repository-native EOLs to LF
336 adding .hgeol
336 adding .hgeol
337 $ testmixed LF
337 $ testmixed LF
338
338
339 % hg clone mixed mixed-LF
339 % hg clone mixed mixed-LF
340 updating to branch default
340 updating to branch default
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 % hg status (eol extension not yet activated)
342 % hg status (eol extension not yet activated)
343 % hg status (eol activated)
343 % hg status (eol activated)
344 M win.txt
344 M win.txt
345 % hg commit
345 % hg commit
346 % hg status
346 % hg status
347 $ testmixed CRLF
347 $ testmixed CRLF
348
348
349 % hg clone mixed mixed-CRLF
349 % hg clone mixed mixed-CRLF
350 updating to branch default
350 updating to branch default
351 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 % hg status (eol extension not yet activated)
352 % hg status (eol extension not yet activated)
353 % hg status (eol activated)
353 % hg status (eol activated)
354 M win.txt
354 M win.txt
355 % hg commit
355 % hg commit
356 % hg status
356 % hg status
357 $ rm -r mixed
357 $ rm -r mixed
358 $ makemixedrepo CRLF
358 $ makemixedrepo CRLF
359
359
360 # setup CRLF repository
360 # setup CRLF repository
361 adding unix.txt
361 adding unix.txt
362 adding win.txt
362 adding win.txt
363 # setting repository-native EOLs to CRLF
363 # setting repository-native EOLs to CRLF
364 adding .hgeol
364 adding .hgeol
365 $ testmixed LF
365 $ testmixed LF
366
366
367 % hg clone mixed mixed-LF
367 % hg clone mixed mixed-LF
368 updating to branch default
368 updating to branch default
369 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 % hg status (eol extension not yet activated)
370 % hg status (eol extension not yet activated)
371 % hg status (eol activated)
371 % hg status (eol activated)
372 M unix.txt
372 M unix.txt
373 % hg commit
373 % hg commit
374 % hg status
374 % hg status
375 $ testmixed CRLF
375 $ testmixed CRLF
376
376
377 % hg clone mixed mixed-CRLF
377 % hg clone mixed mixed-CRLF
378 updating to branch default
378 updating to branch default
379 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 % hg status (eol extension not yet activated)
380 % hg status (eol extension not yet activated)
381 % hg status (eol activated)
381 % hg status (eol activated)
382 M unix.txt
382 M unix.txt
383 % hg commit
383 % hg commit
384 % hg status
384 % hg status
385 $ rm -r mixed
385 $ rm -r mixed
@@ -1,385 +1,385 b''
1
1
2 $ hg init
2 $ hg init
3
3
4 New file:
4 New file:
5
5
6 $ hg import -d "1000000 0" -mnew - <<EOF
6 $ hg import -d "1000000 0" -mnew - <<EOF
7 > diff --git a/new b/new
7 > diff --git a/new b/new
8 > new file mode 100644
8 > new file mode 100644
9 > index 0000000..7898192
9 > index 0000000..7898192
10 > --- /dev/null
10 > --- /dev/null
11 > +++ b/new
11 > +++ b/new
12 > @@ -0,0 +1 @@
12 > @@ -0,0 +1 @@
13 > +a
13 > +a
14 > EOF
14 > EOF
15 applying patch from stdin
15 applying patch from stdin
16
16
17 $ hg tip -q
17 $ hg tip -q
18 0:ae3ee40d2079
18 0:ae3ee40d2079
19
19
20 New empty file:
20 New empty file:
21
21
22 $ hg import -d "1000000 0" -mempty - <<EOF
22 $ hg import -d "1000000 0" -mempty - <<EOF
23 > diff --git a/empty b/empty
23 > diff --git a/empty b/empty
24 > new file mode 100644
24 > new file mode 100644
25 > EOF
25 > EOF
26 applying patch from stdin
26 applying patch from stdin
27
27
28 $ hg tip -q
28 $ hg tip -q
29 1:ab199dc869b5
29 1:ab199dc869b5
30
30
31 $ hg locate empty
31 $ hg locate empty
32 empty
32 empty
33
33
34 chmod +x:
34 chmod +x:
35
35
36 $ hg import -d "1000000 0" -msetx - <<EOF
36 $ hg import -d "1000000 0" -msetx - <<EOF
37 > diff --git a/new b/new
37 > diff --git a/new b/new
38 > old mode 100644
38 > old mode 100644
39 > new mode 100755
39 > new mode 100755
40 > EOF
40 > EOF
41 applying patch from stdin
41 applying patch from stdin
42
42
43 $ hg tip -q
43 $ hg tip -q
44 2:3a34410f282e
44 2:3a34410f282e
45
45
46 $ test -x new
46 $ test -x new
47
47
48 Copy:
48 Copy:
49
49
50 $ hg import -d "1000000 0" -mcopy - <<EOF
50 $ hg import -d "1000000 0" -mcopy - <<EOF
51 > diff --git a/new b/copy
51 > diff --git a/new b/copy
52 > old mode 100755
52 > old mode 100755
53 > new mode 100644
53 > new mode 100644
54 > similarity index 100%
54 > similarity index 100%
55 > copy from new
55 > copy from new
56 > copy to copy
56 > copy to copy
57 > diff --git a/new b/copyx
57 > diff --git a/new b/copyx
58 > similarity index 100%
58 > similarity index 100%
59 > copy from new
59 > copy from new
60 > copy to copyx
60 > copy to copyx
61 > EOF
61 > EOF
62 applying patch from stdin
62 applying patch from stdin
63
63
64 $ hg tip -q
64 $ hg tip -q
65 3:37bacb7ca14d
65 3:37bacb7ca14d
66
66
67 $ if "$TESTDIR/hghave" -q execbit; then
67 $ if "$TESTDIR/hghave" -q execbit; then
68 > test -f copy -a ! -x copy || echo bad
68 > test -f copy -a ! -x copy || echo bad
69 > test -x copyx || echo bad
69 > test -x copyx || echo bad
70 > else
70 > else
71 > test -f copy || echo bad
71 > test -f copy || echo bad
72 > fi
72 > fi
73
73
74 $ cat copy
74 $ cat copy
75 a
75 a
76
76
77 $ hg cat copy
77 $ hg cat copy
78 a
78 a
79
79
80 Rename:
80 Rename:
81
81
82 $ hg import -d "1000000 0" -mrename - <<EOF
82 $ hg import -d "1000000 0" -mrename - <<EOF
83 > diff --git a/copy b/rename
83 > diff --git a/copy b/rename
84 > similarity index 100%
84 > similarity index 100%
85 > rename from copy
85 > rename from copy
86 > rename to rename
86 > rename to rename
87 > EOF
87 > EOF
88 applying patch from stdin
88 applying patch from stdin
89
89
90 $ hg tip -q
90 $ hg tip -q
91 4:47b81a94361d
91 4:47b81a94361d
92
92
93 $ hg locate
93 $ hg locate
94 copyx
94 copyx
95 empty
95 empty
96 new
96 new
97 rename
97 rename
98
98
99 Delete:
99 Delete:
100
100
101 $ hg import -d "1000000 0" -mdelete - <<EOF
101 $ hg import -d "1000000 0" -mdelete - <<EOF
102 > diff --git a/copyx b/copyx
102 > diff --git a/copyx b/copyx
103 > deleted file mode 100755
103 > deleted file mode 100755
104 > index 7898192..0000000
104 > index 7898192..0000000
105 > --- a/copyx
105 > --- a/copyx
106 > +++ /dev/null
106 > +++ /dev/null
107 > @@ -1 +0,0 @@
107 > @@ -1 +0,0 @@
108 > -a
108 > -a
109 > EOF
109 > EOF
110 applying patch from stdin
110 applying patch from stdin
111
111
112 $ hg tip -q
112 $ hg tip -q
113 5:d9b001d98336
113 5:d9b001d98336
114
114
115 $ hg locate
115 $ hg locate
116 empty
116 empty
117 new
117 new
118 rename
118 rename
119
119
120 $ test -f copyx
120 $ test -f copyx
121 [1]
121 [1]
122
122
123 Regular diff:
123 Regular diff:
124
124
125 $ hg import -d "1000000 0" -mregular - <<EOF
125 $ hg import -d "1000000 0" -mregular - <<EOF
126 > diff --git a/rename b/rename
126 > diff --git a/rename b/rename
127 > index 7898192..72e1fe3 100644
127 > index 7898192..72e1fe3 100644
128 > --- a/rename
128 > --- a/rename
129 > +++ b/rename
129 > +++ b/rename
130 > @@ -1 +1,5 @@
130 > @@ -1 +1,5 @@
131 > a
131 > a
132 > +a
132 > +a
133 > +a
133 > +a
134 > +a
134 > +a
135 > +a
135 > +a
136 > EOF
136 > EOF
137 applying patch from stdin
137 applying patch from stdin
138
138
139 $ hg tip -q
139 $ hg tip -q
140 6:ebe901e7576b
140 6:ebe901e7576b
141
141
142 Copy and modify:
142 Copy and modify:
143
143
144 $ hg import -d "1000000 0" -mcopymod - <<EOF
144 $ hg import -d "1000000 0" -mcopymod - <<EOF
145 > diff --git a/rename b/copy2
145 > diff --git a/rename b/copy2
146 > similarity index 80%
146 > similarity index 80%
147 > copy from rename
147 > copy from rename
148 > copy to copy2
148 > copy to copy2
149 > index 72e1fe3..b53c148 100644
149 > index 72e1fe3..b53c148 100644
150 > --- a/rename
150 > --- a/rename
151 > +++ b/copy2
151 > +++ b/copy2
152 > @@ -1,5 +1,5 @@
152 > @@ -1,5 +1,5 @@
153 > a
153 > a
154 > a
154 > a
155 > -a
155 > -a
156 > +b
156 > +b
157 > a
157 > a
158 > a
158 > a
159 > EOF
159 > EOF
160 applying patch from stdin
160 applying patch from stdin
161
161
162 $ hg tip -q
162 $ hg tip -q
163 7:18f368958ecd
163 7:18f368958ecd
164
164
165 $ hg cat copy2
165 $ hg cat copy2
166 a
166 a
167 a
167 a
168 b
168 b
169 a
169 a
170 a
170 a
171
171
172 Rename and modify:
172 Rename and modify:
173
173
174 $ hg import -d "1000000 0" -mrenamemod - <<EOF
174 $ hg import -d "1000000 0" -mrenamemod - <<EOF
175 > diff --git a/copy2 b/rename2
175 > diff --git a/copy2 b/rename2
176 > similarity index 80%
176 > similarity index 80%
177 > rename from copy2
177 > rename from copy2
178 > rename to rename2
178 > rename to rename2
179 > index b53c148..8f81e29 100644
179 > index b53c148..8f81e29 100644
180 > --- a/copy2
180 > --- a/copy2
181 > +++ b/rename2
181 > +++ b/rename2
182 > @@ -1,5 +1,5 @@
182 > @@ -1,5 +1,5 @@
183 > a
183 > a
184 > a
184 > a
185 > b
185 > b
186 > -a
186 > -a
187 > +c
187 > +c
188 > a
188 > a
189 > EOF
189 > EOF
190 applying patch from stdin
190 applying patch from stdin
191
191
192 $ hg tip -q
192 $ hg tip -q
193 8:c32b0d7e6f44
193 8:c32b0d7e6f44
194
194
195 $ hg locate copy2
195 $ hg locate copy2
196 [1]
196 [1]
197 $ hg cat rename2
197 $ hg cat rename2
198 a
198 a
199 a
199 a
200 b
200 b
201 c
201 c
202 a
202 a
203
203
204 One file renamed multiple times:
204 One file renamed multiple times:
205
205
206 $ hg import -d "1000000 0" -mmultirenames - <<EOF
206 $ hg import -d "1000000 0" -mmultirenames - <<EOF
207 > diff --git a/rename2 b/rename3
207 > diff --git a/rename2 b/rename3
208 > rename from rename2
208 > rename from rename2
209 > rename to rename3
209 > rename to rename3
210 > diff --git a/rename2 b/rename3-2
210 > diff --git a/rename2 b/rename3-2
211 > rename from rename2
211 > rename from rename2
212 > rename to rename3-2
212 > rename to rename3-2
213 > EOF
213 > EOF
214 applying patch from stdin
214 applying patch from stdin
215
215
216 $ hg tip -q
216 $ hg tip -q
217 9:034a6bf95330
217 9:034a6bf95330
218
218
219 $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
219 $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
220 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
220 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
221
221
222 $ hg locate rename2 rename3 rename3-2
222 $ hg locate rename2 rename3 rename3-2
223 rename3
223 rename3
224 rename3-2
224 rename3-2
225
225
226 $ hg cat rename3
226 $ hg cat rename3
227 a
227 a
228 a
228 a
229 b
229 b
230 c
230 c
231 a
231 a
232
232
233 $ hg cat rename3-2
233 $ hg cat rename3-2
234 a
234 a
235 a
235 a
236 b
236 b
237 c
237 c
238 a
238 a
239
239
240 $ echo foo > foo
240 $ echo foo > foo
241 $ hg add foo
241 $ hg add foo
242 $ hg ci -m 'add foo'
242 $ hg ci -m 'add foo'
243
243
244 Binary files and regular patch hunks:
244 Binary files and regular patch hunks:
245
245
246 $ hg import -d "1000000 0" -m binaryregular - <<EOF
246 $ hg import -d "1000000 0" -m binaryregular - <<EOF
247 > diff --git a/binary b/binary
247 > diff --git a/binary b/binary
248 > new file mode 100644
248 > new file mode 100644
249 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
249 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
250 > GIT binary patch
250 > GIT binary patch
251 > literal 4
251 > literal 4
252 > Lc\${NkU|;|M00aO5
252 > Lc\${NkU|;|M00aO5
253 >
253 >
254 > diff --git a/foo b/foo2
254 > diff --git a/foo b/foo2
255 > rename from foo
255 > rename from foo
256 > rename to foo2
256 > rename to foo2
257 > EOF
257 > EOF
258 applying patch from stdin
258 applying patch from stdin
259
259
260 $ hg tip -q
260 $ hg tip -q
261 11:c39bce63e786
261 11:c39bce63e786
262
262
263 $ cat foo2
263 $ cat foo2
264 foo
264 foo
265
265
266 $ hg manifest --debug | grep binary
266 $ hg manifest --debug | grep binary
267 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
267 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary
268
268
269 Multiple binary files:
269 Multiple binary files:
270
270
271 $ hg import -d "1000000 0" -m multibinary - <<EOF
271 $ hg import -d "1000000 0" -m multibinary - <<EOF
272 > diff --git a/mbinary1 b/mbinary1
272 > diff --git a/mbinary1 b/mbinary1
273 > new file mode 100644
273 > new file mode 100644
274 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
274 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4
275 > GIT binary patch
275 > GIT binary patch
276 > literal 4
276 > literal 4
277 > Lc\${NkU|;|M00aO5
277 > Lc\${NkU|;|M00aO5
278 >
278 >
279 > diff --git a/mbinary2 b/mbinary2
279 > diff --git a/mbinary2 b/mbinary2
280 > new file mode 100644
280 > new file mode 100644
281 > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
281 > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490
282 > GIT binary patch
282 > GIT binary patch
283 > literal 5
283 > literal 5
284 > Mc\${NkU|\`?^000jF3jhEB
284 > Mc\${NkU|\`?^000jF3jhEB
285 >
285 >
286 > EOF
286 > EOF
287 applying patch from stdin
287 applying patch from stdin
288
288
289 $ hg tip -q
289 $ hg tip -q
290 12:30b530085242
290 12:30b530085242
291
291
292 $ hg manifest --debug | grep mbinary
292 $ hg manifest --debug | grep mbinary
293 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
293 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
294 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
294 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2
295
295
296 Filenames with spaces:
296 Filenames with spaces:
297
297
298 $ hg import -d "1000000 0" -m spaces - <<EOF
298 $ hg import -d "1000000 0" -m spaces - <<EOF
299 > diff --git a/foo bar b/foo bar
299 > diff --git a/foo bar b/foo bar
300 > new file mode 100644
300 > new file mode 100644
301 > index 0000000..257cc56
301 > index 0000000..257cc56
302 > --- /dev/null
302 > --- /dev/null
303 > +++ b/foo bar
303 > +++ b/foo bar
304 > @@ -0,0 +1 @@
304 > @@ -0,0 +1 @@
305 > +foo
305 > +foo
306 > EOF
306 > EOF
307 applying patch from stdin
307 applying patch from stdin
308
308
309 $ hg tip -q
309 $ hg tip -q
310 13:04750ef42fb3
310 13:04750ef42fb3
311
311
312 $ cat "foo bar"
312 $ cat "foo bar"
313 foo
313 foo
314
314
315 Copy then modify the original file:
315 Copy then modify the original file:
316
316
317 $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF
317 $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF
318 > diff --git a/foo2 b/foo2
318 > diff --git a/foo2 b/foo2
319 > index 257cc56..fe08ec6 100644
319 > index 257cc56..fe08ec6 100644
320 > --- a/foo2
320 > --- a/foo2
321 > +++ b/foo2
321 > +++ b/foo2
322 > @@ -1 +1,2 @@
322 > @@ -1 +1,2 @@
323 > foo
323 > foo
324 > +new line
324 > +new line
325 > diff --git a/foo2 b/foo3
325 > diff --git a/foo2 b/foo3
326 > similarity index 100%
326 > similarity index 100%
327 > copy from foo2
327 > copy from foo2
328 > copy to foo3
328 > copy to foo3
329 > EOF
329 > EOF
330 applying patch from stdin
330 applying patch from stdin
331
331
332 $ hg tip -q
332 $ hg tip -q
333 14:c4cd9cdeaa74
333 14:c4cd9cdeaa74
334
334
335 $ cat foo3
335 $ cat foo3
336 foo
336 foo
337
337
338 Move text file and patch as binary
338 Move text file and patch as binary
339
339
340 $ echo a > text2
340 $ echo a > text2
341 $ hg ci -Am0
341 $ hg ci -Am0
342 adding text2
342 adding text2
343 $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF"
343 $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF"
344 > diff --git a/text2 b/binary2
344 > diff --git a/text2 b/binary2
345 > rename from text2
345 > rename from text2
346 > rename to binary2
346 > rename to binary2
347 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757
347 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757
348 > GIT binary patch
348 > GIT binary patch
349 > literal 5
349 > literal 5
350 > Mc$`b*O5$Pw00T?_*Z=?k
350 > Mc$`b*O5$Pw00T?_*Z=?k
351 >
351 >
352 > EOF
352 > EOF
353 applying patch from stdin
353 applying patch from stdin
354
354
355 $ python $TESTDIR/printrepr.py < binary2
355 $ cat binary2
356 a
356 a
357 b
357 b
358 \x00
358 \x00 (no-eol) (esc)
359
359
360 $ hg st --copies --change .
360 $ hg st --copies --change .
361 A binary2
361 A binary2
362 text2
362 text2
363 R text2
363 R text2
364 $ cd ..
364 $ cd ..
365
365
366 Consecutive import with renames (issue2459)
366 Consecutive import with renames (issue2459)
367
367
368 $ hg init issue2459
368 $ hg init issue2459
369 $ cd issue2459
369 $ cd issue2459
370 $ hg import --no-commit --force - <<EOF
370 $ hg import --no-commit --force - <<EOF
371 > diff --git a/a b/a
371 > diff --git a/a b/a
372 > new file mode 100644
372 > new file mode 100644
373 > EOF
373 > EOF
374 applying patch from stdin
374 applying patch from stdin
375 $ hg import --no-commit --force - <<EOF
375 $ hg import --no-commit --force - <<EOF
376 > diff --git a/a b/b
376 > diff --git a/a b/b
377 > rename from a
377 > rename from a
378 > rename to b
378 > rename to b
379 > EOF
379 > EOF
380 applying patch from stdin
380 applying patch from stdin
381 a has not been committed yet, so no copy data will be stored for b.
381 a has not been committed yet, so no copy data will be stored for b.
382 $ hg debugstate
382 $ hg debugstate
383 a 0 -1 unset b
383 a 0 -1 unset b
384 $ hg ci -m done
384 $ hg ci -m done
385 $ cd ..
385 $ cd ..
@@ -1,1079 +1,1077 b''
1 An attempt at more fully testing the hgweb web interface.
1 An attempt at more fully testing the hgweb web interface.
2 The following things are tested elsewhere and are therefore omitted:
2 The following things are tested elsewhere and are therefore omitted:
3 - archive, tested in test-archive
3 - archive, tested in test-archive
4 - unbundle, tested in test-push-http
4 - unbundle, tested in test-push-http
5 - changegroupsubset, tested in test-pull
5 - changegroupsubset, tested in test-pull
6
6
7 Set up the repo
7 Set up the repo
8
8
9 $ hg init test
9 $ hg init test
10 $ cd test
10 $ cd test
11 $ mkdir da
11 $ mkdir da
12 $ echo foo > da/foo
12 $ echo foo > da/foo
13 $ echo foo > foo
13 $ echo foo > foo
14 $ hg ci -Ambase
14 $ hg ci -Ambase
15 adding da/foo
15 adding da/foo
16 adding foo
16 adding foo
17 $ hg tag 1.0
17 $ hg tag 1.0
18 $ echo another > foo
18 $ echo another > foo
19 $ hg branch stable
19 $ hg branch stable
20 marked working directory as branch stable
20 marked working directory as branch stable
21 $ hg ci -Ambranch
21 $ hg ci -Ambranch
22 $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
22 $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
23 $ cat hg.pid >> $DAEMON_PIDS
23 $ cat hg.pid >> $DAEMON_PIDS
24
24
25 Logs and changes
25 Logs and changes
26
26
27 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/?style=atom'
27 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/?style=atom'
28 200 Script output follows
28 200 Script output follows
29
29
30 <?xml version="1.0" encoding="ascii"?>
30 <?xml version="1.0" encoding="ascii"?>
31 <feed xmlns="http://www.w3.org/2005/Atom">
31 <feed xmlns="http://www.w3.org/2005/Atom">
32 <!-- Changelog -->
32 <!-- Changelog -->
33 <id>http://*:$HGPORT/</id> (glob)
33 <id>http://*:$HGPORT/</id> (glob)
34 <link rel="self" href="http://*:$HGPORT/atom-log"/> (glob)
34 <link rel="self" href="http://*:$HGPORT/atom-log"/> (glob)
35 <link rel="alternate" href="http://*:$HGPORT/"/> (glob)
35 <link rel="alternate" href="http://*:$HGPORT/"/> (glob)
36 <title>test Changelog</title>
36 <title>test Changelog</title>
37 <updated>1970-01-01T00:00:00+00:00</updated>
37 <updated>1970-01-01T00:00:00+00:00</updated>
38
38
39 <entry>
39 <entry>
40 <title>branch</title>
40 <title>branch</title>
41 <id>http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
41 <id>http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
42 <link href="http://*:$HGPORT/rev/1d22e65f027e"/> (glob)
42 <link href="http://*:$HGPORT/rev/1d22e65f027e"/> (glob)
43 <author>
43 <author>
44 <name>test</name>
44 <name>test</name>
45 <email>&#116;&#101;&#115;&#116;</email>
45 <email>&#116;&#101;&#115;&#116;</email>
46 </author>
46 </author>
47 <updated>1970-01-01T00:00:00+00:00</updated>
47 <updated>1970-01-01T00:00:00+00:00</updated>
48 <published>1970-01-01T00:00:00+00:00</published>
48 <published>1970-01-01T00:00:00+00:00</published>
49 <content type="xhtml">
49 <content type="xhtml">
50 <div xmlns="http://www.w3.org/1999/xhtml">
50 <div xmlns="http://www.w3.org/1999/xhtml">
51 <pre xml:space="preserve">branch</pre>
51 <pre xml:space="preserve">branch</pre>
52 </div>
52 </div>
53 </content>
53 </content>
54 </entry>
54 </entry>
55 <entry>
55 <entry>
56 <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
56 <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
57 <id>http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
57 <id>http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
58 <link href="http://*:$HGPORT/rev/a4f92ed23982"/> (glob)
58 <link href="http://*:$HGPORT/rev/a4f92ed23982"/> (glob)
59 <author>
59 <author>
60 <name>test</name>
60 <name>test</name>
61 <email>&#116;&#101;&#115;&#116;</email>
61 <email>&#116;&#101;&#115;&#116;</email>
62 </author>
62 </author>
63 <updated>1970-01-01T00:00:00+00:00</updated>
63 <updated>1970-01-01T00:00:00+00:00</updated>
64 <published>1970-01-01T00:00:00+00:00</published>
64 <published>1970-01-01T00:00:00+00:00</published>
65 <content type="xhtml">
65 <content type="xhtml">
66 <div xmlns="http://www.w3.org/1999/xhtml">
66 <div xmlns="http://www.w3.org/1999/xhtml">
67 <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
67 <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
68 </div>
68 </div>
69 </content>
69 </content>
70 </entry>
70 </entry>
71 <entry>
71 <entry>
72 <title>base</title>
72 <title>base</title>
73 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
73 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
74 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
74 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
75 <author>
75 <author>
76 <name>test</name>
76 <name>test</name>
77 <email>&#116;&#101;&#115;&#116;</email>
77 <email>&#116;&#101;&#115;&#116;</email>
78 </author>
78 </author>
79 <updated>1970-01-01T00:00:00+00:00</updated>
79 <updated>1970-01-01T00:00:00+00:00</updated>
80 <published>1970-01-01T00:00:00+00:00</published>
80 <published>1970-01-01T00:00:00+00:00</published>
81 <content type="xhtml">
81 <content type="xhtml">
82 <div xmlns="http://www.w3.org/1999/xhtml">
82 <div xmlns="http://www.w3.org/1999/xhtml">
83 <pre xml:space="preserve">base</pre>
83 <pre xml:space="preserve">base</pre>
84 </div>
84 </div>
85 </content>
85 </content>
86 </entry>
86 </entry>
87
87
88 </feed>
88 </feed>
89 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/?style=atom'
89 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/?style=atom'
90 200 Script output follows
90 200 Script output follows
91
91
92 <?xml version="1.0" encoding="ascii"?>
92 <?xml version="1.0" encoding="ascii"?>
93 <feed xmlns="http://www.w3.org/2005/Atom">
93 <feed xmlns="http://www.w3.org/2005/Atom">
94 <!-- Changelog -->
94 <!-- Changelog -->
95 <id>http://*:$HGPORT/</id> (glob)
95 <id>http://*:$HGPORT/</id> (glob)
96 <link rel="self" href="http://*:$HGPORT/atom-log"/> (glob)
96 <link rel="self" href="http://*:$HGPORT/atom-log"/> (glob)
97 <link rel="alternate" href="http://*:$HGPORT/"/> (glob)
97 <link rel="alternate" href="http://*:$HGPORT/"/> (glob)
98 <title>test Changelog</title>
98 <title>test Changelog</title>
99 <updated>1970-01-01T00:00:00+00:00</updated>
99 <updated>1970-01-01T00:00:00+00:00</updated>
100
100
101 <entry>
101 <entry>
102 <title>branch</title>
102 <title>branch</title>
103 <id>http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
103 <id>http://*:$HGPORT/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
104 <link href="http://*:$HGPORT/rev/1d22e65f027e"/> (glob)
104 <link href="http://*:$HGPORT/rev/1d22e65f027e"/> (glob)
105 <author>
105 <author>
106 <name>test</name>
106 <name>test</name>
107 <email>&#116;&#101;&#115;&#116;</email>
107 <email>&#116;&#101;&#115;&#116;</email>
108 </author>
108 </author>
109 <updated>1970-01-01T00:00:00+00:00</updated>
109 <updated>1970-01-01T00:00:00+00:00</updated>
110 <published>1970-01-01T00:00:00+00:00</published>
110 <published>1970-01-01T00:00:00+00:00</published>
111 <content type="xhtml">
111 <content type="xhtml">
112 <div xmlns="http://www.w3.org/1999/xhtml">
112 <div xmlns="http://www.w3.org/1999/xhtml">
113 <pre xml:space="preserve">branch</pre>
113 <pre xml:space="preserve">branch</pre>
114 </div>
114 </div>
115 </content>
115 </content>
116 </entry>
116 </entry>
117 <entry>
117 <entry>
118 <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
118 <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
119 <id>http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
119 <id>http://*:$HGPORT/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
120 <link href="http://*:$HGPORT/rev/a4f92ed23982"/> (glob)
120 <link href="http://*:$HGPORT/rev/a4f92ed23982"/> (glob)
121 <author>
121 <author>
122 <name>test</name>
122 <name>test</name>
123 <email>&#116;&#101;&#115;&#116;</email>
123 <email>&#116;&#101;&#115;&#116;</email>
124 </author>
124 </author>
125 <updated>1970-01-01T00:00:00+00:00</updated>
125 <updated>1970-01-01T00:00:00+00:00</updated>
126 <published>1970-01-01T00:00:00+00:00</published>
126 <published>1970-01-01T00:00:00+00:00</published>
127 <content type="xhtml">
127 <content type="xhtml">
128 <div xmlns="http://www.w3.org/1999/xhtml">
128 <div xmlns="http://www.w3.org/1999/xhtml">
129 <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
129 <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
130 </div>
130 </div>
131 </content>
131 </content>
132 </entry>
132 </entry>
133 <entry>
133 <entry>
134 <title>base</title>
134 <title>base</title>
135 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
135 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
136 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
136 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
137 <author>
137 <author>
138 <name>test</name>
138 <name>test</name>
139 <email>&#116;&#101;&#115;&#116;</email>
139 <email>&#116;&#101;&#115;&#116;</email>
140 </author>
140 </author>
141 <updated>1970-01-01T00:00:00+00:00</updated>
141 <updated>1970-01-01T00:00:00+00:00</updated>
142 <published>1970-01-01T00:00:00+00:00</published>
142 <published>1970-01-01T00:00:00+00:00</published>
143 <content type="xhtml">
143 <content type="xhtml">
144 <div xmlns="http://www.w3.org/1999/xhtml">
144 <div xmlns="http://www.w3.org/1999/xhtml">
145 <pre xml:space="preserve">base</pre>
145 <pre xml:space="preserve">base</pre>
146 </div>
146 </div>
147 </content>
147 </content>
148 </entry>
148 </entry>
149
149
150 </feed>
150 </feed>
151 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/foo/?style=atom'
151 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/foo/?style=atom'
152 200 Script output follows
152 200 Script output follows
153
153
154 <?xml version="1.0" encoding="ascii"?>
154 <?xml version="1.0" encoding="ascii"?>
155 <feed xmlns="http://www.w3.org/2005/Atom">
155 <feed xmlns="http://www.w3.org/2005/Atom">
156 <id>http://*:$HGPORT/atom-log/tip/foo</id> (glob)
156 <id>http://*:$HGPORT/atom-log/tip/foo</id> (glob)
157 <link rel="self" href="http://*:$HGPORT/atom-log/tip/foo"/> (glob)
157 <link rel="self" href="http://*:$HGPORT/atom-log/tip/foo"/> (glob)
158 <title>test: foo history</title>
158 <title>test: foo history</title>
159 <updated>1970-01-01T00:00:00+00:00</updated>
159 <updated>1970-01-01T00:00:00+00:00</updated>
160
160
161 <entry>
161 <entry>
162 <title>base</title>
162 <title>base</title>
163 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
163 <id>http://*:$HGPORT/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
164 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
164 <link href="http://*:$HGPORT/rev/2ef0ac749a14"/> (glob)
165 <author>
165 <author>
166 <name>test</name>
166 <name>test</name>
167 <email>&#116;&#101;&#115;&#116;</email>
167 <email>&#116;&#101;&#115;&#116;</email>
168 </author>
168 </author>
169 <updated>1970-01-01T00:00:00+00:00</updated>
169 <updated>1970-01-01T00:00:00+00:00</updated>
170 <published>1970-01-01T00:00:00+00:00</published>
170 <published>1970-01-01T00:00:00+00:00</published>
171 <content type="xhtml">
171 <content type="xhtml">
172 <div xmlns="http://www.w3.org/1999/xhtml">
172 <div xmlns="http://www.w3.org/1999/xhtml">
173 <pre xml:space="preserve">base</pre>
173 <pre xml:space="preserve">base</pre>
174 </div>
174 </div>
175 </content>
175 </content>
176 </entry>
176 </entry>
177
177
178 </feed>
178 </feed>
179 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/shortlog/'
179 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/shortlog/'
180 200 Script output follows
180 200 Script output follows
181
181
182 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
182 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
183 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
183 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
184 <head>
184 <head>
185 <link rel="icon" href="/static/hgicon.png" type="image/png" />
185 <link rel="icon" href="/static/hgicon.png" type="image/png" />
186 <meta name="robots" content="index, nofollow" />
186 <meta name="robots" content="index, nofollow" />
187 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
187 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
188
188
189 <title>test: log</title>
189 <title>test: log</title>
190 <link rel="alternate" type="application/atom+xml"
190 <link rel="alternate" type="application/atom+xml"
191 href="/atom-log" title="Atom feed for test" />
191 href="/atom-log" title="Atom feed for test" />
192 <link rel="alternate" type="application/rss+xml"
192 <link rel="alternate" type="application/rss+xml"
193 href="/rss-log" title="RSS feed for test" />
193 href="/rss-log" title="RSS feed for test" />
194 </head>
194 </head>
195 <body>
195 <body>
196
196
197 <div class="container">
197 <div class="container">
198 <div class="menu">
198 <div class="menu">
199 <div class="logo">
199 <div class="logo">
200 <a href="http://mercurial.selenic.com/">
200 <a href="http://mercurial.selenic.com/">
201 <img src="/static/hglogo.png" alt="mercurial" /></a>
201 <img src="/static/hglogo.png" alt="mercurial" /></a>
202 </div>
202 </div>
203 <ul>
203 <ul>
204 <li class="active">log</li>
204 <li class="active">log</li>
205 <li><a href="/graph/1d22e65f027e">graph</a></li>
205 <li><a href="/graph/1d22e65f027e">graph</a></li>
206 <li><a href="/tags">tags</a></li>
206 <li><a href="/tags">tags</a></li>
207 <li><a href="/branches">branches</a></li>
207 <li><a href="/branches">branches</a></li>
208 </ul>
208 </ul>
209 <ul>
209 <ul>
210 <li><a href="/rev/1d22e65f027e">changeset</a></li>
210 <li><a href="/rev/1d22e65f027e">changeset</a></li>
211 <li><a href="/file/1d22e65f027e">browse</a></li>
211 <li><a href="/file/1d22e65f027e">browse</a></li>
212 </ul>
212 </ul>
213 <ul>
213 <ul>
214
214
215 </ul>
215 </ul>
216 <ul>
216 <ul>
217 <li><a href="/help">help</a></li>
217 <li><a href="/help">help</a></li>
218 </ul>
218 </ul>
219 </div>
219 </div>
220
220
221 <div class="main">
221 <div class="main">
222 <h2><a href="/">test</a></h2>
222 <h2><a href="/">test</a></h2>
223 <h3>log</h3>
223 <h3>log</h3>
224
224
225 <form class="search" action="/log">
225 <form class="search" action="/log">
226
226
227 <p><input name="rev" id="search1" type="text" size="30" /></p>
227 <p><input name="rev" id="search1" type="text" size="30" /></p>
228 <div id="hint">find changesets by author, revision,
228 <div id="hint">find changesets by author, revision,
229 files, or words in the commit message</div>
229 files, or words in the commit message</div>
230 </form>
230 </form>
231
231
232 <div class="navigate">
232 <div class="navigate">
233 <a href="/shortlog/2?revcount=30">less</a>
233 <a href="/shortlog/2?revcount=30">less</a>
234 <a href="/shortlog/2?revcount=120">more</a>
234 <a href="/shortlog/2?revcount=120">more</a>
235 | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a>
235 | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a>
236 </div>
236 </div>
237
237
238 <table class="bigtable">
238 <table class="bigtable">
239 <tr>
239 <tr>
240 <th class="age">age</th>
240 <th class="age">age</th>
241 <th class="author">author</th>
241 <th class="author">author</th>
242 <th class="description">description</th>
242 <th class="description">description</th>
243 </tr>
243 </tr>
244 <tr class="parity0">
244 <tr class="parity0">
245 <td class="age">1970-01-01</td>
245 <td class="age">1970-01-01</td>
246 <td class="author">test</td>
246 <td class="author">test</td>
247 <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
247 <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
248 </tr>
248 </tr>
249 <tr class="parity1">
249 <tr class="parity1">
250 <td class="age">1970-01-01</td>
250 <td class="age">1970-01-01</td>
251 <td class="author">test</td>
251 <td class="author">test</td>
252 <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
252 <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
253 </tr>
253 </tr>
254 <tr class="parity0">
254 <tr class="parity0">
255 <td class="age">1970-01-01</td>
255 <td class="age">1970-01-01</td>
256 <td class="author">test</td>
256 <td class="author">test</td>
257 <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
257 <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
258 </tr>
258 </tr>
259
259
260 </table>
260 </table>
261
261
262 <div class="navigate">
262 <div class="navigate">
263 <a href="/shortlog/2?revcount=30">less</a>
263 <a href="/shortlog/2?revcount=30">less</a>
264 <a href="/shortlog/2?revcount=120">more</a>
264 <a href="/shortlog/2?revcount=120">more</a>
265 | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a>
265 | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a>
266 </div>
266 </div>
267
267
268 </div>
268 </div>
269 </div>
269 </div>
270
270
271
271
272
272
273 </body>
273 </body>
274 </html>
274 </html>
275
275
276 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/0/'
276 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/0/'
277 200 Script output follows
277 200 Script output follows
278
278
279 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
279 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
280 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
280 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
281 <head>
281 <head>
282 <link rel="icon" href="/static/hgicon.png" type="image/png" />
282 <link rel="icon" href="/static/hgicon.png" type="image/png" />
283 <meta name="robots" content="index, nofollow" />
283 <meta name="robots" content="index, nofollow" />
284 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
284 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
285
285
286 <title>test: 2ef0ac749a14</title>
286 <title>test: 2ef0ac749a14</title>
287 </head>
287 </head>
288 <body>
288 <body>
289 <div class="container">
289 <div class="container">
290 <div class="menu">
290 <div class="menu">
291 <div class="logo">
291 <div class="logo">
292 <a href="http://mercurial.selenic.com/">
292 <a href="http://mercurial.selenic.com/">
293 <img src="/static/hglogo.png" alt="mercurial" /></a>
293 <img src="/static/hglogo.png" alt="mercurial" /></a>
294 </div>
294 </div>
295 <ul>
295 <ul>
296 <li><a href="/shortlog/2ef0ac749a14">log</a></li>
296 <li><a href="/shortlog/2ef0ac749a14">log</a></li>
297 <li><a href="/graph/2ef0ac749a14">graph</a></li>
297 <li><a href="/graph/2ef0ac749a14">graph</a></li>
298 <li><a href="/tags">tags</a></li>
298 <li><a href="/tags">tags</a></li>
299 <li><a href="/branches">branches</a></li>
299 <li><a href="/branches">branches</a></li>
300 </ul>
300 </ul>
301 <ul>
301 <ul>
302 <li class="active">changeset</li>
302 <li class="active">changeset</li>
303 <li><a href="/raw-rev/2ef0ac749a14">raw</a></li>
303 <li><a href="/raw-rev/2ef0ac749a14">raw</a></li>
304 <li><a href="/file/2ef0ac749a14">browse</a></li>
304 <li><a href="/file/2ef0ac749a14">browse</a></li>
305 </ul>
305 </ul>
306 <ul>
306 <ul>
307
307
308 </ul>
308 </ul>
309 <ul>
309 <ul>
310 <li><a href="/help">help</a></li>
310 <li><a href="/help">help</a></li>
311 </ul>
311 </ul>
312 </div>
312 </div>
313
313
314 <div class="main">
314 <div class="main">
315
315
316 <h2><a href="/">test</a></h2>
316 <h2><a href="/">test</a></h2>
317 <h3>changeset 0:2ef0ac749a14 <span class="tag">1.0</span> </h3>
317 <h3>changeset 0:2ef0ac749a14 <span class="tag">1.0</span> </h3>
318
318
319 <form class="search" action="/log">
319 <form class="search" action="/log">
320
320
321 <p><input name="rev" id="search1" type="text" size="30" /></p>
321 <p><input name="rev" id="search1" type="text" size="30" /></p>
322 <div id="hint">find changesets by author, revision,
322 <div id="hint">find changesets by author, revision,
323 files, or words in the commit message</div>
323 files, or words in the commit message</div>
324 </form>
324 </form>
325
325
326 <div class="description">base</div>
326 <div class="description">base</div>
327
327
328 <table id="changesetEntry">
328 <table id="changesetEntry">
329 <tr>
329 <tr>
330 <th class="author">author</th>
330 <th class="author">author</th>
331 <td class="author">&#116;&#101;&#115;&#116;</td>
331 <td class="author">&#116;&#101;&#115;&#116;</td>
332 </tr>
332 </tr>
333 <tr>
333 <tr>
334 <th class="date">date</th>
334 <th class="date">date</th>
335 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
335 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
336 <tr>
336 <tr>
337 <th class="author">parents</th>
337 <th class="author">parents</th>
338 <td class="author"></td>
338 <td class="author"></td>
339 </tr>
339 </tr>
340 <tr>
340 <tr>
341 <th class="author">children</th>
341 <th class="author">children</th>
342 <td class="author"> <a href="/rev/a4f92ed23982">a4f92ed23982</a></td>
342 <td class="author"> <a href="/rev/a4f92ed23982">a4f92ed23982</a></td>
343 </tr>
343 </tr>
344 <tr>
344 <tr>
345 <th class="files">files</th>
345 <th class="files">files</th>
346 <td class="files"><a href="/file/2ef0ac749a14/da/foo">da/foo</a> <a href="/file/2ef0ac749a14/foo">foo</a> </td>
346 <td class="files"><a href="/file/2ef0ac749a14/da/foo">da/foo</a> <a href="/file/2ef0ac749a14/foo">foo</a> </td>
347 </tr>
347 </tr>
348 </table>
348 </table>
349
349
350 <div class="overflow">
350 <div class="overflow">
351 <div class="sourcefirst"> line diff</div>
351 <div class="sourcefirst"> line diff</div>
352
352
353 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
353 <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
354 </span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/da/foo Thu Jan 01 00:00:00 1970 +0000
354 </span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/da/foo Thu Jan 01 00:00:00 1970 +0000
355 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
355 </span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
356 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+foo
356 </span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+foo
357 </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
357 </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
358 </span><a href="#l2.2" id="l2.2"> 2.2</a> <span class="plusline">+++ b/foo Thu Jan 01 00:00:00 1970 +0000
358 </span><a href="#l2.2" id="l2.2"> 2.2</a> <span class="plusline">+++ b/foo Thu Jan 01 00:00:00 1970 +0000
359 </span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="atline">@@ -0,0 +1,1 @@
359 </span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="atline">@@ -0,0 +1,1 @@
360 </span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="plusline">+foo
360 </span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="plusline">+foo
361 </span></pre></div>
361 </span></pre></div>
362 </div>
362 </div>
363
363
364 </div>
364 </div>
365 </div>
365 </div>
366
366
367
367
368 </body>
368 </body>
369 </html>
369 </html>
370
370
371 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/1/?style=raw'
371 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/1/?style=raw'
372 200 Script output follows
372 200 Script output follows
373
373
374
374
375 # HG changeset patch
375 # HG changeset patch
376 # User test
376 # User test
377 # Date 0 0
377 # Date 0 0
378 # Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de
378 # Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de
379 # Parent 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
379 # Parent 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
380 Added tag 1.0 for changeset 2ef0ac749a14
380 Added tag 1.0 for changeset 2ef0ac749a14
381
381
382 diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags
382 diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags
383 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
383 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
384 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
384 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
385 @@ -0,0 +1,1 @@
385 @@ -0,0 +1,1 @@
386 +2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0
386 +2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0
387
387
388 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log?rev=base'
388 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log?rev=base'
389 200 Script output follows
389 200 Script output follows
390
390
391 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
391 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
392 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
392 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
393 <head>
393 <head>
394 <link rel="icon" href="/static/hgicon.png" type="image/png" />
394 <link rel="icon" href="/static/hgicon.png" type="image/png" />
395 <meta name="robots" content="index, nofollow" />
395 <meta name="robots" content="index, nofollow" />
396 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
396 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
397
397
398 <title>test: searching for base</title>
398 <title>test: searching for base</title>
399 </head>
399 </head>
400 <body>
400 <body>
401
401
402 <div class="container">
402 <div class="container">
403 <div class="menu">
403 <div class="menu">
404 <div class="logo">
404 <div class="logo">
405 <a href="http://mercurial.selenic.com/">
405 <a href="http://mercurial.selenic.com/">
406 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
406 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
407 </div>
407 </div>
408 <ul>
408 <ul>
409 <li><a href="/shortlog">log</a></li>
409 <li><a href="/shortlog">log</a></li>
410 <li><a href="/graph">graph</a></li>
410 <li><a href="/graph">graph</a></li>
411 <li><a href="/tags">tags</a></li>
411 <li><a href="/tags">tags</a></li>
412 <li><a href="/branches">branches</a></li>
412 <li><a href="/branches">branches</a></li>
413 <li><a href="/help">help</a></li>
413 <li><a href="/help">help</a></li>
414 </ul>
414 </ul>
415 </div>
415 </div>
416
416
417 <div class="main">
417 <div class="main">
418 <h2><a href="/">test</a></h2>
418 <h2><a href="/">test</a></h2>
419 <h3>searching for 'base'</h3>
419 <h3>searching for 'base'</h3>
420
420
421 <form class="search" action="/log">
421 <form class="search" action="/log">
422
422
423 <p><input name="rev" id="search1" type="text" size="30"></p>
423 <p><input name="rev" id="search1" type="text" size="30"></p>
424 <div id="hint">find changesets by author, revision,
424 <div id="hint">find changesets by author, revision,
425 files, or words in the commit message</div>
425 files, or words in the commit message</div>
426 </form>
426 </form>
427
427
428 <div class="navigate">
428 <div class="navigate">
429 <a href="/search/?rev=base&revcount=5">less</a>
429 <a href="/search/?rev=base&revcount=5">less</a>
430 <a href="/search/?rev=base&revcount=20">more</a>
430 <a href="/search/?rev=base&revcount=20">more</a>
431 </div>
431 </div>
432
432
433 <table class="bigtable">
433 <table class="bigtable">
434 <tr>
434 <tr>
435 <th class="age">age</th>
435 <th class="age">age</th>
436 <th class="author">author</th>
436 <th class="author">author</th>
437 <th class="description">description</th>
437 <th class="description">description</th>
438 </tr>
438 </tr>
439 <tr class="parity0">
439 <tr class="parity0">
440 <td class="age">1970-01-01</td>
440 <td class="age">1970-01-01</td>
441 <td class="author">test</td>
441 <td class="author">test</td>
442 <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
442 <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
443 </tr>
443 </tr>
444
444
445 </table>
445 </table>
446
446
447 <div class="navigate">
447 <div class="navigate">
448 <a href="/search/?rev=base&revcount=5">less</a>
448 <a href="/search/?rev=base&revcount=5">less</a>
449 <a href="/search/?rev=base&revcount=20">more</a>
449 <a href="/search/?rev=base&revcount=20">more</a>
450 </div>
450 </div>
451
451
452 </div>
452 </div>
453 </div>
453 </div>
454
454
455
455
456
456
457 </body>
457 </body>
458 </html>
458 </html>
459
459
460
460
461 File-related
461 File-related
462
462
463 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo/?style=raw'
463 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo/?style=raw'
464 200 Script output follows
464 200 Script output follows
465
465
466 foo
466 foo
467 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/annotate/1/foo/?style=raw'
467 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/annotate/1/foo/?style=raw'
468 200 Script output follows
468 200 Script output follows
469
469
470
470
471 test@0: foo
471 test@0: foo
472
472
473
473
474
474
475
475
476 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/?style=raw'
476 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/?style=raw'
477 200 Script output follows
477 200 Script output follows
478
478
479
479
480 drwxr-xr-x da
480 drwxr-xr-x da
481 -rw-r--r-- 45 .hgtags
481 -rw-r--r-- 45 .hgtags
482 -rw-r--r-- 4 foo
482 -rw-r--r-- 4 foo
483
483
484
484
485 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo'
485 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo'
486 200 Script output follows
486 200 Script output follows
487
487
488 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
488 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
489 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
489 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
490 <head>
490 <head>
491 <link rel="icon" href="/static/hgicon.png" type="image/png" />
491 <link rel="icon" href="/static/hgicon.png" type="image/png" />
492 <meta name="robots" content="index, nofollow" />
492 <meta name="robots" content="index, nofollow" />
493 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
493 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
494
494
495 <title>test: a4f92ed23982 foo</title>
495 <title>test: a4f92ed23982 foo</title>
496 </head>
496 </head>
497 <body>
497 <body>
498
498
499 <div class="container">
499 <div class="container">
500 <div class="menu">
500 <div class="menu">
501 <div class="logo">
501 <div class="logo">
502 <a href="http://mercurial.selenic.com/">
502 <a href="http://mercurial.selenic.com/">
503 <img src="/static/hglogo.png" alt="mercurial" /></a>
503 <img src="/static/hglogo.png" alt="mercurial" /></a>
504 </div>
504 </div>
505 <ul>
505 <ul>
506 <li><a href="/shortlog/a4f92ed23982">log</a></li>
506 <li><a href="/shortlog/a4f92ed23982">log</a></li>
507 <li><a href="/graph/a4f92ed23982">graph</a></li>
507 <li><a href="/graph/a4f92ed23982">graph</a></li>
508 <li><a href="/tags">tags</a></li>
508 <li><a href="/tags">tags</a></li>
509 <li><a href="/branches">branches</a></li>
509 <li><a href="/branches">branches</a></li>
510 </ul>
510 </ul>
511 <ul>
511 <ul>
512 <li><a href="/rev/a4f92ed23982">changeset</a></li>
512 <li><a href="/rev/a4f92ed23982">changeset</a></li>
513 <li><a href="/file/a4f92ed23982/">browse</a></li>
513 <li><a href="/file/a4f92ed23982/">browse</a></li>
514 </ul>
514 </ul>
515 <ul>
515 <ul>
516 <li class="active">file</li>
516 <li class="active">file</li>
517 <li><a href="/file/tip/foo">latest</a></li>
517 <li><a href="/file/tip/foo">latest</a></li>
518 <li><a href="/diff/a4f92ed23982/foo">diff</a></li>
518 <li><a href="/diff/a4f92ed23982/foo">diff</a></li>
519 <li><a href="/annotate/a4f92ed23982/foo">annotate</a></li>
519 <li><a href="/annotate/a4f92ed23982/foo">annotate</a></li>
520 <li><a href="/log/a4f92ed23982/foo">file log</a></li>
520 <li><a href="/log/a4f92ed23982/foo">file log</a></li>
521 <li><a href="/raw-file/a4f92ed23982/foo">raw</a></li>
521 <li><a href="/raw-file/a4f92ed23982/foo">raw</a></li>
522 </ul>
522 </ul>
523 <ul>
523 <ul>
524 <li><a href="/help">help</a></li>
524 <li><a href="/help">help</a></li>
525 </ul>
525 </ul>
526 </div>
526 </div>
527
527
528 <div class="main">
528 <div class="main">
529 <h2><a href="/">test</a></h2>
529 <h2><a href="/">test</a></h2>
530 <h3>view foo @ 1:a4f92ed23982</h3>
530 <h3>view foo @ 1:a4f92ed23982</h3>
531
531
532 <form class="search" action="/log">
532 <form class="search" action="/log">
533
533
534 <p><input name="rev" id="search1" type="text" size="30" /></p>
534 <p><input name="rev" id="search1" type="text" size="30" /></p>
535 <div id="hint">find changesets by author, revision,
535 <div id="hint">find changesets by author, revision,
536 files, or words in the commit message</div>
536 files, or words in the commit message</div>
537 </form>
537 </form>
538
538
539 <div class="description">Added tag 1.0 for changeset 2ef0ac749a14</div>
539 <div class="description">Added tag 1.0 for changeset 2ef0ac749a14</div>
540
540
541 <table id="changesetEntry">
541 <table id="changesetEntry">
542 <tr>
542 <tr>
543 <th class="author">author</th>
543 <th class="author">author</th>
544 <td class="author">&#116;&#101;&#115;&#116;</td>
544 <td class="author">&#116;&#101;&#115;&#116;</td>
545 </tr>
545 </tr>
546 <tr>
546 <tr>
547 <th class="date">date</th>
547 <th class="date">date</th>
548 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
548 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
549 </tr>
549 </tr>
550 <tr>
550 <tr>
551 <th class="author">parents</th>
551 <th class="author">parents</th>
552 <td class="author"></td>
552 <td class="author"></td>
553 </tr>
553 </tr>
554 <tr>
554 <tr>
555 <th class="author">children</th>
555 <th class="author">children</th>
556 <td class="author"><a href="/file/1d22e65f027e/foo">1d22e65f027e</a> </td>
556 <td class="author"><a href="/file/1d22e65f027e/foo">1d22e65f027e</a> </td>
557 </tr>
557 </tr>
558
558
559 </table>
559 </table>
560
560
561 <div class="overflow">
561 <div class="overflow">
562 <div class="sourcefirst"> line source</div>
562 <div class="sourcefirst"> line source</div>
563
563
564 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> foo
564 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> foo
565 </div>
565 </div>
566 <div class="sourcelast"></div>
566 <div class="sourcelast"></div>
567 </div>
567 </div>
568 </div>
568 </div>
569 </div>
569 </div>
570
570
571
571
572
572
573 </body>
573 </body>
574 </html>
574 </html>
575
575
576 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw'
576 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw'
577 200 Script output follows
577 200 Script output follows
578
578
579
579
580 diff -r 000000000000 -r a4f92ed23982 foo
580 diff -r 000000000000 -r a4f92ed23982 foo
581 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
581 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
582 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
582 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
583 @@ -0,0 +1,1 @@
583 @@ -0,0 +1,1 @@
584 +foo
584 +foo
585
585
586
586
587
587
588
588
589
589
590 Overviews
590 Overviews
591
591
592 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-tags'
592 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-tags'
593 200 Script output follows
593 200 Script output follows
594
594
595 tip 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
595 tip 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
596 1.0 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
596 1.0 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
597 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-branches'
597 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-branches'
598 200 Script output follows
598 200 Script output follows
599
599
600 stable 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe open
600 stable 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe open
601 default a4f92ed23982be056b9852de5dfe873eaac7f0de inactive
601 default a4f92ed23982be056b9852de5dfe873eaac7f0de inactive
602 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb'
602 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb'
603 200 Script output follows
603 200 Script output follows
604
604
605 <?xml version="1.0" encoding="ascii"?>
605 <?xml version="1.0" encoding="ascii"?>
606 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
606 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
607 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
607 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
608 <head>
608 <head>
609 <link rel="icon" href="/static/hgicon.png" type="image/png" />
609 <link rel="icon" href="/static/hgicon.png" type="image/png" />
610 <meta name="robots" content="index, nofollow"/>
610 <meta name="robots" content="index, nofollow"/>
611 <link rel="stylesheet" href="/static/style-gitweb.css" type="text/css" />
611 <link rel="stylesheet" href="/static/style-gitweb.css" type="text/css" />
612
612
613
613
614 <title>test: Summary</title>
614 <title>test: Summary</title>
615 <link rel="alternate" type="application/atom+xml"
615 <link rel="alternate" type="application/atom+xml"
616 href="/atom-log" title="Atom feed for test"/>
616 href="/atom-log" title="Atom feed for test"/>
617 <link rel="alternate" type="application/rss+xml"
617 <link rel="alternate" type="application/rss+xml"
618 href="/rss-log" title="RSS feed for test"/>
618 href="/rss-log" title="RSS feed for test"/>
619 </head>
619 </head>
620 <body>
620 <body>
621
621
622 <div class="page_header">
622 <div class="page_header">
623 <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / summary
623 <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / summary
624
624
625 <form action="/log">
625 <form action="/log">
626 <input type="hidden" name="style" value="gitweb" />
626 <input type="hidden" name="style" value="gitweb" />
627 <div class="search">
627 <div class="search">
628 <input type="text" name="rev" />
628 <input type="text" name="rev" />
629 </div>
629 </div>
630 </form>
630 </form>
631 </div>
631 </div>
632
632
633 <div class="page_nav">
633 <div class="page_nav">
634 summary |
634 summary |
635 <a href="/shortlog?style=gitweb">shortlog</a> |
635 <a href="/shortlog?style=gitweb">shortlog</a> |
636 <a href="/log?style=gitweb">changelog</a> |
636 <a href="/log?style=gitweb">changelog</a> |
637 <a href="/graph?style=gitweb">graph</a> |
637 <a href="/graph?style=gitweb">graph</a> |
638 <a href="/tags?style=gitweb">tags</a> |
638 <a href="/tags?style=gitweb">tags</a> |
639 <a href="/branches?style=gitweb">branches</a> |
639 <a href="/branches?style=gitweb">branches</a> |
640 <a href="/file/1d22e65f027e?style=gitweb">files</a> |
640 <a href="/file/1d22e65f027e?style=gitweb">files</a> |
641 <a href="/help?style=gitweb">help</a>
641 <a href="/help?style=gitweb">help</a>
642 <br/>
642 <br/>
643 </div>
643 </div>
644
644
645 <div class="title">&nbsp;</div>
645 <div class="title">&nbsp;</div>
646 <table cellspacing="0">
646 <table cellspacing="0">
647 <tr><td>description</td><td>unknown</td></tr>
647 <tr><td>description</td><td>unknown</td></tr>
648 <tr><td>owner</td><td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td></tr>
648 <tr><td>owner</td><td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td></tr>
649 <tr><td>last change</td><td>Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
649 <tr><td>last change</td><td>Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
650 </table>
650 </table>
651
651
652 <div><a class="title" href="/shortlog?style=gitweb">changes</a></div>
652 <div><a class="title" href="/shortlog?style=gitweb">changes</a></div>
653 <table cellspacing="0">
653 <table cellspacing="0">
654
654
655 <tr class="parity0">
655 <tr class="parity0">
656 <td class="age"><i>1970-01-01</i></td>
656 <td class="age"><i>1970-01-01</i></td>
657 <td><i>test</i></td>
657 <td><i>test</i></td>
658 <td>
658 <td>
659 <a class="list" href="/rev/1d22e65f027e?style=gitweb">
659 <a class="list" href="/rev/1d22e65f027e?style=gitweb">
660 <b>branch</b>
660 <b>branch</b>
661 <span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> </span>
661 <span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> </span>
662 </a>
662 </a>
663 </td>
663 </td>
664 <td class="link" nowrap>
664 <td class="link" nowrap>
665 <a href="/rev/1d22e65f027e?style=gitweb">changeset</a> |
665 <a href="/rev/1d22e65f027e?style=gitweb">changeset</a> |
666 <a href="/file/1d22e65f027e?style=gitweb">files</a>
666 <a href="/file/1d22e65f027e?style=gitweb">files</a>
667 </td>
667 </td>
668 </tr>
668 </tr>
669 <tr class="parity1">
669 <tr class="parity1">
670 <td class="age"><i>1970-01-01</i></td>
670 <td class="age"><i>1970-01-01</i></td>
671 <td><i>test</i></td>
671 <td><i>test</i></td>
672 <td>
672 <td>
673 <a class="list" href="/rev/a4f92ed23982?style=gitweb">
673 <a class="list" href="/rev/a4f92ed23982?style=gitweb">
674 <b>Added tag 1.0 for changeset 2ef0ac749a14</b>
674 <b>Added tag 1.0 for changeset 2ef0ac749a14</b>
675 <span class="logtags"><span class="branchtag" title="default">default</span> </span>
675 <span class="logtags"><span class="branchtag" title="default">default</span> </span>
676 </a>
676 </a>
677 </td>
677 </td>
678 <td class="link" nowrap>
678 <td class="link" nowrap>
679 <a href="/rev/a4f92ed23982?style=gitweb">changeset</a> |
679 <a href="/rev/a4f92ed23982?style=gitweb">changeset</a> |
680 <a href="/file/a4f92ed23982?style=gitweb">files</a>
680 <a href="/file/a4f92ed23982?style=gitweb">files</a>
681 </td>
681 </td>
682 </tr>
682 </tr>
683 <tr class="parity0">
683 <tr class="parity0">
684 <td class="age"><i>1970-01-01</i></td>
684 <td class="age"><i>1970-01-01</i></td>
685 <td><i>test</i></td>
685 <td><i>test</i></td>
686 <td>
686 <td>
687 <a class="list" href="/rev/2ef0ac749a14?style=gitweb">
687 <a class="list" href="/rev/2ef0ac749a14?style=gitweb">
688 <b>base</b>
688 <b>base</b>
689 <span class="logtags"><span class="tagtag" title="1.0">1.0</span> </span>
689 <span class="logtags"><span class="tagtag" title="1.0">1.0</span> </span>
690 </a>
690 </a>
691 </td>
691 </td>
692 <td class="link" nowrap>
692 <td class="link" nowrap>
693 <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
693 <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
694 <a href="/file/2ef0ac749a14?style=gitweb">files</a>
694 <a href="/file/2ef0ac749a14?style=gitweb">files</a>
695 </td>
695 </td>
696 </tr>
696 </tr>
697 <tr class="light"><td colspan="4"><a class="list" href="/shortlog?style=gitweb">...</a></td></tr>
697 <tr class="light"><td colspan="4"><a class="list" href="/shortlog?style=gitweb">...</a></td></tr>
698 </table>
698 </table>
699
699
700 <div><a class="title" href="/tags?style=gitweb">tags</a></div>
700 <div><a class="title" href="/tags?style=gitweb">tags</a></div>
701 <table cellspacing="0">
701 <table cellspacing="0">
702
702
703 <tr class="parity0">
703 <tr class="parity0">
704 <td class="age"><i>1970-01-01</i></td>
704 <td class="age"><i>1970-01-01</i></td>
705 <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
705 <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
706 <td class="link">
706 <td class="link">
707 <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
707 <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
708 <a href="/log/2ef0ac749a14?style=gitweb">changelog</a> |
708 <a href="/log/2ef0ac749a14?style=gitweb">changelog</a> |
709 <a href="/file/2ef0ac749a14?style=gitweb">files</a>
709 <a href="/file/2ef0ac749a14?style=gitweb">files</a>
710 </td>
710 </td>
711 </tr>
711 </tr>
712 <tr class="light"><td colspan="3"><a class="list" href="/tags?style=gitweb">...</a></td></tr>
712 <tr class="light"><td colspan="3"><a class="list" href="/tags?style=gitweb">...</a></td></tr>
713 </table>
713 </table>
714
714
715 <div><a class="title" href="#">branches</a></div>
715 <div><a class="title" href="#">branches</a></div>
716 <table cellspacing="0">
716 <table cellspacing="0">
717
717
718 <tr class="parity0">
718 <tr class="parity0">
719 <td class="age"><i>1970-01-01</i></td>
719 <td class="age"><i>1970-01-01</i></td>
720 <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
720 <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
721 <td class="">stable</td>
721 <td class="">stable</td>
722 <td class="link">
722 <td class="link">
723 <a href="/changeset/1d22e65f027e?style=gitweb">changeset</a> |
723 <a href="/changeset/1d22e65f027e?style=gitweb">changeset</a> |
724 <a href="/log/1d22e65f027e?style=gitweb">changelog</a> |
724 <a href="/log/1d22e65f027e?style=gitweb">changelog</a> |
725 <a href="/file/1d22e65f027e?style=gitweb">files</a>
725 <a href="/file/1d22e65f027e?style=gitweb">files</a>
726 </td>
726 </td>
727 </tr>
727 </tr>
728 <tr class="parity1">
728 <tr class="parity1">
729 <td class="age"><i>1970-01-01</i></td>
729 <td class="age"><i>1970-01-01</i></td>
730 <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
730 <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
731 <td class="">default</td>
731 <td class="">default</td>
732 <td class="link">
732 <td class="link">
733 <a href="/changeset/a4f92ed23982?style=gitweb">changeset</a> |
733 <a href="/changeset/a4f92ed23982?style=gitweb">changeset</a> |
734 <a href="/log/a4f92ed23982?style=gitweb">changelog</a> |
734 <a href="/log/a4f92ed23982?style=gitweb">changelog</a> |
735 <a href="/file/a4f92ed23982?style=gitweb">files</a>
735 <a href="/file/a4f92ed23982?style=gitweb">files</a>
736 </td>
736 </td>
737 </tr>
737 </tr>
738 <tr class="light">
738 <tr class="light">
739 <td colspan="4"><a class="list" href="#">...</a></td>
739 <td colspan="4"><a class="list" href="#">...</a></td>
740 </tr>
740 </tr>
741 </table>
741 </table>
742 <div class="page_footer">
742 <div class="page_footer">
743 <div class="page_footer_text">test</div>
743 <div class="page_footer_text">test</div>
744 <div class="rss_logo">
744 <div class="rss_logo">
745 <a href="/rss-log">RSS</a>
745 <a href="/rss-log">RSS</a>
746 <a href="/atom-log">Atom</a>
746 <a href="/atom-log">Atom</a>
747 </div>
747 </div>
748 <br />
748 <br />
749
749
750 </div>
750 </div>
751 </body>
751 </body>
752 </html>
752 </html>
753
753
754 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/?style=gitweb'
754 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/?style=gitweb'
755 200 Script output follows
755 200 Script output follows
756
756
757 <?xml version="1.0" encoding="ascii"?>
757 <?xml version="1.0" encoding="ascii"?>
758 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
758 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
759 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
759 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
760 <head>
760 <head>
761 <link rel="icon" href="/static/hgicon.png" type="image/png" />
761 <link rel="icon" href="/static/hgicon.png" type="image/png" />
762 <meta name="robots" content="index, nofollow"/>
762 <meta name="robots" content="index, nofollow"/>
763 <link rel="stylesheet" href="/static/style-gitweb.css" type="text/css" />
763 <link rel="stylesheet" href="/static/style-gitweb.css" type="text/css" />
764
764
765
765
766 <title>test: Graph</title>
766 <title>test: Graph</title>
767 <link rel="alternate" type="application/atom+xml"
767 <link rel="alternate" type="application/atom+xml"
768 href="/atom-log" title="Atom feed for test"/>
768 href="/atom-log" title="Atom feed for test"/>
769 <link rel="alternate" type="application/rss+xml"
769 <link rel="alternate" type="application/rss+xml"
770 href="/rss-log" title="RSS feed for test"/>
770 href="/rss-log" title="RSS feed for test"/>
771 <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
771 <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
772 </head>
772 </head>
773 <body>
773 <body>
774
774
775 <div class="page_header">
775 <div class="page_header">
776 <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / graph
776 <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / graph
777 </div>
777 </div>
778
778
779 <form action="/log">
779 <form action="/log">
780 <input type="hidden" name="style" value="gitweb" />
780 <input type="hidden" name="style" value="gitweb" />
781 <div class="search">
781 <div class="search">
782 <input type="text" name="rev" />
782 <input type="text" name="rev" />
783 </div>
783 </div>
784 </form>
784 </form>
785 <div class="page_nav">
785 <div class="page_nav">
786 <a href="/summary?style=gitweb">summary</a> |
786 <a href="/summary?style=gitweb">summary</a> |
787 <a href="/shortlog?style=gitweb">shortlog</a> |
787 <a href="/shortlog?style=gitweb">shortlog</a> |
788 <a href="/log/2?style=gitweb">changelog</a> |
788 <a href="/log/2?style=gitweb">changelog</a> |
789 graph |
789 graph |
790 <a href="/tags?style=gitweb">tags</a> |
790 <a href="/tags?style=gitweb">tags</a> |
791 <a href="/branches?style=gitweb">branches</a> |
791 <a href="/branches?style=gitweb">branches</a> |
792 <a href="/file/1d22e65f027e?style=gitweb">files</a> |
792 <a href="/file/1d22e65f027e?style=gitweb">files</a> |
793 <a href="/help?style=gitweb">help</a>
793 <a href="/help?style=gitweb">help</a>
794 <br/>
794 <br/>
795 <a href="/graph/2?style=gitweb&revcount=30">less</a>
795 <a href="/graph/2?style=gitweb&revcount=30">less</a>
796 <a href="/graph/2?style=gitweb&revcount=120">more</a>
796 <a href="/graph/2?style=gitweb&revcount=120">more</a>
797 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
797 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
798 </div>
798 </div>
799
799
800 <div class="title">&nbsp;</div>
800 <div class="title">&nbsp;</div>
801
801
802 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
802 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
803
803
804 <div id="wrapper">
804 <div id="wrapper">
805 <ul id="nodebgs"></ul>
805 <ul id="nodebgs"></ul>
806 <canvas id="graph" width="224" height="129"></canvas>
806 <canvas id="graph" width="224" height="129"></canvas>
807 <ul id="graphnodes"></ul>
807 <ul id="graphnodes"></ul>
808 </div>
808 </div>
809
809
810 <script type="text/javascript" src="/static/graph.js"></script>
810 <script type="text/javascript" src="/static/graph.js"></script>
811 <script>
811 <script>
812 <!-- hide script content
812 <!-- hide script content
813
813
814 var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
814 var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
815 var graph = new Graph();
815 var graph = new Graph();
816 graph.scale(39);
816 graph.scale(39);
817
817
818 graph.edge = function(x0, y0, x1, y1, color) {
818 graph.edge = function(x0, y0, x1, y1, color) {
819
819
820 this.setColor(color, 0.0, 0.65);
820 this.setColor(color, 0.0, 0.65);
821 this.ctx.beginPath();
821 this.ctx.beginPath();
822 this.ctx.moveTo(x0, y0);
822 this.ctx.moveTo(x0, y0);
823 this.ctx.lineTo(x1, y1);
823 this.ctx.lineTo(x1, y1);
824 this.ctx.stroke();
824 this.ctx.stroke();
825
825
826 }
826 }
827
827
828 var revlink = '<li style="_STYLE"><span class="desc">';
828 var revlink = '<li style="_STYLE"><span class="desc">';
829 revlink += '<a class="list" href="/rev/_NODEID?style=gitweb" title="_NODEID"><b>_DESC</b></a>';
829 revlink += '<a class="list" href="/rev/_NODEID?style=gitweb" title="_NODEID"><b>_DESC</b></a>';
830 revlink += '</span> _TAGS';
830 revlink += '</span> _TAGS';
831 revlink += '<span class="info">_DATE, by _USER</span></li>';
831 revlink += '<span class="info">_DATE, by _USER</span></li>';
832
832
833 graph.vertex = function(x, y, color, parity, cur) {
833 graph.vertex = function(x, y, color, parity, cur) {
834
834
835 this.ctx.beginPath();
835 this.ctx.beginPath();
836 color = this.setColor(color, 0.25, 0.75);
836 color = this.setColor(color, 0.25, 0.75);
837 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
837 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
838 this.ctx.fill();
838 this.ctx.fill();
839
839
840 var bg = '<li class="bg parity' + parity + '"></li>';
840 var bg = '<li class="bg parity' + parity + '"></li>';
841 var left = (this.columns + 1) * this.bg_height;
841 var left = (this.columns + 1) * this.bg_height;
842 var nstyle = 'padding-left: ' + left + 'px;';
842 var nstyle = 'padding-left: ' + left + 'px;';
843 var item = revlink.replace(/_STYLE/, nstyle);
843 var item = revlink.replace(/_STYLE/, nstyle);
844 item = item.replace(/_PARITY/, 'parity' + parity);
844 item = item.replace(/_PARITY/, 'parity' + parity);
845 item = item.replace(/_NODEID/, cur[0]);
845 item = item.replace(/_NODEID/, cur[0]);
846 item = item.replace(/_NODEID/, cur[0]);
846 item = item.replace(/_NODEID/, cur[0]);
847 item = item.replace(/_DESC/, cur[3]);
847 item = item.replace(/_DESC/, cur[3]);
848 item = item.replace(/_USER/, cur[4]);
848 item = item.replace(/_USER/, cur[4]);
849 item = item.replace(/_DATE/, cur[5]);
849 item = item.replace(/_DATE/, cur[5]);
850
850
851 var tagspan = '';
851 var tagspan = '';
852 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
852 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
853 tagspan = '<span class="logtags">';
853 tagspan = '<span class="logtags">';
854 if (cur[6][1]) {
854 if (cur[6][1]) {
855 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
855 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
856 tagspan += cur[6][0] + '</span> ';
856 tagspan += cur[6][0] + '</span> ';
857 } else if (!cur[6][1] && cur[6][0] != 'default') {
857 } else if (!cur[6][1] && cur[6][0] != 'default') {
858 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
858 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
859 tagspan += cur[6][0] + '</span> ';
859 tagspan += cur[6][0] + '</span> ';
860 }
860 }
861 if (cur[7].length) {
861 if (cur[7].length) {
862 for (var t in cur[7]) {
862 for (var t in cur[7]) {
863 var tag = cur[7][t];
863 var tag = cur[7][t];
864 tagspan += '<span class="tagtag">' + tag + '</span> ';
864 tagspan += '<span class="tagtag">' + tag + '</span> ';
865 }
865 }
866 }
866 }
867 tagspan += '</span>';
867 tagspan += '</span>';
868 }
868 }
869
869
870 item = item.replace(/_TAGS/, tagspan);
870 item = item.replace(/_TAGS/, tagspan);
871 return [bg, item];
871 return [bg, item];
872
872
873 }
873 }
874
874
875 graph.render(data);
875 graph.render(data);
876
876
877 // stop hiding script -->
877 // stop hiding script -->
878 </script>
878 </script>
879
879
880 <div class="page_nav">
880 <div class="page_nav">
881 <a href="/graph/2?style=gitweb&revcount=30">less</a>
881 <a href="/graph/2?style=gitweb&revcount=30">less</a>
882 <a href="/graph/2?style=gitweb&revcount=120">more</a>
882 <a href="/graph/2?style=gitweb&revcount=120">more</a>
883 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a>
883 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a>
884 </div>
884 </div>
885
885
886 <div class="page_footer">
886 <div class="page_footer">
887 <div class="page_footer_text">test</div>
887 <div class="page_footer_text">test</div>
888 <div class="rss_logo">
888 <div class="rss_logo">
889 <a href="/rss-log">RSS</a>
889 <a href="/rss-log">RSS</a>
890 <a href="/atom-log">Atom</a>
890 <a href="/atom-log">Atom</a>
891 </div>
891 </div>
892 <br />
892 <br />
893
893
894 </div>
894 </div>
895 </body>
895 </body>
896 </html>
896 </html>
897
897
898
898
899 capabilities
899 capabilities
900
900
901 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
901 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
902 200 Script output follows
902 200 Script output follows
903
903
904 lookup changegroupsubset branchmap pushkey unbundle=HG10GZ,HG10BZ,HG10UN
904 lookup changegroupsubset branchmap pushkey unbundle=HG10GZ,HG10BZ,HG10UN
905
905
906 heads
906 heads
907
907
908 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
908 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
909 200 Script output follows
909 200 Script output follows
910
910
911 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
911 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
912
912
913 branches
913 branches
914
914
915 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
915 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
916 200 Script output follows
916 200 Script output follows
917
917
918 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
918 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
919
919
920 changegroup
920 changegroup
921
921
922 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
922 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000'
923 > | $TESTDIR/printrepr.py
924 200 Script output follows
923 200 Script output follows
925
924
926 x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82
925 x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82 (esc)
927 4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\
926 4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\\n\xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee \xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk (esc)
928 \xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee\t\xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk
927 \xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3'\x859 (esc)
929 \xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3\'\x859
928 \xa8\x80\x84S \xa5\xbd-g\x13`\xe4\xdc\xc3H^\xdf\xe2\xc0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00 _\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc (no-eol) (esc)
930 \xa8\x80\x84S \xa5\xbd-g\x13`\xe4\xdc\xc3H^\xdf\xe2\xc0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf\'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00\t_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc
931
929
932 stream_out
930 stream_out
933
931
934 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
932 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
935 200 Script output follows
933 200 Script output follows
936
934
937 1
935 1
938
936
939 failing unbundle, requires POST request
937 failing unbundle, requires POST request
940
938
941 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle'
939 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle'
942 405 push requires POST request
940 405 push requires POST request
943
941
944 0
942 0
945 push requires POST request
943 push requires POST request
946 [1]
944 [1]
947
945
948 Static files
946 Static files
949
947
950 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
948 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
951 200 Script output follows
949 200 Script output follows
952
950
953 a { text-decoration:none; }
951 a { text-decoration:none; }
954 .age { white-space:nowrap; }
952 .age { white-space:nowrap; }
955 .date { white-space:nowrap; }
953 .date { white-space:nowrap; }
956 .indexlinks { white-space:nowrap; }
954 .indexlinks { white-space:nowrap; }
957 .parity0 { background-color: #ddd; }
955 .parity0 { background-color: #ddd; }
958 .parity1 { background-color: #eee; }
956 .parity1 { background-color: #eee; }
959 .lineno { width: 60px; color: #aaa; font-size: smaller;
957 .lineno { width: 60px; color: #aaa; font-size: smaller;
960 text-align: right; }
958 text-align: right; }
961 .plusline { color: green; }
959 .plusline { color: green; }
962 .minusline { color: red; }
960 .minusline { color: red; }
963 .atline { color: purple; }
961 .atline { color: purple; }
964 .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
962 .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
965 .buttons a {
963 .buttons a {
966 background-color: #666;
964 background-color: #666;
967 padding: 2pt;
965 padding: 2pt;
968 color: white;
966 color: white;
969 font-family: sans;
967 font-family: sans;
970 font-weight: bold;
968 font-weight: bold;
971 }
969 }
972 .navigate a {
970 .navigate a {
973 background-color: #ccc;
971 background-color: #ccc;
974 padding: 2pt;
972 padding: 2pt;
975 font-family: sans;
973 font-family: sans;
976 color: black;
974 color: black;
977 }
975 }
978
976
979 .metatag {
977 .metatag {
980 background-color: #888;
978 background-color: #888;
981 color: white;
979 color: white;
982 text-align: right;
980 text-align: right;
983 }
981 }
984
982
985 /* Common */
983 /* Common */
986 pre { margin: 0; }
984 pre { margin: 0; }
987
985
988 .logo {
986 .logo {
989 float: right;
987 float: right;
990 clear: right;
988 clear: right;
991 }
989 }
992
990
993 /* Changelog/Filelog entries */
991 /* Changelog/Filelog entries */
994 .logEntry { width: 100%; }
992 .logEntry { width: 100%; }
995 .logEntry .age { width: 15%; }
993 .logEntry .age { width: 15%; }
996 .logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
994 .logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
997 .logEntry th.age, .logEntry th.firstline { font-weight: bold; }
995 .logEntry th.age, .logEntry th.firstline { font-weight: bold; }
998 .logEntry th.firstline { text-align: left; width: inherit; }
996 .logEntry th.firstline { text-align: left; width: inherit; }
999
997
1000 /* Shortlog entries */
998 /* Shortlog entries */
1001 .slogEntry { width: 100%; }
999 .slogEntry { width: 100%; }
1002 .slogEntry .age { width: 8em; }
1000 .slogEntry .age { width: 8em; }
1003 .slogEntry td { font-weight: normal; text-align: left; vertical-align: top; }
1001 .slogEntry td { font-weight: normal; text-align: left; vertical-align: top; }
1004 .slogEntry td.author { width: 15em; }
1002 .slogEntry td.author { width: 15em; }
1005
1003
1006 /* Tag entries */
1004 /* Tag entries */
1007 #tagEntries { list-style: none; margin: 0; padding: 0; }
1005 #tagEntries { list-style: none; margin: 0; padding: 0; }
1008 #tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; }
1006 #tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; }
1009
1007
1010 /* Changeset entry */
1008 /* Changeset entry */
1011 #changesetEntry { }
1009 #changesetEntry { }
1012 #changesetEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
1010 #changesetEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
1013 #changesetEntry th.files, #changesetEntry th.description { vertical-align: top; }
1011 #changesetEntry th.files, #changesetEntry th.description { vertical-align: top; }
1014
1012
1015 /* File diff view */
1013 /* File diff view */
1016 #filediffEntry { }
1014 #filediffEntry { }
1017 #filediffEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
1015 #filediffEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
1018
1016
1019 /* Graph */
1017 /* Graph */
1020 div#wrapper {
1018 div#wrapper {
1021 position: relative;
1019 position: relative;
1022 margin: 0;
1020 margin: 0;
1023 padding: 0;
1021 padding: 0;
1024 }
1022 }
1025
1023
1026 canvas {
1024 canvas {
1027 position: absolute;
1025 position: absolute;
1028 z-index: 5;
1026 z-index: 5;
1029 top: -0.6em;
1027 top: -0.6em;
1030 margin: 0;
1028 margin: 0;
1031 }
1029 }
1032
1030
1033 ul#nodebgs {
1031 ul#nodebgs {
1034 list-style: none inside none;
1032 list-style: none inside none;
1035 padding: 0;
1033 padding: 0;
1036 margin: 0;
1034 margin: 0;
1037 top: -0.7em;
1035 top: -0.7em;
1038 }
1036 }
1039
1037
1040 ul#graphnodes li, ul#nodebgs li {
1038 ul#graphnodes li, ul#nodebgs li {
1041 height: 39px;
1039 height: 39px;
1042 }
1040 }
1043
1041
1044 ul#graphnodes {
1042 ul#graphnodes {
1045 position: absolute;
1043 position: absolute;
1046 z-index: 10;
1044 z-index: 10;
1047 top: -0.85em;
1045 top: -0.85em;
1048 list-style: none inside none;
1046 list-style: none inside none;
1049 padding: 0;
1047 padding: 0;
1050 }
1048 }
1051
1049
1052 ul#graphnodes li .info {
1050 ul#graphnodes li .info {
1053 display: block;
1051 display: block;
1054 font-size: 70%;
1052 font-size: 70%;
1055 position: relative;
1053 position: relative;
1056 top: -1px;
1054 top: -1px;
1057 }
1055 }
1058
1056
1059 Stop and restart with HGENCODING=cp932
1057 Stop and restart with HGENCODING=cp932
1060
1058
1061 $ "$TESTDIR/killdaemons.py"
1059 $ "$TESTDIR/killdaemons.py"
1062 $ HGENCODING=cp932 hg serve --config server.uncompressed=False -n test \
1060 $ HGENCODING=cp932 hg serve --config server.uncompressed=False -n test \
1063 > -p $HGPORT -d --pid-file=hg.pid -E errors.log
1061 > -p $HGPORT -d --pid-file=hg.pid -E errors.log
1064 $ cat hg.pid >> $DAEMON_PIDS
1062 $ cat hg.pid >> $DAEMON_PIDS
1065
1063
1066 commit message with Japanese Kanji 'Noh', which ends with '\x5c'
1064 commit message with Japanese Kanji 'Noh', which ends with '\x5c'
1067
1065
1068 $ echo foo >> foo
1066 $ echo foo >> foo
1069 $ HGENCODING=cp932 hg ci -m `python -c 'print("\x94\x5c")'`
1067 $ HGENCODING=cp932 hg ci -m `python -c 'print("\x94\x5c")'`
1070
1068
1071 Graph json escape of multibyte character
1069 Graph json escape of multibyte character
1072
1070
1073 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/' \
1071 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/' \
1074 > | grep '^var data ='
1072 > | grep '^var data ='
1075 var data = [["40b4d6888e92", [0, 1], [[0, 0, 1]], "\u80fd", "test", "1970-01-01", ["stable", true], ["tip"]], ["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", false], []], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
1073 var data = [["40b4d6888e92", [0, 1], [[0, 0, 1]], "\u80fd", "test", "1970-01-01", ["stable", true], ["tip"]], ["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", false], []], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
1076
1074
1077 ERRORS ENCOUNTERED
1075 ERRORS ENCOUNTERED
1078
1076
1079 $ cat errors.log
1077 $ cat errors.log
@@ -1,604 +1,604 b''
1
1
2 $ "$TESTDIR/hghave" pygments || exit 80
2 $ "$TESTDIR/hghave" pygments || exit 80
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > highlight =
5 > highlight =
6 > [web]
6 > [web]
7 > pygments_style = friendly
7 > pygments_style = friendly
8 > EOF
8 > EOF
9 $ hg init test
9 $ hg init test
10 $ cd test
10 $ cd test
11
11
12 create random Python file to exercise Pygments
12 create random Python file to exercise Pygments
13
13
14 $ cat <<EOF > primes.py
14 $ cat <<EOF > primes.py
15 > #!/usr/bin/env python
15 > #!/usr/bin/env python
16 >
16 >
17 > """Fun with generators. Corresponding Haskell implementation:
17 > """Fun with generators. Corresponding Haskell implementation:
18 >
18 >
19 > primes = 2 : sieve [3, 5..]
19 > primes = 2 : sieve [3, 5..]
20 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
20 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
21 > """
21 > """
22 >
22 >
23 > from itertools import dropwhile, ifilter, islice, count, chain
23 > from itertools import dropwhile, ifilter, islice, count, chain
24 >
24 >
25 > def primes():
25 > def primes():
26 > """Generate all primes."""
26 > """Generate all primes."""
27 > def sieve(ns):
27 > def sieve(ns):
28 > p = ns.next()
28 > p = ns.next()
29 > # It is important to yield *here* in order to stop the
29 > # It is important to yield *here* in order to stop the
30 > # infinite recursion.
30 > # infinite recursion.
31 > yield p
31 > yield p
32 > ns = ifilter(lambda n: n % p != 0, ns)
32 > ns = ifilter(lambda n: n % p != 0, ns)
33 > for n in sieve(ns):
33 > for n in sieve(ns):
34 > yield n
34 > yield n
35 >
35 >
36 > odds = ifilter(lambda i: i % 2 == 1, count())
36 > odds = ifilter(lambda i: i % 2 == 1, count())
37 > return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
37 > return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
38 >
38 >
39 > if __name__ == "__main__":
39 > if __name__ == "__main__":
40 > import sys
40 > import sys
41 > try:
41 > try:
42 > n = int(sys.argv[1])
42 > n = int(sys.argv[1])
43 > except (ValueError, IndexError):
43 > except (ValueError, IndexError):
44 > n = 10
44 > n = 10
45 > p = primes()
45 > p = primes()
46 > print "The first %d primes: %s" % (n, list(islice(p, n)))
46 > print "The first %d primes: %s" % (n, list(islice(p, n)))
47 > EOF
47 > EOF
48 $ hg ci -Ama
48 $ hg ci -Ama
49 adding primes.py
49 adding primes.py
50
50
51 hg serve
51 hg serve
52
52
53 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
53 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
54 $ cat hg.pid >> $DAEMON_PIDS
54 $ cat hg.pid >> $DAEMON_PIDS
55
55
56 hgweb filerevision, html
56 hgweb filerevision, html
57
57
58 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py') \
58 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py') \
59 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
59 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
60 200 Script output follows
60 200 Script output follows
61
61
62 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
62 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
63 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
63 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
64 <head>
64 <head>
65 <link rel="icon" href="/static/hgicon.png" type="image/png" />
65 <link rel="icon" href="/static/hgicon.png" type="image/png" />
66 <meta name="robots" content="index, nofollow" />
66 <meta name="robots" content="index, nofollow" />
67 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
67 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
68
68
69 <link rel="stylesheet" href="/highlightcss" type="text/css" />
69 <link rel="stylesheet" href="/highlightcss" type="text/css" />
70 <title>test: 853dcd4de2a6 primes.py</title>
70 <title>test: 853dcd4de2a6 primes.py</title>
71 </head>
71 </head>
72 <body>
72 <body>
73
73
74 <div class="container">
74 <div class="container">
75 <div class="menu">
75 <div class="menu">
76 <div class="logo">
76 <div class="logo">
77 <a href="http://mercurial.selenic.com/">
77 <a href="http://mercurial.selenic.com/">
78 <img src="/static/hglogo.png" alt="mercurial" /></a>
78 <img src="/static/hglogo.png" alt="mercurial" /></a>
79 </div>
79 </div>
80 <ul>
80 <ul>
81 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
81 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
82 <li><a href="/graph/853dcd4de2a6">graph</a></li>
82 <li><a href="/graph/853dcd4de2a6">graph</a></li>
83 <li><a href="/tags">tags</a></li>
83 <li><a href="/tags">tags</a></li>
84 <li><a href="/branches">branches</a></li>
84 <li><a href="/branches">branches</a></li>
85 </ul>
85 </ul>
86 <ul>
86 <ul>
87 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
87 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
88 <li><a href="/file/853dcd4de2a6/">browse</a></li>
88 <li><a href="/file/853dcd4de2a6/">browse</a></li>
89 </ul>
89 </ul>
90 <ul>
90 <ul>
91 <li class="active">file</li>
91 <li class="active">file</li>
92 <li><a href="/file/tip/primes.py">latest</a></li>
92 <li><a href="/file/tip/primes.py">latest</a></li>
93 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
93 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
94 <li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
94 <li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
95 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
95 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
96 <li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
96 <li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
97 </ul>
97 </ul>
98 <ul>
98 <ul>
99 <li><a href="/help">help</a></li>
99 <li><a href="/help">help</a></li>
100 </ul>
100 </ul>
101 </div>
101 </div>
102
102
103 <div class="main">
103 <div class="main">
104 <h2><a href="/">test</a></h2>
104 <h2><a href="/">test</a></h2>
105 <h3>view primes.py @ 0:853dcd4de2a6</h3>
105 <h3>view primes.py @ 0:853dcd4de2a6</h3>
106
106
107 <form class="search" action="/log">
107 <form class="search" action="/log">
108
108
109 <p><input name="rev" id="search1" type="text" size="30" /></p>
109 <p><input name="rev" id="search1" type="text" size="30" /></p>
110 <div id="hint">find changesets by author, revision,
110 <div id="hint">find changesets by author, revision,
111 files, or words in the commit message</div>
111 files, or words in the commit message</div>
112 </form>
112 </form>
113
113
114 <div class="description">a</div>
114 <div class="description">a</div>
115
115
116 <table id="changesetEntry">
116 <table id="changesetEntry">
117 <tr>
117 <tr>
118 <th class="author">author</th>
118 <th class="author">author</th>
119 <td class="author">&#116;&#101;&#115;&#116;</td>
119 <td class="author">&#116;&#101;&#115;&#116;</td>
120 </tr>
120 </tr>
121 <tr>
121 <tr>
122 <th class="date">date</th>
122 <th class="date">date</th>
123 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
123 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
124 </tr>
124 </tr>
125 <tr>
125 <tr>
126 <th class="author">parents</th>
126 <th class="author">parents</th>
127 <td class="author"></td>
127 <td class="author"></td>
128 </tr>
128 </tr>
129 <tr>
129 <tr>
130 <th class="author">children</th>
130 <th class="author">children</th>
131 <td class="author"></td>
131 <td class="author"></td>
132 </tr>
132 </tr>
133
133
134 </table>
134 </table>
135
135
136 <div class="overflow">
136 <div class="overflow">
137 <div class="sourcefirst"> line source</div>
137 <div class="sourcefirst"> line source</div>
138
138
139 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> <span class="c">#!/usr/bin/env python</span></div>
139 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> <span class="c">#!/usr/bin/env python</span></div>
140 <div class="parity1 source"><a href="#l2" id="l2"> 2</a> </div>
140 <div class="parity1 source"><a href="#l2" id="l2"> 2</a> </div>
141 <div class="parity0 source"><a href="#l3" id="l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></div>
141 <div class="parity0 source"><a href="#l3" id="l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></div>
142 <div class="parity1 source"><a href="#l4" id="l4"> 4</a> </div>
142 <div class="parity1 source"><a href="#l4" id="l4"> 4</a> </div>
143 <div class="parity0 source"><a href="#l5" id="l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></div>
143 <div class="parity0 source"><a href="#l5" id="l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></div>
144 <div class="parity1 source"><a href="#l6" id="l6"> 6</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></div>
144 <div class="parity1 source"><a href="#l6" id="l6"> 6</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></div>
145 <div class="parity0 source"><a href="#l7" id="l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></div>
145 <div class="parity0 source"><a href="#l7" id="l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></div>
146 <div class="parity1 source"><a href="#l8" id="l8"> 8</a> </div>
146 <div class="parity1 source"><a href="#l8" id="l8"> 8</a> </div>
147 <div class="parity0 source"><a href="#l9" id="l9"> 9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></div>
147 <div class="parity0 source"><a href="#l9" id="l9"> 9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></div>
148 <div class="parity1 source"><a href="#l10" id="l10"> 10</a> </div>
148 <div class="parity1 source"><a href="#l10" id="l10"> 10</a> </div>
149 <div class="parity0 source"><a href="#l11" id="l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></div>
149 <div class="parity0 source"><a href="#l11" id="l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></div>
150 <div class="parity1 source"><a href="#l12" id="l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></div>
150 <div class="parity1 source"><a href="#l12" id="l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></div>
151 <div class="parity0 source"><a href="#l13" id="l13"> 13</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
151 <div class="parity0 source"><a href="#l13" id="l13"> 13</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
152 <div class="parity1 source"><a href="#l14" id="l14"> 14</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></div>
152 <div class="parity1 source"><a href="#l14" id="l14"> 14</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></div>
153 <div class="parity0 source"><a href="#l15" id="l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></div>
153 <div class="parity0 source"><a href="#l15" id="l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></div>
154 <div class="parity1 source"><a href="#l16" id="l16"> 16</a> <span class="c"># infinite recursion.</span></div>
154 <div class="parity1 source"><a href="#l16" id="l16"> 16</a> <span class="c"># infinite recursion.</span></div>
155 <div class="parity0 source"><a href="#l17" id="l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></div>
155 <div class="parity0 source"><a href="#l17" id="l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></div>
156 <div class="parity1 source"><a href="#l18" id="l18"> 18</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></div>
156 <div class="parity1 source"><a href="#l18" id="l18"> 18</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></div>
157 <div class="parity0 source"><a href="#l19" id="l19"> 19</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
157 <div class="parity0 source"><a href="#l19" id="l19"> 19</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
158 <div class="parity1 source"><a href="#l20" id="l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></div>
158 <div class="parity1 source"><a href="#l20" id="l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></div>
159 <div class="parity0 source"><a href="#l21" id="l21"> 21</a> </div>
159 <div class="parity0 source"><a href="#l21" id="l21"> 21</a> </div>
160 <div class="parity1 source"><a href="#l22" id="l22"> 22</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></div>
160 <div class="parity1 source"><a href="#l22" id="l22"> 22</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></div>
161 <div class="parity0 source"><a href="#l23" id="l23"> 23</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></div>
161 <div class="parity0 source"><a href="#l23" id="l23"> 23</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></div>
162 <div class="parity1 source"><a href="#l24" id="l24"> 24</a> </div>
162 <div class="parity1 source"><a href="#l24" id="l24"> 24</a> </div>
163 <div class="parity0 source"><a href="#l25" id="l25"> 25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></div>
163 <div class="parity0 source"><a href="#l25" id="l25"> 25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></div>
164 <div class="parity1 source"><a href="#l26" id="l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></div>
164 <div class="parity1 source"><a href="#l26" id="l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></div>
165 <div class="parity0 source"><a href="#l27" id="l27"> 27</a> <span class="kn">try</span><span class="p">:</span></div>
165 <div class="parity0 source"><a href="#l27" id="l27"> 27</a> <span class="kn">try</span><span class="p">:</span></div>
166 <div class="parity1 source"><a href="#l28" id="l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></div>
166 <div class="parity1 source"><a href="#l28" id="l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></div>
167 <div class="parity0 source"><a href="#l29" id="l29"> 29</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></div>
167 <div class="parity0 source"><a href="#l29" id="l29"> 29</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></div>
168 <div class="parity1 source"><a href="#l30" id="l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></div>
168 <div class="parity1 source"><a href="#l30" id="l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></div>
169 <div class="parity0 source"><a href="#l31" id="l31"> 31</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></div>
169 <div class="parity0 source"><a href="#l31" id="l31"> 31</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></div>
170 <div class="parity1 source"><a href="#l32" id="l32"> 32</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></div>
170 <div class="parity1 source"><a href="#l32" id="l32"> 32</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></div>
171 <div class="sourcelast"></div>
171 <div class="sourcelast"></div>
172 </div>
172 </div>
173 </div>
173 </div>
174 </div>
174 </div>
175
175
176
176
177
177
178 </body>
178 </body>
179 </html>
179 </html>
180
180
181
181
182 hgweb fileannotate, html
182 hgweb fileannotate, html
183
183
184 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \
184 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \
185 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
185 > | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
186 200 Script output follows
186 200 Script output follows
187
187
188 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
188 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
189 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
189 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
190 <head>
190 <head>
191 <link rel="icon" href="/static/hgicon.png" type="image/png" />
191 <link rel="icon" href="/static/hgicon.png" type="image/png" />
192 <meta name="robots" content="index, nofollow" />
192 <meta name="robots" content="index, nofollow" />
193 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
193 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
194
194
195 <link rel="stylesheet" href="/highlightcss" type="text/css" />
195 <link rel="stylesheet" href="/highlightcss" type="text/css" />
196 <title>test: primes.py annotate</title>
196 <title>test: primes.py annotate</title>
197 </head>
197 </head>
198 <body>
198 <body>
199
199
200 <div class="container">
200 <div class="container">
201 <div class="menu">
201 <div class="menu">
202 <div class="logo">
202 <div class="logo">
203 <a href="http://mercurial.selenic.com/">
203 <a href="http://mercurial.selenic.com/">
204 <img src="/static/hglogo.png" alt="mercurial" /></a>
204 <img src="/static/hglogo.png" alt="mercurial" /></a>
205 </div>
205 </div>
206 <ul>
206 <ul>
207 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
207 <li><a href="/shortlog/853dcd4de2a6">log</a></li>
208 <li><a href="/graph/853dcd4de2a6">graph</a></li>
208 <li><a href="/graph/853dcd4de2a6">graph</a></li>
209 <li><a href="/tags">tags</a></li>
209 <li><a href="/tags">tags</a></li>
210 <li><a href="/branches">branches</a></li>
210 <li><a href="/branches">branches</a></li>
211 </ul>
211 </ul>
212
212
213 <ul>
213 <ul>
214 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
214 <li><a href="/rev/853dcd4de2a6">changeset</a></li>
215 <li><a href="/file/853dcd4de2a6/">browse</a></li>
215 <li><a href="/file/853dcd4de2a6/">browse</a></li>
216 </ul>
216 </ul>
217 <ul>
217 <ul>
218 <li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
218 <li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
219 <li><a href="/file/tip/primes.py">latest</a></li>
219 <li><a href="/file/tip/primes.py">latest</a></li>
220 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
220 <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
221 <li class="active">annotate</li>
221 <li class="active">annotate</li>
222 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
222 <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
223 <li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
223 <li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
224 </ul>
224 </ul>
225 <ul>
225 <ul>
226 <li><a href="/help">help</a></li>
226 <li><a href="/help">help</a></li>
227 </ul>
227 </ul>
228 </div>
228 </div>
229
229
230 <div class="main">
230 <div class="main">
231 <h2><a href="/">test</a></h2>
231 <h2><a href="/">test</a></h2>
232 <h3>annotate primes.py @ 0:853dcd4de2a6</h3>
232 <h3>annotate primes.py @ 0:853dcd4de2a6</h3>
233
233
234 <form class="search" action="/log">
234 <form class="search" action="/log">
235
235
236 <p><input name="rev" id="search1" type="text" size="30" /></p>
236 <p><input name="rev" id="search1" type="text" size="30" /></p>
237 <div id="hint">find changesets by author, revision,
237 <div id="hint">find changesets by author, revision,
238 files, or words in the commit message</div>
238 files, or words in the commit message</div>
239 </form>
239 </form>
240
240
241 <div class="description">a</div>
241 <div class="description">a</div>
242
242
243 <table id="changesetEntry">
243 <table id="changesetEntry">
244 <tr>
244 <tr>
245 <th class="author">author</th>
245 <th class="author">author</th>
246 <td class="author">&#116;&#101;&#115;&#116;</td>
246 <td class="author">&#116;&#101;&#115;&#116;</td>
247 </tr>
247 </tr>
248 <tr>
248 <tr>
249 <th class="date">date</th>
249 <th class="date">date</th>
250 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
250 <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
251 </tr>
251 </tr>
252 <tr>
252 <tr>
253 <th class="author">parents</th>
253 <th class="author">parents</th>
254 <td class="author"></td>
254 <td class="author"></td>
255 </tr>
255 </tr>
256 <tr>
256 <tr>
257 <th class="author">children</th>
257 <th class="author">children</th>
258 <td class="author"></td>
258 <td class="author"></td>
259 </tr>
259 </tr>
260
260
261 </table>
261 </table>
262
262
263 <div class="overflow">
263 <div class="overflow">
264 <table class="bigtable">
264 <table class="bigtable">
265 <tr>
265 <tr>
266 <th class="annotate">rev</th>
266 <th class="annotate">rev</th>
267 <th class="line">&nbsp;&nbsp;line source</th>
267 <th class="line">&nbsp;&nbsp;line source</th>
268 </tr>
268 </tr>
269
269
270 <tr class="parity0">
270 <tr class="parity0">
271 <td class="annotate">
271 <td class="annotate">
272 <a href="/annotate/853dcd4de2a6/primes.py#1"
272 <a href="/annotate/853dcd4de2a6/primes.py#1"
273 title="853dcd4de2a6: a">test@0</a>
273 title="853dcd4de2a6: a">test@0</a>
274 </td>
274 </td>
275 <td class="source"><a href="#l1" id="l1"> 1</a> <span class="c">#!/usr/bin/env python</span></td>
275 <td class="source"><a href="#l1" id="l1"> 1</a> <span class="c">#!/usr/bin/env python</span></td>
276 </tr>
276 </tr>
277 <tr class="parity1">
277 <tr class="parity1">
278 <td class="annotate">
278 <td class="annotate">
279 <a href="/annotate/853dcd4de2a6/primes.py#2"
279 <a href="/annotate/853dcd4de2a6/primes.py#2"
280 title="853dcd4de2a6: a">test@0</a>
280 title="853dcd4de2a6: a">test@0</a>
281 </td>
281 </td>
282 <td class="source"><a href="#l2" id="l2"> 2</a> </td>
282 <td class="source"><a href="#l2" id="l2"> 2</a> </td>
283 </tr>
283 </tr>
284 <tr class="parity0">
284 <tr class="parity0">
285 <td class="annotate">
285 <td class="annotate">
286 <a href="/annotate/853dcd4de2a6/primes.py#3"
286 <a href="/annotate/853dcd4de2a6/primes.py#3"
287 title="853dcd4de2a6: a">test@0</a>
287 title="853dcd4de2a6: a">test@0</a>
288 </td>
288 </td>
289 <td class="source"><a href="#l3" id="l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
289 <td class="source"><a href="#l3" id="l3"> 3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
290 </tr>
290 </tr>
291 <tr class="parity1">
291 <tr class="parity1">
292 <td class="annotate">
292 <td class="annotate">
293 <a href="/annotate/853dcd4de2a6/primes.py#4"
293 <a href="/annotate/853dcd4de2a6/primes.py#4"
294 title="853dcd4de2a6: a">test@0</a>
294 title="853dcd4de2a6: a">test@0</a>
295 </td>
295 </td>
296 <td class="source"><a href="#l4" id="l4"> 4</a> </td>
296 <td class="source"><a href="#l4" id="l4"> 4</a> </td>
297 </tr>
297 </tr>
298 <tr class="parity0">
298 <tr class="parity0">
299 <td class="annotate">
299 <td class="annotate">
300 <a href="/annotate/853dcd4de2a6/primes.py#5"
300 <a href="/annotate/853dcd4de2a6/primes.py#5"
301 title="853dcd4de2a6: a">test@0</a>
301 title="853dcd4de2a6: a">test@0</a>
302 </td>
302 </td>
303 <td class="source"><a href="#l5" id="l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
303 <td class="source"><a href="#l5" id="l5"> 5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
304 </tr>
304 </tr>
305 <tr class="parity1">
305 <tr class="parity1">
306 <td class="annotate">
306 <td class="annotate">
307 <a href="/annotate/853dcd4de2a6/primes.py#6"
307 <a href="/annotate/853dcd4de2a6/primes.py#6"
308 title="853dcd4de2a6: a">test@0</a>
308 title="853dcd4de2a6: a">test@0</a>
309 </td>
309 </td>
310 <td class="source"><a href="#l6" id="l6"> 6</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
310 <td class="source"><a href="#l6" id="l6"> 6</a> <span class="sd"> where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
311 </tr>
311 </tr>
312 <tr class="parity0">
312 <tr class="parity0">
313 <td class="annotate">
313 <td class="annotate">
314 <a href="/annotate/853dcd4de2a6/primes.py#7"
314 <a href="/annotate/853dcd4de2a6/primes.py#7"
315 title="853dcd4de2a6: a">test@0</a>
315 title="853dcd4de2a6: a">test@0</a>
316 </td>
316 </td>
317 <td class="source"><a href="#l7" id="l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></td>
317 <td class="source"><a href="#l7" id="l7"> 7</a> <span class="sd">&quot;&quot;&quot;</span></td>
318 </tr>
318 </tr>
319 <tr class="parity1">
319 <tr class="parity1">
320 <td class="annotate">
320 <td class="annotate">
321 <a href="/annotate/853dcd4de2a6/primes.py#8"
321 <a href="/annotate/853dcd4de2a6/primes.py#8"
322 title="853dcd4de2a6: a">test@0</a>
322 title="853dcd4de2a6: a">test@0</a>
323 </td>
323 </td>
324 <td class="source"><a href="#l8" id="l8"> 8</a> </td>
324 <td class="source"><a href="#l8" id="l8"> 8</a> </td>
325 </tr>
325 </tr>
326 <tr class="parity0">
326 <tr class="parity0">
327 <td class="annotate">
327 <td class="annotate">
328 <a href="/annotate/853dcd4de2a6/primes.py#9"
328 <a href="/annotate/853dcd4de2a6/primes.py#9"
329 title="853dcd4de2a6: a">test@0</a>
329 title="853dcd4de2a6: a">test@0</a>
330 </td>
330 </td>
331 <td class="source"><a href="#l9" id="l9"> 9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
331 <td class="source"><a href="#l9" id="l9"> 9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
332 </tr>
332 </tr>
333 <tr class="parity1">
333 <tr class="parity1">
334 <td class="annotate">
334 <td class="annotate">
335 <a href="/annotate/853dcd4de2a6/primes.py#10"
335 <a href="/annotate/853dcd4de2a6/primes.py#10"
336 title="853dcd4de2a6: a">test@0</a>
336 title="853dcd4de2a6: a">test@0</a>
337 </td>
337 </td>
338 <td class="source"><a href="#l10" id="l10"> 10</a> </td>
338 <td class="source"><a href="#l10" id="l10"> 10</a> </td>
339 </tr>
339 </tr>
340 <tr class="parity0">
340 <tr class="parity0">
341 <td class="annotate">
341 <td class="annotate">
342 <a href="/annotate/853dcd4de2a6/primes.py#11"
342 <a href="/annotate/853dcd4de2a6/primes.py#11"
343 title="853dcd4de2a6: a">test@0</a>
343 title="853dcd4de2a6: a">test@0</a>
344 </td>
344 </td>
345 <td class="source"><a href="#l11" id="l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
345 <td class="source"><a href="#l11" id="l11"> 11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
346 </tr>
346 </tr>
347 <tr class="parity1">
347 <tr class="parity1">
348 <td class="annotate">
348 <td class="annotate">
349 <a href="/annotate/853dcd4de2a6/primes.py#12"
349 <a href="/annotate/853dcd4de2a6/primes.py#12"
350 title="853dcd4de2a6: a">test@0</a>
350 title="853dcd4de2a6: a">test@0</a>
351 </td>
351 </td>
352 <td class="source"><a href="#l12" id="l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
352 <td class="source"><a href="#l12" id="l12"> 12</a> <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
353 </tr>
353 </tr>
354 <tr class="parity0">
354 <tr class="parity0">
355 <td class="annotate">
355 <td class="annotate">
356 <a href="/annotate/853dcd4de2a6/primes.py#13"
356 <a href="/annotate/853dcd4de2a6/primes.py#13"
357 title="853dcd4de2a6: a">test@0</a>
357 title="853dcd4de2a6: a">test@0</a>
358 </td>
358 </td>
359 <td class="source"><a href="#l13" id="l13"> 13</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
359 <td class="source"><a href="#l13" id="l13"> 13</a> <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
360 </tr>
360 </tr>
361 <tr class="parity1">
361 <tr class="parity1">
362 <td class="annotate">
362 <td class="annotate">
363 <a href="/annotate/853dcd4de2a6/primes.py#14"
363 <a href="/annotate/853dcd4de2a6/primes.py#14"
364 title="853dcd4de2a6: a">test@0</a>
364 title="853dcd4de2a6: a">test@0</a>
365 </td>
365 </td>
366 <td class="source"><a href="#l14" id="l14"> 14</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
366 <td class="source"><a href="#l14" id="l14"> 14</a> <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
367 </tr>
367 </tr>
368 <tr class="parity0">
368 <tr class="parity0">
369 <td class="annotate">
369 <td class="annotate">
370 <a href="/annotate/853dcd4de2a6/primes.py#15"
370 <a href="/annotate/853dcd4de2a6/primes.py#15"
371 title="853dcd4de2a6: a">test@0</a>
371 title="853dcd4de2a6: a">test@0</a>
372 </td>
372 </td>
373 <td class="source"><a href="#l15" id="l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
373 <td class="source"><a href="#l15" id="l15"> 15</a> <span class="c"># It is important to yield *here* in order to stop the</span></td>
374 </tr>
374 </tr>
375 <tr class="parity1">
375 <tr class="parity1">
376 <td class="annotate">
376 <td class="annotate">
377 <a href="/annotate/853dcd4de2a6/primes.py#16"
377 <a href="/annotate/853dcd4de2a6/primes.py#16"
378 title="853dcd4de2a6: a">test@0</a>
378 title="853dcd4de2a6: a">test@0</a>
379 </td>
379 </td>
380 <td class="source"><a href="#l16" id="l16"> 16</a> <span class="c"># infinite recursion.</span></td>
380 <td class="source"><a href="#l16" id="l16"> 16</a> <span class="c"># infinite recursion.</span></td>
381 </tr>
381 </tr>
382 <tr class="parity0">
382 <tr class="parity0">
383 <td class="annotate">
383 <td class="annotate">
384 <a href="/annotate/853dcd4de2a6/primes.py#17"
384 <a href="/annotate/853dcd4de2a6/primes.py#17"
385 title="853dcd4de2a6: a">test@0</a>
385 title="853dcd4de2a6: a">test@0</a>
386 </td>
386 </td>
387 <td class="source"><a href="#l17" id="l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></td>
387 <td class="source"><a href="#l17" id="l17"> 17</a> <span class="kn">yield</span> <span class="n">p</span></td>
388 </tr>
388 </tr>
389 <tr class="parity1">
389 <tr class="parity1">
390 <td class="annotate">
390 <td class="annotate">
391 <a href="/annotate/853dcd4de2a6/primes.py#18"
391 <a href="/annotate/853dcd4de2a6/primes.py#18"
392 title="853dcd4de2a6: a">test@0</a>
392 title="853dcd4de2a6: a">test@0</a>
393 </td>
393 </td>
394 <td class="source"><a href="#l18" id="l18"> 18</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
394 <td class="source"><a href="#l18" id="l18"> 18</a> <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
395 </tr>
395 </tr>
396 <tr class="parity0">
396 <tr class="parity0">
397 <td class="annotate">
397 <td class="annotate">
398 <a href="/annotate/853dcd4de2a6/primes.py#19"
398 <a href="/annotate/853dcd4de2a6/primes.py#19"
399 title="853dcd4de2a6: a">test@0</a>
399 title="853dcd4de2a6: a">test@0</a>
400 </td>
400 </td>
401 <td class="source"><a href="#l19" id="l19"> 19</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
401 <td class="source"><a href="#l19" id="l19"> 19</a> <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
402 </tr>
402 </tr>
403 <tr class="parity1">
403 <tr class="parity1">
404 <td class="annotate">
404 <td class="annotate">
405 <a href="/annotate/853dcd4de2a6/primes.py#20"
405 <a href="/annotate/853dcd4de2a6/primes.py#20"
406 title="853dcd4de2a6: a">test@0</a>
406 title="853dcd4de2a6: a">test@0</a>
407 </td>
407 </td>
408 <td class="source"><a href="#l20" id="l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></td>
408 <td class="source"><a href="#l20" id="l20"> 20</a> <span class="kn">yield</span> <span class="n">n</span></td>
409 </tr>
409 </tr>
410 <tr class="parity0">
410 <tr class="parity0">
411 <td class="annotate">
411 <td class="annotate">
412 <a href="/annotate/853dcd4de2a6/primes.py#21"
412 <a href="/annotate/853dcd4de2a6/primes.py#21"
413 title="853dcd4de2a6: a">test@0</a>
413 title="853dcd4de2a6: a">test@0</a>
414 </td>
414 </td>
415 <td class="source"><a href="#l21" id="l21"> 21</a> </td>
415 <td class="source"><a href="#l21" id="l21"> 21</a> </td>
416 </tr>
416 </tr>
417 <tr class="parity1">
417 <tr class="parity1">
418 <td class="annotate">
418 <td class="annotate">
419 <a href="/annotate/853dcd4de2a6/primes.py#22"
419 <a href="/annotate/853dcd4de2a6/primes.py#22"
420 title="853dcd4de2a6: a">test@0</a>
420 title="853dcd4de2a6: a">test@0</a>
421 </td>
421 </td>
422 <td class="source"><a href="#l22" id="l22"> 22</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
422 <td class="source"><a href="#l22" id="l22"> 22</a> <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
423 </tr>
423 </tr>
424 <tr class="parity0">
424 <tr class="parity0">
425 <td class="annotate">
425 <td class="annotate">
426 <a href="/annotate/853dcd4de2a6/primes.py#23"
426 <a href="/annotate/853dcd4de2a6/primes.py#23"
427 title="853dcd4de2a6: a">test@0</a>
427 title="853dcd4de2a6: a">test@0</a>
428 </td>
428 </td>
429 <td class="source"><a href="#l23" id="l23"> 23</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
429 <td class="source"><a href="#l23" id="l23"> 23</a> <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
430 </tr>
430 </tr>
431 <tr class="parity1">
431 <tr class="parity1">
432 <td class="annotate">
432 <td class="annotate">
433 <a href="/annotate/853dcd4de2a6/primes.py#24"
433 <a href="/annotate/853dcd4de2a6/primes.py#24"
434 title="853dcd4de2a6: a">test@0</a>
434 title="853dcd4de2a6: a">test@0</a>
435 </td>
435 </td>
436 <td class="source"><a href="#l24" id="l24"> 24</a> </td>
436 <td class="source"><a href="#l24" id="l24"> 24</a> </td>
437 </tr>
437 </tr>
438 <tr class="parity0">
438 <tr class="parity0">
439 <td class="annotate">
439 <td class="annotate">
440 <a href="/annotate/853dcd4de2a6/primes.py#25"
440 <a href="/annotate/853dcd4de2a6/primes.py#25"
441 title="853dcd4de2a6: a">test@0</a>
441 title="853dcd4de2a6: a">test@0</a>
442 </td>
442 </td>
443 <td class="source"><a href="#l25" id="l25"> 25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
443 <td class="source"><a href="#l25" id="l25"> 25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
444 </tr>
444 </tr>
445 <tr class="parity1">
445 <tr class="parity1">
446 <td class="annotate">
446 <td class="annotate">
447 <a href="/annotate/853dcd4de2a6/primes.py#26"
447 <a href="/annotate/853dcd4de2a6/primes.py#26"
448 title="853dcd4de2a6: a">test@0</a>
448 title="853dcd4de2a6: a">test@0</a>
449 </td>
449 </td>
450 <td class="source"><a href="#l26" id="l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></td>
450 <td class="source"><a href="#l26" id="l26"> 26</a> <span class="kn">import</span> <span class="nn">sys</span></td>
451 </tr>
451 </tr>
452 <tr class="parity0">
452 <tr class="parity0">
453 <td class="annotate">
453 <td class="annotate">
454 <a href="/annotate/853dcd4de2a6/primes.py#27"
454 <a href="/annotate/853dcd4de2a6/primes.py#27"
455 title="853dcd4de2a6: a">test@0</a>
455 title="853dcd4de2a6: a">test@0</a>
456 </td>
456 </td>
457 <td class="source"><a href="#l27" id="l27"> 27</a> <span class="kn">try</span><span class="p">:</span></td>
457 <td class="source"><a href="#l27" id="l27"> 27</a> <span class="kn">try</span><span class="p">:</span></td>
458 </tr>
458 </tr>
459 <tr class="parity1">
459 <tr class="parity1">
460 <td class="annotate">
460 <td class="annotate">
461 <a href="/annotate/853dcd4de2a6/primes.py#28"
461 <a href="/annotate/853dcd4de2a6/primes.py#28"
462 title="853dcd4de2a6: a">test@0</a>
462 title="853dcd4de2a6: a">test@0</a>
463 </td>
463 </td>
464 <td class="source"><a href="#l28" id="l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span></td>
464 <td class="source"><a href="#l28" id="l28"> 28</a> <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span></td>
465 </tr>
465 </tr>
466 <tr class="parity0">
466 <tr class="parity0">
467 <td class="annotate">
467 <td class="annotate">
468 <a href="/annotate/853dcd4de2a6/primes.py#29"
468 <a href="/annotate/853dcd4de2a6/primes.py#29"
469 title="853dcd4de2a6: a">test@0</a>
469 title="853dcd4de2a6: a">test@0</a>
470 </td>
470 </td>
471 <td class="source"><a href="#l29" id="l29"> 29</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
471 <td class="source"><a href="#l29" id="l29"> 29</a> <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
472 </tr>
472 </tr>
473 <tr class="parity1">
473 <tr class="parity1">
474 <td class="annotate">
474 <td class="annotate">
475 <a href="/annotate/853dcd4de2a6/primes.py#30"
475 <a href="/annotate/853dcd4de2a6/primes.py#30"
476 title="853dcd4de2a6: a">test@0</a>
476 title="853dcd4de2a6: a">test@0</a>
477 </td>
477 </td>
478 <td class="source"><a href="#l30" id="l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
478 <td class="source"><a href="#l30" id="l30"> 30</a> <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
479 </tr>
479 </tr>
480 <tr class="parity0">
480 <tr class="parity0">
481 <td class="annotate">
481 <td class="annotate">
482 <a href="/annotate/853dcd4de2a6/primes.py#31"
482 <a href="/annotate/853dcd4de2a6/primes.py#31"
483 title="853dcd4de2a6: a">test@0</a>
483 title="853dcd4de2a6: a">test@0</a>
484 </td>
484 </td>
485 <td class="source"><a href="#l31" id="l31"> 31</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
485 <td class="source"><a href="#l31" id="l31"> 31</a> <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
486 </tr>
486 </tr>
487 <tr class="parity1">
487 <tr class="parity1">
488 <td class="annotate">
488 <td class="annotate">
489 <a href="/annotate/853dcd4de2a6/primes.py#32"
489 <a href="/annotate/853dcd4de2a6/primes.py#32"
490 title="853dcd4de2a6: a">test@0</a>
490 title="853dcd4de2a6: a">test@0</a>
491 </td>
491 </td>
492 <td class="source"><a href="#l32" id="l32"> 32</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
492 <td class="source"><a href="#l32" id="l32"> 32</a> <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
493 </tr>
493 </tr>
494 </table>
494 </table>
495 </div>
495 </div>
496 </div>
496 </div>
497 </div>
497 </div>
498
498
499
499
500
500
501 </body>
501 </body>
502 </html>
502 </html>
503
503
504
504
505 hgweb fileannotate, raw
505 hgweb fileannotate, raw
506
506
507 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \
507 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \
508 > | sed "s/test@//" > a
508 > | sed "s/test@//" > a
509 $ echo "200 Script output follows" > b
509 $ echo "200 Script output follows" > b
510 $ echo "" >> b
510 $ echo "" >> b
511 $ echo "" >> b
511 $ echo "" >> b
512 $ hg annotate "primes.py" >> b
512 $ hg annotate "primes.py" >> b
513 $ echo "" >> b
513 $ echo "" >> b
514 $ echo "" >> b
514 $ echo "" >> b
515 $ echo "" >> b
515 $ echo "" >> b
516 $ echo "" >> b
516 $ echo "" >> b
517 $ diff -u b a
517 $ diff -u b a
518 $ echo
518 $ echo
519
519
520
520
521 hgweb filerevision, raw
521 hgweb filerevision, raw
522
522
523 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \
523 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \
524 > > a
524 > > a
525 $ echo "200 Script output follows" > b
525 $ echo "200 Script output follows" > b
526 $ echo "" >> b
526 $ echo "" >> b
527 $ hg cat primes.py >> b
527 $ hg cat primes.py >> b
528 $ diff -u b a
528 $ diff -u b a
529 $ echo
529 $ echo
530
530
531
531
532 hgweb highlightcss friendly
532 hgweb highlightcss friendly
533
533
534 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
534 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
535 $ head -n 4 out
535 $ head -n 4 out
536 200 Script output follows
536 200 Script output follows
537
537
538 /* pygments_style = friendly */
538 /* pygments_style = friendly */
539
539
540 $ rm out
540 $ rm out
541
541
542 errors encountered
542 errors encountered
543
543
544 $ cat errors.log
544 $ cat errors.log
545 $ "$TESTDIR/killdaemons.py"
545 $ "$TESTDIR/killdaemons.py"
546
546
547 Change the pygments style
547 Change the pygments style
548
548
549 $ cat > .hg/hgrc <<EOF
549 $ cat > .hg/hgrc <<EOF
550 > [web]
550 > [web]
551 > pygments_style = fruity
551 > pygments_style = fruity
552 > EOF
552 > EOF
553
553
554 hg serve again
554 hg serve again
555
555
556 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
556 $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
557 $ cat hg.pid >> $DAEMON_PIDS
557 $ cat hg.pid >> $DAEMON_PIDS
558
558
559 hgweb highlightcss fruity
559 hgweb highlightcss fruity
560
560
561 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
561 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
562 $ head -n 4 out
562 $ head -n 4 out
563 200 Script output follows
563 200 Script output follows
564
564
565 /* pygments_style = fruity */
565 /* pygments_style = fruity */
566
566
567 $ rm out
567 $ rm out
568
568
569 errors encountered
569 errors encountered
570
570
571 $ cat errors.log
571 $ cat errors.log
572 $ cd ..
572 $ cd ..
573 $ hg init eucjp
573 $ hg init eucjp
574 $ cd eucjp
574 $ cd eucjp
575 $ python -c 'print("\265\376")' >> eucjp.txt # Japanese kanji "Kyo"
575 $ python -c 'print("\265\376")' >> eucjp.txt # Japanese kanji "Kyo"
576 $ hg ci -Ama
576 $ hg ci -Ama
577 adding eucjp.txt
577 adding eucjp.txt
578 $ hgserveget () {
578 $ hgserveget () {
579 > "$TESTDIR/killdaemons.py"
579 > "$TESTDIR/killdaemons.py"
580 > echo % HGENCODING="$1" hg serve
580 > echo % HGENCODING="$1" hg serve
581 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
581 > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
582 > cat hg.pid >> $DAEMON_PIDS
582 > cat hg.pid >> $DAEMON_PIDS
583 >
583 >
584 > echo % hgweb filerevision, html
584 > echo % hgweb filerevision, html
585 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
585 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
586 > | grep '<div class="parity0 source">' | $TESTDIR/printrepr.py
586 > | grep '<div class="parity0 source">'
587 > echo % errors encountered
587 > echo % errors encountered
588 > cat errors.log
588 > cat errors.log
589 > }
589 > }
590 $ hgserveget euc-jp eucjp.txt
590 $ hgserveget euc-jp eucjp.txt
591 % HGENCODING=euc-jp hg serve
591 % HGENCODING=euc-jp hg serve
592 % hgweb filerevision, html
592 % hgweb filerevision, html
593 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xb5\xfe</div>
593 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xb5\xfe</div> (esc)
594 % errors encountered
594 % errors encountered
595 $ hgserveget utf-8 eucjp.txt
595 $ hgserveget utf-8 eucjp.txt
596 % HGENCODING=utf-8 hg serve
596 % HGENCODING=utf-8 hg serve
597 % hgweb filerevision, html
597 % hgweb filerevision, html
598 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xef\xbf\xbd\xef\xbf\xbd</div>
598 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> \xef\xbf\xbd\xef\xbf\xbd</div> (esc)
599 % errors encountered
599 % errors encountered
600 $ hgserveget us-ascii eucjp.txt
600 $ hgserveget us-ascii eucjp.txt
601 % HGENCODING=us-ascii hg serve
601 % HGENCODING=us-ascii hg serve
602 % hgweb filerevision, html
602 % hgweb filerevision, html
603 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> ??</div>
603 <div class="parity0 source"><a href="#l1" id="l1"> 1</a> ??</div>
604 % errors encountered
604 % errors encountered
@@ -1,122 +1,146 b''
1 $ cat > makepatch.py <<EOF
1 $ cat > makepatch.py <<EOF
2 > f = file('eol.diff', 'wb')
2 > f = file('eol.diff', 'wb')
3 > w = f.write
3 > w = f.write
4 > w('test message\n')
4 > w('test message\n')
5 > w('diff --git a/a b/a\n')
5 > w('diff --git a/a b/a\n')
6 > w('--- a/a\n')
6 > w('--- a/a\n')
7 > w('+++ b/a\n')
7 > w('+++ b/a\n')
8 > w('@@ -1,5 +1,5 @@\n')
8 > w('@@ -1,5 +1,5 @@\n')
9 > w(' a\n')
9 > w(' a\n')
10 > w('-bbb\r\n')
10 > w('-bbb\r\n')
11 > w('+yyyy\r\n')
11 > w('+yyyy\r\n')
12 > w(' cc\r\n')
12 > w(' cc\r\n')
13 > w(' \n')
13 > w(' \n')
14 > w(' d\n')
14 > w(' d\n')
15 > w('-e\n')
15 > w('-e\n')
16 > w('\ No newline at end of file\n')
16 > w('\ No newline at end of file\n')
17 > w('+z\r\n')
17 > w('+z\r\n')
18 > w('\ No newline at end of file\r\n')
18 > w('\ No newline at end of file\r\n')
19 > EOF
19 > EOF
20
20
21 $ hg init repo
21 $ hg init repo
22 $ cd repo
22 $ cd repo
23 $ echo '\.diff' > .hgignore
23 $ echo '\.diff' > .hgignore
24
24
25
25
26 Test different --eol values
26 Test different --eol values
27
27
28 $ python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
28 $ python -c 'file("a", "wb").write("a\nbbb\ncc\n\nd\ne")'
29 $ hg ci -Am adda
29 $ hg ci -Am adda
30 adding .hgignore
30 adding .hgignore
31 adding a
31 adding a
32 $ python ../makepatch.py
32 $ python ../makepatch.py
33
33
34
34
35 invalid eol
35 invalid eol
36
36
37 $ hg --config patch.eol='LFCR' import eol.diff
37 $ hg --config patch.eol='LFCR' import eol.diff
38 applying eol.diff
38 applying eol.diff
39 abort: unsupported line endings type: LFCR
39 abort: unsupported line endings type: LFCR
40 [255]
40 [255]
41 $ hg revert -a
41 $ hg revert -a
42
42
43
43
44 force LF
44 force LF
45
45
46 $ hg --traceback --config patch.eol='LF' import eol.diff
46 $ hg --traceback --config patch.eol='LF' import eol.diff
47 applying eol.diff
47 applying eol.diff
48 $ python -c 'print repr(file("a","rb").read())'
48 $ cat a
49 'a\nyyyy\ncc\n\nd\ne'
49 a
50 yyyy
51 cc
52
53 d
54 e (no-eol)
50 $ hg st
55 $ hg st
51
56
52
57
53 force CRLF
58 force CRLF
54
59
55 $ hg up -C 0
60 $ hg up -C 0
56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 $ hg --traceback --config patch.eol='CRLF' import eol.diff
62 $ hg --traceback --config patch.eol='CRLF' import eol.diff
58 applying eol.diff
63 applying eol.diff
59 $ python -c 'print repr(file("a","rb").read())'
64 $ cat a
60 'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
65 a\r (esc)
66 yyyy\r (esc)
67 cc\r (esc)
68 \r (esc)
69 d\r (esc)
70 e (no-eol)
61 $ hg st
71 $ hg st
62
72
63
73
64 auto EOL on LF file
74 auto EOL on LF file
65
75
66 $ hg up -C 0
76 $ hg up -C 0
67 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 $ hg --traceback --config patch.eol='auto' import eol.diff
78 $ hg --traceback --config patch.eol='auto' import eol.diff
69 applying eol.diff
79 applying eol.diff
70 $ python -c 'print repr(file("a","rb").read())'
80 $ cat a
71 'a\nyyyy\ncc\n\nd\ne'
81 a
82 yyyy
83 cc
84
85 d
86 e (no-eol)
72 $ hg st
87 $ hg st
73
88
74
89
75 auto EOL on CRLF file
90 auto EOL on CRLF file
76
91
77 $ python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
92 $ python -c 'file("a", "wb").write("a\r\nbbb\r\ncc\r\n\r\nd\r\ne")'
78 $ hg commit -m 'switch EOLs in a'
93 $ hg commit -m 'switch EOLs in a'
79 $ hg --traceback --config patch.eol='auto' import eol.diff
94 $ hg --traceback --config patch.eol='auto' import eol.diff
80 applying eol.diff
95 applying eol.diff
81 $ python -c 'print repr(file("a","rb").read())'
96 $ cat a
82 'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
97 a\r (esc)
98 yyyy\r (esc)
99 cc\r (esc)
100 \r (esc)
101 d\r (esc)
102 e (no-eol)
83 $ hg st
103 $ hg st
84
104
85
105
86 auto EOL on new file or source without any EOL
106 auto EOL on new file or source without any EOL
87
107
88 $ python -c 'file("noeol", "wb").write("noeol")'
108 $ python -c 'file("noeol", "wb").write("noeol")'
89 $ hg add noeol
109 $ hg add noeol
90 $ hg commit -m 'add noeol'
110 $ hg commit -m 'add noeol'
91 $ python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
111 $ python -c 'file("noeol", "wb").write("noeol\r\nnoeol\n")'
92 $ python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
112 $ python -c 'file("neweol", "wb").write("neweol\nneweol\r\n")'
93 $ hg add neweol
113 $ hg add neweol
94 $ hg diff --git > noeol.diff
114 $ hg diff --git > noeol.diff
95 $ hg revert --no-backup noeol neweol
115 $ hg revert --no-backup noeol neweol
96 $ rm neweol
116 $ rm neweol
97 $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
117 $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
98 applying noeol.diff
118 applying noeol.diff
99 $ python -c 'print repr(file("noeol","rb").read())'
119 $ cat noeol
100 'noeol\r\nnoeol\n'
120 noeol\r (esc)
101 $ python -c 'print repr(file("neweol","rb").read())'
121 noeol
102 'neweol\nneweol\r\n'
122 $ cat neweol
123 neweol
124 neweol\r (esc)
103 $ hg st
125 $ hg st
104
126
105
127
106 Test --eol and binary patches
128 Test --eol and binary patches
107
129
108 $ python -c 'file("b", "wb").write("a\x00\nb\r\nd")'
130 $ python -c 'file("b", "wb").write("a\x00\nb\r\nd")'
109 $ hg ci -Am addb
131 $ hg ci -Am addb
110 adding b
132 adding b
111 $ python -c 'file("b", "wb").write("a\x00\nc\r\nd")'
133 $ python -c 'file("b", "wb").write("a\x00\nc\r\nd")'
112 $ hg diff --git > bin.diff
134 $ hg diff --git > bin.diff
113 $ hg revert --no-backup b
135 $ hg revert --no-backup b
114
136
115 binary patch with --eol
137 binary patch with --eol
116
138
117 $ hg import --config patch.eol='CRLF' -m changeb bin.diff
139 $ hg import --config patch.eol='CRLF' -m changeb bin.diff
118 applying bin.diff
140 applying bin.diff
119 $ python -c 'print repr(file("b","rb").read())'
141 $ cat b
120 'a\x00\nc\r\nd'
142 a\x00 (esc)
143 c\r (esc)
144 d (no-eol)
121 $ hg st
145 $ hg st
122 $ cd ..
146 $ cd ..
@@ -1,172 +1,172 b''
1
1
2 $ cp "$TESTDIR"/../contrib/simplemerge .
2 $ cp "$TESTDIR"/../contrib/simplemerge .
3 $ echo base > base
3 $ echo base > base
4 $ echo local > local
4 $ echo local > local
5 $ cat base >> local
5 $ cat base >> local
6 $ cp local orig
6 $ cp local orig
7 $ cat base > other
7 $ cat base > other
8 $ echo other >> other
8 $ echo other >> other
9
9
10 changing local directly
10 changing local directly
11
11
12 $ python simplemerge local base other && echo "merge succeeded"
12 $ python simplemerge local base other && echo "merge succeeded"
13 merge succeeded
13 merge succeeded
14 $ cat local
14 $ cat local
15 local
15 local
16 base
16 base
17 other
17 other
18 $ cp orig local
18 $ cp orig local
19
19
20 printing to stdout
20 printing to stdout
21
21
22 $ python simplemerge -p local base other
22 $ python simplemerge -p local base other
23 local
23 local
24 base
24 base
25 other
25 other
26
26
27 local:
27 local:
28
28
29 $ cat local
29 $ cat local
30 local
30 local
31 base
31 base
32
32
33 conflicts
33 conflicts
34
34
35 $ cp base conflict-local
35 $ cp base conflict-local
36 $ cp other conflict-other
36 $ cp other conflict-other
37 $ echo not other >> conflict-local
37 $ echo not other >> conflict-local
38 $ echo end >> conflict-local
38 $ echo end >> conflict-local
39 $ echo end >> conflict-other
39 $ echo end >> conflict-other
40 $ python simplemerge -p conflict-local base conflict-other
40 $ python simplemerge -p conflict-local base conflict-other
41 base
41 base
42 <<<<<<< conflict-local
42 <<<<<<< conflict-local
43 not other
43 not other
44 =======
44 =======
45 other
45 other
46 >>>>>>> conflict-other
46 >>>>>>> conflict-other
47 end
47 end
48 warning: conflicts during merge.
48 warning: conflicts during merge.
49 [1]
49 [1]
50
50
51 --no-minimal
51 --no-minimal
52
52
53 $ python simplemerge -p --no-minimal conflict-local base conflict-other
53 $ python simplemerge -p --no-minimal conflict-local base conflict-other
54 base
54 base
55 <<<<<<< conflict-local
55 <<<<<<< conflict-local
56 not other
56 not other
57 end
57 end
58 =======
58 =======
59 other
59 other
60 end
60 end
61 >>>>>>> conflict-other
61 >>>>>>> conflict-other
62 warning: conflicts during merge.
62 warning: conflicts during merge.
63 [1]
63 [1]
64
64
65 1 label
65 1 label
66
66
67 $ python simplemerge -p -L foo conflict-local base conflict-other
67 $ python simplemerge -p -L foo conflict-local base conflict-other
68 base
68 base
69 <<<<<<< foo
69 <<<<<<< foo
70 not other
70 not other
71 =======
71 =======
72 other
72 other
73 >>>>>>> conflict-other
73 >>>>>>> conflict-other
74 end
74 end
75 warning: conflicts during merge.
75 warning: conflicts during merge.
76 [1]
76 [1]
77
77
78 2 labels
78 2 labels
79
79
80 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
80 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
81 base
81 base
82 <<<<<<< foo
82 <<<<<<< foo
83 not other
83 not other
84 =======
84 =======
85 other
85 other
86 >>>>>>> bar
86 >>>>>>> bar
87 end
87 end
88 warning: conflicts during merge.
88 warning: conflicts during merge.
89 [1]
89 [1]
90
90
91 too many labels
91 too many labels
92
92
93 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
93 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
94 abort: can only specify two labels.
94 abort: can only specify two labels.
95 [255]
95 [255]
96
96
97 binary file
97 binary file
98
98
99 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
99 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
100 $ cat orig >> binary-local
100 $ cat orig >> binary-local
101 $ python simplemerge -p binary-local base other
101 $ python simplemerge -p binary-local base other
102 abort: binary-local looks like a binary file.
102 abort: binary-local looks like a binary file.
103 [255]
103 [255]
104
104
105 binary file --text
105 binary file --text
106
106
107 $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
107 $ python simplemerge -a -p binary-local base other 2>&1
108 warning: binary-local looks like a binary file.
108 warning: binary-local looks like a binary file.
109 \x00local
109 \x00local (esc)
110 base
110 base
111 other
111 other
112
112
113 help
113 help
114
114
115 $ python simplemerge --help
115 $ python simplemerge --help
116 simplemerge [OPTS] LOCAL BASE OTHER
116 simplemerge [OPTS] LOCAL BASE OTHER
117
117
118 Simple three-way file merge utility with a minimal feature set.
118 Simple three-way file merge utility with a minimal feature set.
119
119
120 Apply to LOCAL the changes necessary to go from BASE to OTHER.
120 Apply to LOCAL the changes necessary to go from BASE to OTHER.
121
121
122 By default, LOCAL is overwritten with the results of this operation.
122 By default, LOCAL is overwritten with the results of this operation.
123
123
124 options:
124 options:
125 -L --label labels to use on conflict markers
125 -L --label labels to use on conflict markers
126 -a --text treat all files as text
126 -a --text treat all files as text
127 -p --print print results instead of overwriting LOCAL
127 -p --print print results instead of overwriting LOCAL
128 --no-minimal do not try to minimize conflict regions
128 --no-minimal do not try to minimize conflict regions
129 -h --help display help and exit
129 -h --help display help and exit
130 -q --quiet suppress output
130 -q --quiet suppress output
131
131
132 wrong number of arguments
132 wrong number of arguments
133
133
134 $ python simplemerge
134 $ python simplemerge
135 simplemerge: wrong number of arguments
135 simplemerge: wrong number of arguments
136 simplemerge [OPTS] LOCAL BASE OTHER
136 simplemerge [OPTS] LOCAL BASE OTHER
137
137
138 Simple three-way file merge utility with a minimal feature set.
138 Simple three-way file merge utility with a minimal feature set.
139
139
140 Apply to LOCAL the changes necessary to go from BASE to OTHER.
140 Apply to LOCAL the changes necessary to go from BASE to OTHER.
141
141
142 By default, LOCAL is overwritten with the results of this operation.
142 By default, LOCAL is overwritten with the results of this operation.
143
143
144 options:
144 options:
145 -L --label labels to use on conflict markers
145 -L --label labels to use on conflict markers
146 -a --text treat all files as text
146 -a --text treat all files as text
147 -p --print print results instead of overwriting LOCAL
147 -p --print print results instead of overwriting LOCAL
148 --no-minimal do not try to minimize conflict regions
148 --no-minimal do not try to minimize conflict regions
149 -h --help display help and exit
149 -h --help display help and exit
150 -q --quiet suppress output
150 -q --quiet suppress output
151 [1]
151 [1]
152
152
153 bad option
153 bad option
154
154
155 $ python simplemerge --foo -p local base other
155 $ python simplemerge --foo -p local base other
156 simplemerge: option --foo not recognized
156 simplemerge: option --foo not recognized
157 simplemerge [OPTS] LOCAL BASE OTHER
157 simplemerge [OPTS] LOCAL BASE OTHER
158
158
159 Simple three-way file merge utility with a minimal feature set.
159 Simple three-way file merge utility with a minimal feature set.
160
160
161 Apply to LOCAL the changes necessary to go from BASE to OTHER.
161 Apply to LOCAL the changes necessary to go from BASE to OTHER.
162
162
163 By default, LOCAL is overwritten with the results of this operation.
163 By default, LOCAL is overwritten with the results of this operation.
164
164
165 options:
165 options:
166 -L --label labels to use on conflict markers
166 -L --label labels to use on conflict markers
167 -a --text treat all files as text
167 -a --text treat all files as text
168 -p --print print results instead of overwriting LOCAL
168 -p --print print results instead of overwriting LOCAL
169 --no-minimal do not try to minimize conflict regions
169 --no-minimal do not try to minimize conflict regions
170 -h --help display help and exit
170 -h --help display help and exit
171 -q --quiet suppress output
171 -q --quiet suppress output
172 [1]
172 [1]
@@ -1,362 +1,363 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > transplant=
3 > transplant=
4 > EOF
4 > EOF
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8 $ echo r1 > r1
8 $ echo r1 > r1
9 $ hg ci -Amr1 -d'0 0'
9 $ hg ci -Amr1 -d'0 0'
10 adding r1
10 adding r1
11 $ echo r2 > r2
11 $ echo r2 > r2
12 $ hg ci -Amr2 -d'1 0'
12 $ hg ci -Amr2 -d'1 0'
13 adding r2
13 adding r2
14 $ hg up 0
14 $ hg up 0
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
16
16
17 $ echo b1 > b1
17 $ echo b1 > b1
18 $ hg ci -Amb1 -d '0 0'
18 $ hg ci -Amb1 -d '0 0'
19 adding b1
19 adding b1
20 created new head
20 created new head
21 $ echo b2 > b2
21 $ echo b2 > b2
22 $ hg ci -Amb2 -d '1 0'
22 $ hg ci -Amb2 -d '1 0'
23 adding b2
23 adding b2
24 $ echo b3 > b3
24 $ echo b3 > b3
25 $ hg ci -Amb3 -d '2 0'
25 $ hg ci -Amb3 -d '2 0'
26 adding b3
26 adding b3
27
27
28 $ hg log --template '{rev} {parents} {desc}\n'
28 $ hg log --template '{rev} {parents} {desc}\n'
29 4 b3
29 4 b3
30 3 b2
30 3 b2
31 2 0:17ab29e464c6 b1
31 2 0:17ab29e464c6 b1
32 1 r2
32 1 r2
33 0 r1
33 0 r1
34
34
35 $ hg clone . ../rebase
35 $ hg clone . ../rebase
36 updating to branch default
36 updating to branch default
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ cd ../rebase
38 $ cd ../rebase
39
39
40 $ hg up -C 1
40 $ hg up -C 1
41 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
41 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
42
42
43 rebase b onto r1
43 rebase b onto r1
44
44
45 $ hg transplant -a -b tip
45 $ hg transplant -a -b tip
46 applying 37a1297eb21b
46 applying 37a1297eb21b
47 37a1297eb21b transplanted to e234d668f844
47 37a1297eb21b transplanted to e234d668f844
48 applying 722f4667af76
48 applying 722f4667af76
49 722f4667af76 transplanted to 539f377d78df
49 722f4667af76 transplanted to 539f377d78df
50 applying a53251cdf717
50 applying a53251cdf717
51 a53251cdf717 transplanted to ffd6818a3975
51 a53251cdf717 transplanted to ffd6818a3975
52 $ hg log --template '{rev} {parents} {desc}\n'
52 $ hg log --template '{rev} {parents} {desc}\n'
53 7 b3
53 7 b3
54 6 b2
54 6 b2
55 5 1:d11e3596cc1a b1
55 5 1:d11e3596cc1a b1
56 4 b3
56 4 b3
57 3 b2
57 3 b2
58 2 0:17ab29e464c6 b1
58 2 0:17ab29e464c6 b1
59 1 r2
59 1 r2
60 0 r1
60 0 r1
61
61
62 test transplanted revset
62 test transplanted revset
63
63
64 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
64 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
65 5 1:d11e3596cc1a b1
65 5 1:d11e3596cc1a b1
66 6 b2
66 6 b2
67 7 b3
67 7 b3
68 $ hg help revsets | grep transplanted
68 $ hg help revsets | grep transplanted
69 "transplanted(set)"
69 "transplanted(set)"
70
70
71 $ hg clone ../t ../prune
71 $ hg clone ../t ../prune
72 updating to branch default
72 updating to branch default
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 $ cd ../prune
74 $ cd ../prune
75
75
76 $ hg up -C 1
76 $ hg up -C 1
77 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
78
78
79 rebase b onto r1, skipping b2
79 rebase b onto r1, skipping b2
80
80
81 $ hg transplant -a -b tip -p 3
81 $ hg transplant -a -b tip -p 3
82 applying 37a1297eb21b
82 applying 37a1297eb21b
83 37a1297eb21b transplanted to e234d668f844
83 37a1297eb21b transplanted to e234d668f844
84 applying a53251cdf717
84 applying a53251cdf717
85 a53251cdf717 transplanted to 7275fda4d04f
85 a53251cdf717 transplanted to 7275fda4d04f
86 $ hg log --template '{rev} {parents} {desc}\n'
86 $ hg log --template '{rev} {parents} {desc}\n'
87 6 b3
87 6 b3
88 5 1:d11e3596cc1a b1
88 5 1:d11e3596cc1a b1
89 4 b3
89 4 b3
90 3 b2
90 3 b2
91 2 0:17ab29e464c6 b1
91 2 0:17ab29e464c6 b1
92 1 r2
92 1 r2
93 0 r1
93 0 r1
94
94
95
95
96 remote transplant
96 remote transplant
97
97
98 $ hg clone -r 1 ../t ../remote
98 $ hg clone -r 1 ../t ../remote
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
102 added 2 changesets with 2 changes to 2 files
102 added 2 changesets with 2 changes to 2 files
103 updating to branch default
103 updating to branch default
104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 $ cd ../remote
105 $ cd ../remote
106 $ hg transplant --log -s ../t 2 4
106 $ hg transplant --log -s ../t 2 4
107 searching for changes
107 searching for changes
108 applying 37a1297eb21b
108 applying 37a1297eb21b
109 37a1297eb21b transplanted to c19cf0ccb069
109 37a1297eb21b transplanted to c19cf0ccb069
110 applying a53251cdf717
110 applying a53251cdf717
111 a53251cdf717 transplanted to f7fe5bf98525
111 a53251cdf717 transplanted to f7fe5bf98525
112 $ hg log --template '{rev} {parents} {desc}\n'
112 $ hg log --template '{rev} {parents} {desc}\n'
113 3 b3
113 3 b3
114 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
114 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
115 2 b1
115 2 b1
116 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
116 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
117 1 r2
117 1 r2
118 0 r1
118 0 r1
119
119
120 skip previous transplants
120 skip previous transplants
121
121
122 $ hg transplant -s ../t -a -b 4
122 $ hg transplant -s ../t -a -b 4
123 searching for changes
123 searching for changes
124 applying 722f4667af76
124 applying 722f4667af76
125 722f4667af76 transplanted to 47156cd86c0b
125 722f4667af76 transplanted to 47156cd86c0b
126 $ hg log --template '{rev} {parents} {desc}\n'
126 $ hg log --template '{rev} {parents} {desc}\n'
127 4 b2
127 4 b2
128 3 b3
128 3 b3
129 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
129 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
130 2 b1
130 2 b1
131 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
131 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
132 1 r2
132 1 r2
133 0 r1
133 0 r1
134
134
135 skip local changes transplanted to the source
135 skip local changes transplanted to the source
136
136
137 $ echo b4 > b4
137 $ echo b4 > b4
138 $ hg ci -Amb4 -d '3 0'
138 $ hg ci -Amb4 -d '3 0'
139 adding b4
139 adding b4
140 $ hg clone ../t ../pullback
140 $ hg clone ../t ../pullback
141 updating to branch default
141 updating to branch default
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ cd ../pullback
143 $ cd ../pullback
144 $ hg transplant -s ../remote -a -b tip
144 $ hg transplant -s ../remote -a -b tip
145 searching for changes
145 searching for changes
146 applying 4333daefcb15
146 applying 4333daefcb15
147 4333daefcb15 transplanted to 5f42c04e07cc
147 4333daefcb15 transplanted to 5f42c04e07cc
148
148
149
149
150 remote transplant with pull
150 remote transplant with pull
151
151
152 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
152 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
153 $ cat ../t.pid >> $DAEMON_PIDS
153 $ cat ../t.pid >> $DAEMON_PIDS
154
154
155 $ hg clone -r 0 ../t ../rp
155 $ hg clone -r 0 ../t ../rp
156 adding changesets
156 adding changesets
157 adding manifests
157 adding manifests
158 adding file changes
158 adding file changes
159 added 1 changesets with 1 changes to 1 files
159 added 1 changesets with 1 changes to 1 files
160 updating to branch default
160 updating to branch default
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 $ cd ../rp
162 $ cd ../rp
163 $ hg transplant -s http://localhost:$HGPORT/ 2 4
163 $ hg transplant -s http://localhost:$HGPORT/ 2 4
164 searching for changes
164 searching for changes
165 searching for changes
165 searching for changes
166 adding changesets
166 adding changesets
167 adding manifests
167 adding manifests
168 adding file changes
168 adding file changes
169 added 1 changesets with 1 changes to 1 files
169 added 1 changesets with 1 changes to 1 files
170 applying a53251cdf717
170 applying a53251cdf717
171 a53251cdf717 transplanted to 8d9279348abb
171 a53251cdf717 transplanted to 8d9279348abb
172 $ hg log --template '{rev} {parents} {desc}\n'
172 $ hg log --template '{rev} {parents} {desc}\n'
173 2 b3
173 2 b3
174 1 b1
174 1 b1
175 0 r1
175 0 r1
176
176
177 transplant --continue
177 transplant --continue
178
178
179 $ hg init ../tc
179 $ hg init ../tc
180 $ cd ../tc
180 $ cd ../tc
181 $ cat <<EOF > foo
181 $ cat <<EOF > foo
182 > foo
182 > foo
183 > bar
183 > bar
184 > baz
184 > baz
185 > EOF
185 > EOF
186 $ echo toremove > toremove
186 $ echo toremove > toremove
187 $ hg ci -Amfoo
187 $ hg ci -Amfoo
188 adding foo
188 adding foo
189 adding toremove
189 adding toremove
190 $ cat <<EOF > foo
190 $ cat <<EOF > foo
191 > foo2
191 > foo2
192 > bar2
192 > bar2
193 > baz2
193 > baz2
194 > EOF
194 > EOF
195 $ rm toremove
195 $ rm toremove
196 $ echo added > added
196 $ echo added > added
197 $ hg ci -Amfoo2
197 $ hg ci -Amfoo2
198 adding added
198 adding added
199 removing toremove
199 removing toremove
200 $ echo bar > bar
200 $ echo bar > bar
201 $ hg ci -Ambar
201 $ hg ci -Ambar
202 adding bar
202 adding bar
203 $ echo bar2 >> bar
203 $ echo bar2 >> bar
204 $ hg ci -mbar2
204 $ hg ci -mbar2
205 $ hg up 0
205 $ hg up 0
206 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
206 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
207 $ echo foobar > foo
207 $ echo foobar > foo
208 $ hg ci -mfoobar
208 $ hg ci -mfoobar
209 created new head
209 created new head
210 $ hg transplant 1:3
210 $ hg transplant 1:3
211 applying a1e30dd1b8e7
211 applying a1e30dd1b8e7
212 patching file foo
212 patching file foo
213 Hunk #1 FAILED at 0
213 Hunk #1 FAILED at 0
214 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
214 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
215 patch failed to apply
215 patch failed to apply
216 abort: fix up the merge and run hg transplant --continue
216 abort: fix up the merge and run hg transplant --continue
217 [255]
217 [255]
218
218
219 transplant -c shouldn't use an old changeset
219 transplant -c shouldn't use an old changeset
220
220
221 $ hg up -C
221 $ hg up -C
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 $ rm added
223 $ rm added
224 $ hg transplant 1
224 $ hg transplant 1
225 applying a1e30dd1b8e7
225 applying a1e30dd1b8e7
226 patching file foo
226 patching file foo
227 Hunk #1 FAILED at 0
227 Hunk #1 FAILED at 0
228 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
228 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
229 patch failed to apply
229 patch failed to apply
230 abort: fix up the merge and run hg transplant --continue
230 abort: fix up the merge and run hg transplant --continue
231 [255]
231 [255]
232 $ hg transplant --continue
232 $ hg transplant --continue
233 a1e30dd1b8e7 transplanted as f1563cf27039
233 a1e30dd1b8e7 transplanted as f1563cf27039
234 $ hg transplant 1:3
234 $ hg transplant 1:3
235 skipping already applied revision 1:a1e30dd1b8e7
235 skipping already applied revision 1:a1e30dd1b8e7
236 applying 1739ac5f6139
236 applying 1739ac5f6139
237 1739ac5f6139 transplanted to d649c221319f
237 1739ac5f6139 transplanted to d649c221319f
238 applying 0282d5fbbe02
238 applying 0282d5fbbe02
239 0282d5fbbe02 transplanted to 77418277ccb3
239 0282d5fbbe02 transplanted to 77418277ccb3
240 $ hg locate
240 $ hg locate
241 added
241 added
242 bar
242 bar
243 foo
243 foo
244 $ cd ..
244 $ cd ..
245
245
246 Issue1111: Test transplant --merge
246 Issue1111: Test transplant --merge
247
247
248 $ hg init t1111
248 $ hg init t1111
249 $ cd t1111
249 $ cd t1111
250 $ echo a > a
250 $ echo a > a
251 $ hg ci -Am adda
251 $ hg ci -Am adda
252 adding a
252 adding a
253 $ echo b >> a
253 $ echo b >> a
254 $ hg ci -m appendb
254 $ hg ci -m appendb
255 $ echo c >> a
255 $ echo c >> a
256 $ hg ci -m appendc
256 $ hg ci -m appendc
257 $ hg up -C 0
257 $ hg up -C 0
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 $ echo d >> a
259 $ echo d >> a
260 $ hg ci -m appendd
260 $ hg ci -m appendd
261 created new head
261 created new head
262
262
263 tranplant
263 tranplant
264
264
265 $ hg transplant -m 1
265 $ hg transplant -m 1
266 applying 42dc4432fd35
266 applying 42dc4432fd35
267 1:42dc4432fd35 merged at a9f4acbac129
267 1:42dc4432fd35 merged at a9f4acbac129
268 $ cd ..
268 $ cd ..
269
269
270 test transplant into empty repository
270 test transplant into empty repository
271
271
272 $ hg init empty
272 $ hg init empty
273 $ cd empty
273 $ cd empty
274 $ hg transplant -s ../t -b tip -a
274 $ hg transplant -s ../t -b tip -a
275 adding changesets
275 adding changesets
276 adding manifests
276 adding manifests
277 adding file changes
277 adding file changes
278 added 4 changesets with 4 changes to 4 files
278 added 4 changesets with 4 changes to 4 files
279 $ cd ..
279 $ cd ..
280
280
281
281
282 test filter
282 test filter
283
283
284 $ hg init filter
284 $ hg init filter
285 $ cd filter
285 $ cd filter
286 $ cat <<'EOF' >test-filter
286 $ cat <<'EOF' >test-filter
287 > #!/bin/sh
287 > #!/bin/sh
288 > sed 's/r1/r2/' $1 > $1.new
288 > sed 's/r1/r2/' $1 > $1.new
289 > mv $1.new $1
289 > mv $1.new $1
290 > EOF
290 > EOF
291 $ chmod +x test-filter
291 $ chmod +x test-filter
292 $ hg transplant -s ../t -b tip -a --filter ./test-filter
292 $ hg transplant -s ../t -b tip -a --filter ./test-filter
293 filtering * (glob)
293 filtering * (glob)
294 applying 17ab29e464c6
294 applying 17ab29e464c6
295 17ab29e464c6 transplanted to e9ffc54ea104
295 17ab29e464c6 transplanted to e9ffc54ea104
296 filtering * (glob)
296 filtering * (glob)
297 applying 37a1297eb21b
297 applying 37a1297eb21b
298 37a1297eb21b transplanted to 348b36d0b6a5
298 37a1297eb21b transplanted to 348b36d0b6a5
299 filtering * (glob)
299 filtering * (glob)
300 applying 722f4667af76
300 applying 722f4667af76
301 722f4667af76 transplanted to 0aa6979afb95
301 722f4667af76 transplanted to 0aa6979afb95
302 filtering * (glob)
302 filtering * (glob)
303 applying a53251cdf717
303 applying a53251cdf717
304 a53251cdf717 transplanted to 14f8512272b5
304 a53251cdf717 transplanted to 14f8512272b5
305 $ hg log --template '{rev} {parents} {desc}\n'
305 $ hg log --template '{rev} {parents} {desc}\n'
306 3 b3
306 3 b3
307 2 b2
307 2 b2
308 1 b1
308 1 b1
309 0 r2
309 0 r2
310 $ cd ..
310 $ cd ..
311
311
312
312
313 test filter with failed patch
313 test filter with failed patch
314
314
315 $ cd filter
315 $ cd filter
316 $ hg up 0
316 $ hg up 0
317 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
317 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
318 $ echo foo > b1
318 $ echo foo > b1
319 $ hg ci -Am foo
319 $ hg ci -Am foo
320 adding b1
320 adding b1
321 adding test-filter
321 adding test-filter
322 created new head
322 created new head
323 $ hg transplant 1 --filter ./test-filter
323 $ hg transplant 1 --filter ./test-filter
324 filtering * (glob)
324 filtering * (glob)
325 applying 348b36d0b6a5
325 applying 348b36d0b6a5
326 file b1 already exists
326 file b1 already exists
327 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
327 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
328 patch failed to apply
328 patch failed to apply
329 abort: fix up the merge and run hg transplant --continue
329 abort: fix up the merge and run hg transplant --continue
330 [255]
330 [255]
331 $ cd ..
331 $ cd ..
332
332
333
333
334 test with a win32ext like setup (differing EOLs)
334 test with a win32ext like setup (differing EOLs)
335
335
336 $ hg init twin1
336 $ hg init twin1
337 $ cd twin1
337 $ cd twin1
338 $ echo a > a
338 $ echo a > a
339 $ echo b > b
339 $ echo b > b
340 $ echo b >> b
340 $ echo b >> b
341 $ hg ci -Am t
341 $ hg ci -Am t
342 adding a
342 adding a
343 adding b
343 adding b
344 $ echo a > b
344 $ echo a > b
345 $ echo b >> b
345 $ echo b >> b
346 $ hg ci -m changeb
346 $ hg ci -m changeb
347 $ cd ..
347 $ cd ..
348
348
349 $ hg init twin2
349 $ hg init twin2
350 $ cd twin2
350 $ cd twin2
351 $ echo '[patch]' >> .hg/hgrc
351 $ echo '[patch]' >> .hg/hgrc
352 $ echo 'eol = crlf' >> .hg/hgrc
352 $ echo 'eol = crlf' >> .hg/hgrc
353 $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
353 $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
354 $ hg ci -m addb
354 $ hg ci -m addb
355 nothing changed
355 nothing changed
356 [1]
356 [1]
357 $ hg transplant -s ../twin1 tip
357 $ hg transplant -s ../twin1 tip
358 applying 2e849d776c17
358 applying 2e849d776c17
359 2e849d776c17 transplanted to 589cea8ba85b
359 2e849d776c17 transplanted to 589cea8ba85b
360 $ python -c "print repr(file('b', 'rb').read())"
360 $ cat b
361 'a\r\nb\r\n'
361 a\r (esc)
362 b\r (esc)
362 $ cd ..
363 $ cd ..
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now