Show More
@@ -0,0 +1,17 | |||||
|
1 | import sys | |||
|
2 | ||||
|
3 | from mercurial import ( | |||
|
4 | pycompat, | |||
|
5 | util, | |||
|
6 | ) | |||
|
7 | ||||
|
8 | def main(argv): | |||
|
9 | enc = util.urlreq.quote(pycompat.sysbytes(argv[1])) | |||
|
10 | if pycompat.iswindows: | |||
|
11 | fmt = 'file:///%s' | |||
|
12 | else: | |||
|
13 | fmt = 'file://%s' | |||
|
14 | print(fmt % pycompat.sysstr(enc)) | |||
|
15 | ||||
|
16 | if __name__ == '__main__': | |||
|
17 | main(sys.argv) |
@@ -1,122 +1,118 | |||||
1 | #require svn svn-bindings |
|
1 | #require svn svn-bindings | |
2 |
|
2 | |||
3 | $ filter_svn_output () { |
|
3 | $ filter_svn_output () { | |
4 | > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true |
|
4 | > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true | |
5 | > } |
|
5 | > } | |
6 |
|
6 | |||
7 | $ cat <<EOF >> $HGRCPATH |
|
7 | $ cat <<EOF >> $HGRCPATH | |
8 | > [extensions] |
|
8 | > [extensions] | |
9 | > convert = |
|
9 | > convert = | |
10 | > mq = |
|
10 | > mq = | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ SVNREPOPATH=`pwd`/svn-repo |
|
13 | $ SVNREPOPATH=`pwd`/svn-repo | |
14 | #if windows |
|
14 | $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" | |
15 | $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
16 | #else |
|
|||
17 | $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
18 | #endif |
|
|||
19 |
|
|
15 | ||
20 | $ svnadmin create "$SVNREPOPATH" |
|
16 | $ svnadmin create "$SVNREPOPATH" | |
21 | $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF |
|
17 | $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF | |
22 | > #!/bin/sh |
|
18 | > #!/bin/sh | |
23 | > |
|
19 | > | |
24 | > REPOS="$1" |
|
20 | > REPOS="$1" | |
25 | > REV="$2" |
|
21 | > REV="$2" | |
26 | > USER="$3" |
|
22 | > USER="$3" | |
27 | > PROPNAME="$4" |
|
23 | > PROPNAME="$4" | |
28 | > ACTION="$5" |
|
24 | > ACTION="$5" | |
29 | > |
|
25 | > | |
30 | > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi |
|
26 | > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi | |
31 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi |
|
27 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi | |
32 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi |
|
28 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi | |
33 | > |
|
29 | > | |
34 | > echo "Changing prohibited revision property" >&2 |
|
30 | > echo "Changing prohibited revision property" >&2 | |
35 | > exit 1 |
|
31 | > exit 1 | |
36 | > EOF |
|
32 | > EOF | |
37 | $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change |
|
33 | $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change | |
38 | $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc |
|
34 | $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc | |
39 | Checked out revision 0. |
|
35 | Checked out revision 0. | |
40 | $ cd "$SVNREPOPATH"-wc |
|
36 | $ cd "$SVNREPOPATH"-wc | |
41 | $ echo a > a |
|
37 | $ echo a > a | |
42 | $ svn add a |
|
38 | $ svn add a | |
43 | A a |
|
39 | A a | |
44 | $ svn ci -m'added a' a | filter_svn_output |
|
40 | $ svn ci -m'added a' a | filter_svn_output | |
45 | Adding a |
|
41 | Adding a | |
46 | Transmitting file data . |
|
42 | Transmitting file data . | |
47 | Committed revision 1. |
|
43 | Committed revision 1. | |
48 | $ cd .. |
|
44 | $ cd .. | |
49 |
|
45 | |||
50 | initial roundtrip |
|
46 | initial roundtrip | |
51 |
|
47 | |||
52 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing |
|
48 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing | |
53 | scanning source... |
|
49 | scanning source... | |
54 | sorting... |
|
50 | sorting... | |
55 | converting... |
|
51 | converting... | |
56 | 0 added a |
|
52 | 0 added a | |
57 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
|
53 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc | |
58 | scanning source... |
|
54 | scanning source... | |
59 | sorting... |
|
55 | sorting... | |
60 | converting... |
|
56 | converting... | |
61 |
|
57 | |||
62 | second roundtrip should do nothing |
|
58 | second roundtrip should do nothing | |
63 |
|
59 | |||
64 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg |
|
60 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | |
65 | scanning source... |
|
61 | scanning source... | |
66 | sorting... |
|
62 | sorting... | |
67 | converting... |
|
63 | converting... | |
68 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
|
64 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc | |
69 | scanning source... |
|
65 | scanning source... | |
70 | sorting... |
|
66 | sorting... | |
71 | converting... |
|
67 | converting... | |
72 |
|
68 | |||
73 | new hg rev |
|
69 | new hg rev | |
74 |
|
70 | |||
75 | $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work |
|
71 | $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work | |
76 | updating to branch default |
|
72 | updating to branch default | |
77 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
73 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 | $ cd "$SVNREPOPATH"-work |
|
74 | $ cd "$SVNREPOPATH"-work | |
79 | $ echo b > b |
|
75 | $ echo b > b | |
80 | $ hg add b |
|
76 | $ hg add b | |
81 | $ hg ci -mb |
|
77 | $ hg ci -mb | |
82 |
|
78 | |||
83 | adding an empty revision |
|
79 | adding an empty revision | |
84 |
|
80 | |||
85 | $ hg qnew -m emtpy empty |
|
81 | $ hg qnew -m emtpy empty | |
86 | $ hg qfinish -a |
|
82 | $ hg qfinish -a | |
87 | $ cd .. |
|
83 | $ cd .. | |
88 |
|
84 | |||
89 | echo hg to svn |
|
85 | echo hg to svn | |
90 |
|
86 | |||
91 | $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work |
|
87 | $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work | |
92 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
|
88 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc | |
93 | scanning source... |
|
89 | scanning source... | |
94 | sorting... |
|
90 | sorting... | |
95 | converting... |
|
91 | converting... | |
96 | 1 b |
|
92 | 1 b | |
97 | 0 emtpy |
|
93 | 0 emtpy | |
98 |
|
94 | |||
99 | svn back to hg should do nothing |
|
95 | svn back to hg should do nothing | |
100 |
|
96 | |||
101 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg |
|
97 | $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | |
102 | scanning source... |
|
98 | scanning source... | |
103 | sorting... |
|
99 | sorting... | |
104 | converting... |
|
100 | converting... | |
105 |
|
101 | |||
106 | hg back to svn should do nothing |
|
102 | hg back to svn should do nothing | |
107 |
|
103 | |||
108 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
|
104 | $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc | |
109 | scanning source... |
|
105 | scanning source... | |
110 | sorting... |
|
106 | sorting... | |
111 | converting... |
|
107 | converting... | |
112 |
|
108 | |||
113 | verify which shamap format we are storing and must be able to handle |
|
109 | verify which shamap format we are storing and must be able to handle | |
114 |
|
110 | |||
115 | $ cat svn-repo-hg/.hg/shamap |
|
111 | $ cat svn-repo-hg/.hg/shamap | |
116 | svn:????????-????-????-????-????????????@1 ???????????????????????????????????????? (glob) |
|
112 | svn:????????-????-????-????-????????????@1 ???????????????????????????????????????? (glob) | |
117 | svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) |
|
113 | svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) | |
118 | svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) |
|
114 | svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) | |
119 | $ cat svn-repo-wc/.svn/hg-shamap |
|
115 | $ cat svn-repo-wc/.svn/hg-shamap | |
120 | ???????????????????????????????????????? 1 (glob) |
|
116 | ???????????????????????????????????????? 1 (glob) | |
121 | ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) |
|
117 | ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) | |
122 | ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) |
|
118 | ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) |
@@ -1,245 +1,241 | |||||
1 | #require svn svn-bindings |
|
1 | #require svn svn-bindings | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > convert = |
|
5 | > convert = | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ svnadmin create svn-repo |
|
8 | $ svnadmin create svn-repo | |
9 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump" |
|
9 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump" | |
10 | $ SVNREPOPATH=`pwd`/svn-repo |
|
10 | $ SVNREPOPATH=`pwd`/svn-repo | |
11 | #if windows |
|
11 | $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" | |
12 | $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
13 | #else |
|
|||
14 | $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
15 | #endif |
|
|||
16 |
|
|
12 | ||
17 | Convert trunk and branches |
|
13 | Convert trunk and branches | |
18 |
|
14 | |||
19 | $ hg convert --datesort "$SVNREPOURL"/subproject A-hg |
|
15 | $ hg convert --datesort "$SVNREPOURL"/subproject A-hg | |
20 | initializing destination A-hg repository |
|
16 | initializing destination A-hg repository | |
21 | scanning source... |
|
17 | scanning source... | |
22 | sorting... |
|
18 | sorting... | |
23 | converting... |
|
19 | converting... | |
24 | 13 createtrunk |
|
20 | 13 createtrunk | |
25 | 12 moved1 |
|
21 | 12 moved1 | |
26 | 11 moved1 |
|
22 | 11 moved1 | |
27 | 10 moved2 |
|
23 | 10 moved2 | |
28 | 9 changeb and rm d2 |
|
24 | 9 changeb and rm d2 | |
29 | 8 changeb and rm d2 |
|
25 | 8 changeb and rm d2 | |
30 | 7 moved1again |
|
26 | 7 moved1again | |
31 | 6 moved1again |
|
27 | 6 moved1again | |
32 | 5 copyfilefrompast |
|
28 | 5 copyfilefrompast | |
33 | 4 copydirfrompast |
|
29 | 4 copydirfrompast | |
34 | 3 add d3 |
|
30 | 3 add d3 | |
35 | 2 copy dir and remove subdir |
|
31 | 2 copy dir and remove subdir | |
36 | 1 add d4old |
|
32 | 1 add d4old | |
37 | 0 rename d4old into d4new |
|
33 | 0 rename d4old into d4new | |
38 |
|
34 | |||
39 | $ cd A-hg |
|
35 | $ cd A-hg | |
40 | $ hg log -G --template '{rev} {desc|firstline} files: {files}\n' |
|
36 | $ hg log -G --template '{rev} {desc|firstline} files: {files}\n' | |
41 | o 13 rename d4old into d4new files: d4new/g d4old/g |
|
37 | o 13 rename d4old into d4new files: d4new/g d4old/g | |
42 | | |
|
38 | | | |
43 | o 12 add d4old files: d4old/g |
|
39 | o 12 add d4old files: d4old/g | |
44 | | |
|
40 | | | |
45 | o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f |
|
41 | o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f | |
46 | | |
|
42 | | | |
47 | o 10 add d3 files: d3/d31/e d3/f |
|
43 | o 10 add d3 files: d3/d31/e d3/f | |
48 | | |
|
44 | | | |
49 | o 9 copydirfrompast files: d2/d |
|
45 | o 9 copydirfrompast files: d2/d | |
50 | | |
|
46 | | | |
51 | o 8 copyfilefrompast files: d |
|
47 | o 8 copyfilefrompast files: d | |
52 | | |
|
48 | | | |
53 | o 7 moved1again files: d1/b d1/c |
|
49 | o 7 moved1again files: d1/b d1/c | |
54 | | |
|
50 | | | |
55 | | o 6 moved1again files: |
|
51 | | o 6 moved1again files: | |
56 | | | |
|
52 | | | | |
57 | o | 5 changeb and rm d2 files: d1/b d2/d |
|
53 | o | 5 changeb and rm d2 files: d1/b d2/d | |
58 | | | |
|
54 | | | | |
59 | | o 4 changeb and rm d2 files: b |
|
55 | | o 4 changeb and rm d2 files: b | |
60 | | | |
|
56 | | | | |
61 | o | 3 moved2 files: d2/d |
|
57 | o | 3 moved2 files: d2/d | |
62 | | | |
|
58 | | | | |
63 | o | 2 moved1 files: d1/b d1/c |
|
59 | o | 2 moved1 files: d1/b d1/c | |
64 | | | |
|
60 | | | | |
65 | | o 1 moved1 files: b c |
|
61 | | o 1 moved1 files: b c | |
66 | | |
|
62 | | | |
67 | o 0 createtrunk files: |
|
63 | o 0 createtrunk files: | |
68 |
|
64 | |||
69 |
|
65 | |||
70 | Check move copy records |
|
66 | Check move copy records | |
71 |
|
67 | |||
72 | $ hg st --rev 12:13 --copies |
|
68 | $ hg st --rev 12:13 --copies | |
73 | A d4new/g |
|
69 | A d4new/g | |
74 | d4old/g |
|
70 | d4old/g | |
75 | R d4old/g |
|
71 | R d4old/g | |
76 |
|
72 | |||
77 | Check branches |
|
73 | Check branches | |
78 |
|
74 | |||
79 | $ hg branches |
|
75 | $ hg branches | |
80 | default 13:* (glob) |
|
76 | default 13:* (glob) | |
81 | d1 6:* (glob) |
|
77 | d1 6:* (glob) | |
82 | $ cd .. |
|
78 | $ cd .. | |
83 |
|
79 | |||
84 | $ mkdir test-replace |
|
80 | $ mkdir test-replace | |
85 | $ cd test-replace |
|
81 | $ cd test-replace | |
86 | $ svnadmin create svn-repo |
|
82 | $ svnadmin create svn-repo | |
87 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump" |
|
83 | $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump" | |
88 |
|
84 | |||
89 | Convert files being replaced by directories |
|
85 | Convert files being replaced by directories | |
90 |
|
86 | |||
91 | $ hg convert svn-repo hg-repo |
|
87 | $ hg convert svn-repo hg-repo | |
92 | initializing destination hg-repo repository |
|
88 | initializing destination hg-repo repository | |
93 | scanning source... |
|
89 | scanning source... | |
94 | sorting... |
|
90 | sorting... | |
95 | converting... |
|
91 | converting... | |
96 | 6 initial |
|
92 | 6 initial | |
97 | 5 clobber symlink |
|
93 | 5 clobber symlink | |
98 | 4 clobber1 |
|
94 | 4 clobber1 | |
99 | 3 clobber2 |
|
95 | 3 clobber2 | |
100 | 2 adddb |
|
96 | 2 adddb | |
101 | 1 clobberdir |
|
97 | 1 clobberdir | |
102 | 0 branch |
|
98 | 0 branch | |
103 |
|
99 | |||
104 | $ cd hg-repo |
|
100 | $ cd hg-repo | |
105 |
|
101 | |||
106 | Manifest before |
|
102 | Manifest before | |
107 |
|
103 | |||
108 | $ hg -v manifest -r 1 |
|
104 | $ hg -v manifest -r 1 | |
109 | 644 a |
|
105 | 644 a | |
110 | 644 d/b |
|
106 | 644 d/b | |
111 | 644 d2/a |
|
107 | 644 d2/a | |
112 | 644 @ dlink |
|
108 | 644 @ dlink | |
113 | 644 @ dlink2 |
|
109 | 644 @ dlink2 | |
114 | 644 dlink3 |
|
110 | 644 dlink3 | |
115 |
|
111 | |||
116 | Manifest after clobber1 |
|
112 | Manifest after clobber1 | |
117 |
|
113 | |||
118 | $ hg -v manifest -r 2 |
|
114 | $ hg -v manifest -r 2 | |
119 | 644 a/b |
|
115 | 644 a/b | |
120 | 644 d/b |
|
116 | 644 d/b | |
121 | 644 d2/a |
|
117 | 644 d2/a | |
122 | 644 dlink/b |
|
118 | 644 dlink/b | |
123 | 644 @ dlink2 |
|
119 | 644 @ dlink2 | |
124 | 644 dlink3 |
|
120 | 644 dlink3 | |
125 |
|
121 | |||
126 | Manifest after clobber2 |
|
122 | Manifest after clobber2 | |
127 |
|
123 | |||
128 | $ hg -v manifest -r 3 |
|
124 | $ hg -v manifest -r 3 | |
129 | 644 a/b |
|
125 | 644 a/b | |
130 | 644 d/b |
|
126 | 644 d/b | |
131 | 644 d2/a |
|
127 | 644 d2/a | |
132 | 644 dlink/b |
|
128 | 644 dlink/b | |
133 | 644 @ dlink2 |
|
129 | 644 @ dlink2 | |
134 | 644 @ dlink3 |
|
130 | 644 @ dlink3 | |
135 |
|
131 | |||
136 | Manifest after clobberdir |
|
132 | Manifest after clobberdir | |
137 |
|
133 | |||
138 | $ hg -v manifest -r 6 |
|
134 | $ hg -v manifest -r 6 | |
139 | 644 a/b |
|
135 | 644 a/b | |
140 | 644 d/b |
|
136 | 644 d/b | |
141 | 644 d2/a |
|
137 | 644 d2/a | |
142 | 644 d2/c |
|
138 | 644 d2/c | |
143 | 644 dlink/b |
|
139 | 644 dlink/b | |
144 | 644 @ dlink2 |
|
140 | 644 @ dlink2 | |
145 | 644 @ dlink3 |
|
141 | 644 @ dlink3 | |
146 |
|
142 | |||
147 | Try updating |
|
143 | Try updating | |
148 |
|
144 | |||
149 | $ hg up -qC default |
|
145 | $ hg up -qC default | |
150 | $ cd .. |
|
146 | $ cd .. | |
151 |
|
147 | |||
152 | Test convert progress bar |
|
148 | Test convert progress bar | |
153 |
|
149 | |||
154 | $ cat >> $HGRCPATH <<EOF |
|
150 | $ cat >> $HGRCPATH <<EOF | |
155 | > [progress] |
|
151 | > [progress] | |
156 | > assume-tty = 1 |
|
152 | > assume-tty = 1 | |
157 | > delay = 0 |
|
153 | > delay = 0 | |
158 | > changedelay = 0 |
|
154 | > changedelay = 0 | |
159 | > format = topic bar number |
|
155 | > format = topic bar number | |
160 | > refresh = 0 |
|
156 | > refresh = 0 | |
161 | > width = 60 |
|
157 | > width = 60 | |
162 | > EOF |
|
158 | > EOF | |
163 |
|
159 | |||
164 | $ hg convert svn-repo hg-progress |
|
160 | $ hg convert svn-repo hg-progress | |
165 | \r (no-eol) (esc) |
|
161 | \r (no-eol) (esc) | |
166 | scanning [=====> ] 1/7\r (no-eol) (esc) |
|
162 | scanning [=====> ] 1/7\r (no-eol) (esc) | |
167 | scanning [===========> ] 2/7\r (no-eol) (esc) |
|
163 | scanning [===========> ] 2/7\r (no-eol) (esc) | |
168 | scanning [=================> ] 3/7\r (no-eol) (esc) |
|
164 | scanning [=================> ] 3/7\r (no-eol) (esc) | |
169 | scanning [========================> ] 4/7\r (no-eol) (esc) |
|
165 | scanning [========================> ] 4/7\r (no-eol) (esc) | |
170 | scanning [==============================> ] 5/7\r (no-eol) (esc) |
|
166 | scanning [==============================> ] 5/7\r (no-eol) (esc) | |
171 | scanning [====================================> ] 6/7\r (no-eol) (esc) |
|
167 | scanning [====================================> ] 6/7\r (no-eol) (esc) | |
172 | scanning [===========================================>] 7/7\r (no-eol) (esc) |
|
168 | scanning [===========================================>] 7/7\r (no-eol) (esc) | |
173 | \r (no-eol) (esc) |
|
169 | \r (no-eol) (esc) | |
174 | \r (no-eol) (esc) |
|
170 | \r (no-eol) (esc) | |
175 | converting [ ] 0/7\r (no-eol) (esc) |
|
171 | converting [ ] 0/7\r (no-eol) (esc) | |
176 | getting files [=====> ] 1/6\r (no-eol) (esc) |
|
172 | getting files [=====> ] 1/6\r (no-eol) (esc) | |
177 | getting files [============> ] 2/6\r (no-eol) (esc) |
|
173 | getting files [============> ] 2/6\r (no-eol) (esc) | |
178 | getting files [==================> ] 3/6\r (no-eol) (esc) |
|
174 | getting files [==================> ] 3/6\r (no-eol) (esc) | |
179 | getting files [=========================> ] 4/6\r (no-eol) (esc) |
|
175 | getting files [=========================> ] 4/6\r (no-eol) (esc) | |
180 | getting files [===============================> ] 5/6\r (no-eol) (esc) |
|
176 | getting files [===============================> ] 5/6\r (no-eol) (esc) | |
181 | getting files [======================================>] 6/6\r (no-eol) (esc) |
|
177 | getting files [======================================>] 6/6\r (no-eol) (esc) | |
182 | \r (no-eol) (esc) |
|
178 | \r (no-eol) (esc) | |
183 | \r (no-eol) (esc) |
|
179 | \r (no-eol) (esc) | |
184 | converting [=====> ] 1/7\r (no-eol) (esc) |
|
180 | converting [=====> ] 1/7\r (no-eol) (esc) | |
185 | scanning paths [ ] 0/1\r (no-eol) (esc) |
|
181 | scanning paths [ ] 0/1\r (no-eol) (esc) | |
186 | getting files [======================================>] 1/1\r (no-eol) (esc) |
|
182 | getting files [======================================>] 1/1\r (no-eol) (esc) | |
187 | \r (no-eol) (esc) |
|
183 | \r (no-eol) (esc) | |
188 | \r (no-eol) (esc) |
|
184 | \r (no-eol) (esc) | |
189 | converting [===========> ] 2/7\r (no-eol) (esc) |
|
185 | converting [===========> ] 2/7\r (no-eol) (esc) | |
190 | scanning paths [ ] 0/2\r (no-eol) (esc) |
|
186 | scanning paths [ ] 0/2\r (no-eol) (esc) | |
191 | scanning paths [==================> ] 1/2\r (no-eol) (esc) |
|
187 | scanning paths [==================> ] 1/2\r (no-eol) (esc) | |
192 | getting files [========> ] 1/4\r (no-eol) (esc) |
|
188 | getting files [========> ] 1/4\r (no-eol) (esc) | |
193 | getting files [==================> ] 2/4\r (no-eol) (esc) |
|
189 | getting files [==================> ] 2/4\r (no-eol) (esc) | |
194 | getting files [============================> ] 3/4\r (no-eol) (esc) |
|
190 | getting files [============================> ] 3/4\r (no-eol) (esc) | |
195 | getting files [======================================>] 4/4\r (no-eol) (esc) |
|
191 | getting files [======================================>] 4/4\r (no-eol) (esc) | |
196 | \r (no-eol) (esc) |
|
192 | \r (no-eol) (esc) | |
197 | \r (no-eol) (esc) |
|
193 | \r (no-eol) (esc) | |
198 | converting [=================> ] 3/7\r (no-eol) (esc) |
|
194 | converting [=================> ] 3/7\r (no-eol) (esc) | |
199 | scanning paths [ ] 0/1\r (no-eol) (esc) |
|
195 | scanning paths [ ] 0/1\r (no-eol) (esc) | |
200 | getting files [======================================>] 1/1\r (no-eol) (esc) |
|
196 | getting files [======================================>] 1/1\r (no-eol) (esc) | |
201 | \r (no-eol) (esc) |
|
197 | \r (no-eol) (esc) | |
202 | \r (no-eol) (esc) |
|
198 | \r (no-eol) (esc) | |
203 | converting [=======================> ] 4/7\r (no-eol) (esc) |
|
199 | converting [=======================> ] 4/7\r (no-eol) (esc) | |
204 | scanning paths [ ] 0/1\r (no-eol) (esc) |
|
200 | scanning paths [ ] 0/1\r (no-eol) (esc) | |
205 | getting files [======================================>] 1/1\r (no-eol) (esc) |
|
201 | getting files [======================================>] 1/1\r (no-eol) (esc) | |
206 | \r (no-eol) (esc) |
|
202 | \r (no-eol) (esc) | |
207 | \r (no-eol) (esc) |
|
203 | \r (no-eol) (esc) | |
208 | converting [=============================> ] 5/7\r (no-eol) (esc) |
|
204 | converting [=============================> ] 5/7\r (no-eol) (esc) | |
209 | scanning paths [ ] 0/1\r (no-eol) (esc) |
|
205 | scanning paths [ ] 0/1\r (no-eol) (esc) | |
210 | getting files [===> ] 1/8\r (no-eol) (esc) |
|
206 | getting files [===> ] 1/8\r (no-eol) (esc) | |
211 | getting files [========> ] 2/8\r (no-eol) (esc) |
|
207 | getting files [========> ] 2/8\r (no-eol) (esc) | |
212 | getting files [=============> ] 3/8\r (no-eol) (esc) |
|
208 | getting files [=============> ] 3/8\r (no-eol) (esc) | |
213 | getting files [==================> ] 4/8\r (no-eol) (esc) |
|
209 | getting files [==================> ] 4/8\r (no-eol) (esc) | |
214 | getting files [=======================> ] 5/8\r (no-eol) (esc) |
|
210 | getting files [=======================> ] 5/8\r (no-eol) (esc) | |
215 | getting files [============================> ] 6/8\r (no-eol) (esc) |
|
211 | getting files [============================> ] 6/8\r (no-eol) (esc) | |
216 | getting files [=================================> ] 7/8\r (no-eol) (esc) |
|
212 | getting files [=================================> ] 7/8\r (no-eol) (esc) | |
217 | getting files [======================================>] 8/8\r (no-eol) (esc) |
|
213 | getting files [======================================>] 8/8\r (no-eol) (esc) | |
218 | \r (no-eol) (esc) |
|
214 | \r (no-eol) (esc) | |
219 | \r (no-eol) (esc) |
|
215 | \r (no-eol) (esc) | |
220 | converting [===================================> ] 6/7\r (no-eol) (esc) |
|
216 | converting [===================================> ] 6/7\r (no-eol) (esc) | |
221 | scanning paths [ ] 0/3\r (no-eol) (esc) |
|
217 | scanning paths [ ] 0/3\r (no-eol) (esc) | |
222 | scanning paths [===========> ] 1/3\r (no-eol) (esc) |
|
218 | scanning paths [===========> ] 1/3\r (no-eol) (esc) | |
223 | scanning paths [========================> ] 2/3\r (no-eol) (esc) |
|
219 | scanning paths [========================> ] 2/3\r (no-eol) (esc) | |
224 | getting files [===> ] 1/8\r (no-eol) (esc) |
|
220 | getting files [===> ] 1/8\r (no-eol) (esc) | |
225 | getting files [========> ] 2/8\r (no-eol) (esc) |
|
221 | getting files [========> ] 2/8\r (no-eol) (esc) | |
226 | getting files [=============> ] 3/8\r (no-eol) (esc) |
|
222 | getting files [=============> ] 3/8\r (no-eol) (esc) | |
227 | getting files [==================> ] 4/8\r (no-eol) (esc) |
|
223 | getting files [==================> ] 4/8\r (no-eol) (esc) | |
228 | getting files [=======================> ] 5/8\r (no-eol) (esc) |
|
224 | getting files [=======================> ] 5/8\r (no-eol) (esc) | |
229 | getting files [============================> ] 6/8\r (no-eol) (esc) |
|
225 | getting files [============================> ] 6/8\r (no-eol) (esc) | |
230 | getting files [=================================> ] 7/8\r (no-eol) (esc) |
|
226 | getting files [=================================> ] 7/8\r (no-eol) (esc) | |
231 | getting files [======================================>] 8/8\r (no-eol) (esc) |
|
227 | getting files [======================================>] 8/8\r (no-eol) (esc) | |
232 | \r (no-eol) (esc) |
|
228 | \r (no-eol) (esc) | |
233 | initializing destination hg-progress repository |
|
229 | initializing destination hg-progress repository | |
234 | scanning source... |
|
230 | scanning source... | |
235 | sorting... |
|
231 | sorting... | |
236 | converting... |
|
232 | converting... | |
237 | 6 initial |
|
233 | 6 initial | |
238 | 5 clobber symlink |
|
234 | 5 clobber symlink | |
239 | 4 clobber1 |
|
235 | 4 clobber1 | |
240 | 3 clobber2 |
|
236 | 3 clobber2 | |
241 | 2 adddb |
|
237 | 2 adddb | |
242 | 1 clobberdir |
|
238 | 1 clobberdir | |
243 | 0 branch |
|
239 | 0 branch | |
244 |
|
240 | |||
245 | $ cd .. |
|
241 | $ cd .. |
@@ -1,324 +1,320 | |||||
1 | #require svn svn-bindings |
|
1 | #require svn svn-bindings | |
2 |
|
2 | |||
3 | $ filter_svn_output () { |
|
3 | $ filter_svn_output () { | |
4 | > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true |
|
4 | > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true | |
5 | > } |
|
5 | > } | |
6 |
|
6 | |||
7 | $ cat >> $HGRCPATH <<EOF |
|
7 | $ cat >> $HGRCPATH <<EOF | |
8 | > [extensions] |
|
8 | > [extensions] | |
9 | > convert = |
|
9 | > convert = | |
10 | > [convert] |
|
10 | > [convert] | |
11 | > svn.trunk = mytrunk |
|
11 | > svn.trunk = mytrunk | |
12 | > EOF |
|
12 | > EOF | |
13 |
|
13 | |||
14 | $ svnadmin create svn-repo |
|
14 | $ svnadmin create svn-repo | |
15 | $ SVNREPOPATH=`pwd`/svn-repo |
|
15 | $ SVNREPOPATH=`pwd`/svn-repo | |
16 | #if windows |
|
16 | $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" | |
17 | $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
18 | #else |
|
|||
19 | $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
20 | #endif |
|
|||
21 |
$ |
|
17 | $ INVALIDREVISIONID=svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 | |
22 | $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1 |
|
18 | $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1 | |
23 |
|
19 | |||
24 | Now test that it works with trunk/tags layout, but no branches yet. |
|
20 | Now test that it works with trunk/tags layout, but no branches yet. | |
25 |
|
21 | |||
26 | Initial svn import |
|
22 | Initial svn import | |
27 |
|
23 | |||
28 | $ mkdir projB |
|
24 | $ mkdir projB | |
29 | $ cd projB |
|
25 | $ cd projB | |
30 | $ mkdir mytrunk |
|
26 | $ mkdir mytrunk | |
31 | $ mkdir tags |
|
27 | $ mkdir tags | |
32 | $ cd .. |
|
28 | $ cd .. | |
33 |
|
29 | |||
34 | $ svn import -m "init projB" projB "$SVNREPOURL/proj%20B" | filter_svn_output | sort |
|
30 | $ svn import -m "init projB" projB "$SVNREPOURL/proj%20B" | filter_svn_output | sort | |
35 | Adding projB/mytrunk |
|
31 | Adding projB/mytrunk | |
36 | Adding projB/tags |
|
32 | Adding projB/tags | |
37 | Committed revision 1. |
|
33 | Committed revision 1. | |
38 |
|
34 | |||
39 | Update svn repository |
|
35 | Update svn repository | |
40 |
|
36 | |||
41 | $ svn co "$SVNREPOURL/proj%20B/mytrunk" B | filter_svn_output |
|
37 | $ svn co "$SVNREPOURL/proj%20B/mytrunk" B | filter_svn_output | |
42 | Checked out revision 1. |
|
38 | Checked out revision 1. | |
43 | $ cd B |
|
39 | $ cd B | |
44 | $ echo hello > 'letter .txt' |
|
40 | $ echo hello > 'letter .txt' | |
45 | $ svn add 'letter .txt' | filter_svn_output |
|
41 | $ svn add 'letter .txt' | filter_svn_output | |
46 | A letter .txt |
|
42 | A letter .txt | |
47 | $ svn ci -m hello | filter_svn_output |
|
43 | $ svn ci -m hello | filter_svn_output | |
48 | Adding letter .txt |
|
44 | Adding letter .txt | |
49 | Transmitting file data . |
|
45 | Transmitting file data . | |
50 | Committed revision 2. |
|
46 | Committed revision 2. | |
51 |
|
47 | |||
52 | $ svn-safe-append.py world 'letter .txt' |
|
48 | $ svn-safe-append.py world 'letter .txt' | |
53 | $ svn ci -m world | filter_svn_output |
|
49 | $ svn ci -m world | filter_svn_output | |
54 | Sending letter .txt |
|
50 | Sending letter .txt | |
55 | Transmitting file data . |
|
51 | Transmitting file data . | |
56 | Committed revision 3. |
|
52 | Committed revision 3. | |
57 |
|
53 | |||
58 | $ svn copy -m "tag v0.1" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.1" | filter_svn_output |
|
54 | $ svn copy -m "tag v0.1" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.1" | filter_svn_output | |
59 | Committed revision 4. |
|
55 | Committed revision 4. | |
60 |
|
56 | |||
61 | $ svn-safe-append.py 'nice day today!' 'letter .txt' |
|
57 | $ svn-safe-append.py 'nice day today!' 'letter .txt' | |
62 | $ svn ci -m "nice day" | filter_svn_output |
|
58 | $ svn ci -m "nice day" | filter_svn_output | |
63 | Sending letter .txt |
|
59 | Sending letter .txt | |
64 | Transmitting file data . |
|
60 | Transmitting file data . | |
65 | Committed revision 5. |
|
61 | Committed revision 5. | |
66 | $ cd .. |
|
62 | $ cd .. | |
67 |
|
63 | |||
68 | Convert to hg once and also test localtimezone option |
|
64 | Convert to hg once and also test localtimezone option | |
69 |
|
65 | |||
70 | NOTE: This doesn't check all time zones -- it merely determines that |
|
66 | NOTE: This doesn't check all time zones -- it merely determines that | |
71 | the configuration option is taking effect. |
|
67 | the configuration option is taking effect. | |
72 |
|
68 | |||
73 | An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected |
|
69 | An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected | |
74 | since it does not use DST (unlike other U.S. time zones) and is always |
|
70 | since it does not use DST (unlike other U.S. time zones) and is always | |
75 | a fixed difference from UTC. |
|
71 | a fixed difference from UTC. | |
76 |
|
72 | |||
77 | $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg |
|
73 | $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg | |
78 | initializing destination B-hg repository |
|
74 | initializing destination B-hg repository | |
79 | scanning source... |
|
75 | scanning source... | |
80 | sorting... |
|
76 | sorting... | |
81 | converting... |
|
77 | converting... | |
82 | 3 init projB |
|
78 | 3 init projB | |
83 | 2 hello |
|
79 | 2 hello | |
84 | 1 world |
|
80 | 1 world | |
85 | 0 nice day |
|
81 | 0 nice day | |
86 | updating tags |
|
82 | updating tags | |
87 |
|
83 | |||
88 | Update svn repository again |
|
84 | Update svn repository again | |
89 |
|
85 | |||
90 | $ cd B |
|
86 | $ cd B | |
91 | $ svn-safe-append.py "see second letter" 'letter .txt' |
|
87 | $ svn-safe-append.py "see second letter" 'letter .txt' | |
92 | $ echo "nice to meet you" > letter2.txt |
|
88 | $ echo "nice to meet you" > letter2.txt | |
93 | $ svn add letter2.txt | filter_svn_output |
|
89 | $ svn add letter2.txt | filter_svn_output | |
94 | A letter2.txt |
|
90 | A letter2.txt | |
95 | $ svn ci -m "second letter" | filter_svn_output |
|
91 | $ svn ci -m "second letter" | filter_svn_output | |
96 | Sending letter .txt |
|
92 | Sending letter .txt | |
97 | Adding letter2.txt |
|
93 | Adding letter2.txt | |
98 | Transmitting file data .. |
|
94 | Transmitting file data .. | |
99 | Committed revision 6. |
|
95 | Committed revision 6. | |
100 |
|
96 | |||
101 | $ svn copy -m "tag v0.2" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.2" | filter_svn_output |
|
97 | $ svn copy -m "tag v0.2" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.2" | filter_svn_output | |
102 | Committed revision 7. |
|
98 | Committed revision 7. | |
103 |
|
99 | |||
104 | $ svn-safe-append.py "blah-blah-blah" letter2.txt |
|
100 | $ svn-safe-append.py "blah-blah-blah" letter2.txt | |
105 | $ svn ci -m "work in progress" | filter_svn_output |
|
101 | $ svn ci -m "work in progress" | filter_svn_output | |
106 | Sending letter2.txt |
|
102 | Sending letter2.txt | |
107 | Transmitting file data . |
|
103 | Transmitting file data . | |
108 | Committed revision 8. |
|
104 | Committed revision 8. | |
109 | $ cd .. |
|
105 | $ cd .. | |
110 |
|
106 | |||
111 | $ hg convert -s svn "$SVNREPOURL/proj%20B/non-existent-path" dest |
|
107 | $ hg convert -s svn "$SVNREPOURL/proj%20B/non-existent-path" dest | |
112 | initializing destination dest repository |
|
108 | initializing destination dest repository | |
113 | abort: no revision found in module /proj B/non-existent-path |
|
109 | abort: no revision found in module /proj B/non-existent-path | |
114 | [255] |
|
110 | [255] | |
115 |
|
111 | |||
116 | ######################################## |
|
112 | ######################################## | |
117 |
|
113 | |||
118 | Test incremental conversion |
|
114 | Test incremental conversion | |
119 |
|
115 | |||
120 | $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg |
|
116 | $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg | |
121 | scanning source... |
|
117 | scanning source... | |
122 | sorting... |
|
118 | sorting... | |
123 | converting... |
|
119 | converting... | |
124 | 1 second letter |
|
120 | 1 second letter | |
125 | 0 work in progress |
|
121 | 0 work in progress | |
126 | updating tags |
|
122 | updating tags | |
127 |
|
123 | |||
128 | $ cd B-hg |
|
124 | $ cd B-hg | |
129 | $ hg log -G --template '{rev} {desc|firstline} date: {date|date} files: {files}\n' |
|
125 | $ hg log -G --template '{rev} {desc|firstline} date: {date|date} files: {files}\n' | |
130 | o 7 update tags date: * +0000 files: .hgtags (glob) |
|
126 | o 7 update tags date: * +0000 files: .hgtags (glob) | |
131 | | |
|
127 | | | |
132 | o 6 work in progress date: * -1000 files: letter2.txt (glob) |
|
128 | o 6 work in progress date: * -1000 files: letter2.txt (glob) | |
133 | | |
|
129 | | | |
134 | o 5 second letter date: * -1000 files: letter .txt letter2.txt (glob) |
|
130 | o 5 second letter date: * -1000 files: letter .txt letter2.txt (glob) | |
135 | | |
|
131 | | | |
136 | o 4 update tags date: * +0000 files: .hgtags (glob) |
|
132 | o 4 update tags date: * +0000 files: .hgtags (glob) | |
137 | | |
|
133 | | | |
138 | o 3 nice day date: * -1000 files: letter .txt (glob) |
|
134 | o 3 nice day date: * -1000 files: letter .txt (glob) | |
139 | | |
|
135 | | | |
140 | o 2 world date: * -1000 files: letter .txt (glob) |
|
136 | o 2 world date: * -1000 files: letter .txt (glob) | |
141 | | |
|
137 | | | |
142 | o 1 hello date: * -1000 files: letter .txt (glob) |
|
138 | o 1 hello date: * -1000 files: letter .txt (glob) | |
143 | | |
|
139 | | | |
144 | o 0 init projB date: * -1000 files: (glob) |
|
140 | o 0 init projB date: * -1000 files: (glob) | |
145 |
|
141 | |||
146 | $ hg tags -q |
|
142 | $ hg tags -q | |
147 | tip |
|
143 | tip | |
148 | v0.2 |
|
144 | v0.2 | |
149 | v0.1 |
|
145 | v0.1 | |
150 | $ cd .. |
|
146 | $ cd .. | |
151 |
|
147 | |||
152 | Test filemap |
|
148 | Test filemap | |
153 | $ echo 'include letter2.txt' > filemap |
|
149 | $ echo 'include letter2.txt' > filemap | |
154 | $ hg convert --filemap filemap "$SVNREPOURL/proj%20B/mytrunk" fmap |
|
150 | $ hg convert --filemap filemap "$SVNREPOURL/proj%20B/mytrunk" fmap | |
155 | initializing destination fmap repository |
|
151 | initializing destination fmap repository | |
156 | scanning source... |
|
152 | scanning source... | |
157 | sorting... |
|
153 | sorting... | |
158 | converting... |
|
154 | converting... | |
159 | 5 init projB |
|
155 | 5 init projB | |
160 | 4 hello |
|
156 | 4 hello | |
161 | 3 world |
|
157 | 3 world | |
162 | 2 nice day |
|
158 | 2 nice day | |
163 | 1 second letter |
|
159 | 1 second letter | |
164 | 0 work in progress |
|
160 | 0 work in progress | |
165 | $ hg -R fmap branch -q |
|
161 | $ hg -R fmap branch -q | |
166 | default |
|
162 | default | |
167 | $ hg log -G -R fmap --template '{rev} {desc|firstline} files: {files}\n' |
|
163 | $ hg log -G -R fmap --template '{rev} {desc|firstline} files: {files}\n' | |
168 | o 1 work in progress files: letter2.txt |
|
164 | o 1 work in progress files: letter2.txt | |
169 | | |
|
165 | | | |
170 | o 0 second letter files: letter2.txt |
|
166 | o 0 second letter files: letter2.txt | |
171 |
|
167 | |||
172 | Convert with --full adds and removes files that didn't change |
|
168 | Convert with --full adds and removes files that didn't change | |
173 |
|
169 | |||
174 | $ cd B |
|
170 | $ cd B | |
175 | $ echo >> "letter .txt" |
|
171 | $ echo >> "letter .txt" | |
176 | $ svn ci -m 'nothing' | filter_svn_output |
|
172 | $ svn ci -m 'nothing' | filter_svn_output | |
177 | Sending letter .txt |
|
173 | Sending letter .txt | |
178 | Transmitting file data . |
|
174 | Transmitting file data . | |
179 | Committed revision 9. |
|
175 | Committed revision 9. | |
180 | $ cd .. |
|
176 | $ cd .. | |
181 |
|
177 | |||
182 | $ echo 'rename letter2.txt letter3.txt' > filemap |
|
178 | $ echo 'rename letter2.txt letter3.txt' > filemap | |
183 | $ hg convert --filemap filemap --full "$SVNREPOURL/proj%20B/mytrunk" fmap |
|
179 | $ hg convert --filemap filemap --full "$SVNREPOURL/proj%20B/mytrunk" fmap | |
184 | scanning source... |
|
180 | scanning source... | |
185 | sorting... |
|
181 | sorting... | |
186 | converting... |
|
182 | converting... | |
187 | 0 nothing |
|
183 | 0 nothing | |
188 | $ hg -R fmap st --change tip |
|
184 | $ hg -R fmap st --change tip | |
189 | A letter .txt |
|
185 | A letter .txt | |
190 | A letter3.txt |
|
186 | A letter3.txt | |
191 | R letter2.txt |
|
187 | R letter2.txt | |
192 |
|
188 | |||
193 | test invalid splicemap1 |
|
189 | test invalid splicemap1 | |
194 |
|
190 | |||
195 | $ cat > splicemap <<EOF |
|
191 | $ cat > splicemap <<EOF | |
196 | > $INVALIDREVISIONID $VALIDREVISIONID |
|
192 | > $INVALIDREVISIONID $VALIDREVISIONID | |
197 | > EOF |
|
193 | > EOF | |
198 | $ hg convert --splicemap splicemap "$SVNREPOURL/proj%20B/mytrunk" smap |
|
194 | $ hg convert --splicemap splicemap "$SVNREPOURL/proj%20B/mytrunk" smap | |
199 | initializing destination smap repository |
|
195 | initializing destination smap repository | |
200 | abort: splicemap entry svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 is not a valid revision identifier |
|
196 | abort: splicemap entry svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 is not a valid revision identifier | |
201 | [255] |
|
197 | [255] | |
202 |
|
198 | |||
203 | Test stop revision |
|
199 | Test stop revision | |
204 | $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev |
|
200 | $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev | |
205 | initializing destination stoprev repository |
|
201 | initializing destination stoprev repository | |
206 | scanning source... |
|
202 | scanning source... | |
207 | sorting... |
|
203 | sorting... | |
208 | converting... |
|
204 | converting... | |
209 | 0 init projB |
|
205 | 0 init projB | |
210 | $ hg -R stoprev branch -q |
|
206 | $ hg -R stoprev branch -q | |
211 | default |
|
207 | default | |
212 |
|
208 | |||
213 | Check convert_revision extra-records. |
|
209 | Check convert_revision extra-records. | |
214 | This is also the only place testing more than one extra field in a revision. |
|
210 | This is also the only place testing more than one extra field in a revision. | |
215 |
|
211 | |||
216 | $ cd stoprev |
|
212 | $ cd stoprev | |
217 | $ hg tip --debug | grep extra |
|
213 | $ hg tip --debug | grep extra | |
218 | extra: branch=default |
|
214 | extra: branch=default | |
219 | extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) |
|
215 | extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) | |
220 | $ cd .. |
|
216 | $ cd .. | |
221 |
|
217 | |||
222 | Test converting empty heads (issue3347). |
|
218 | Test converting empty heads (issue3347). | |
223 | Also tests getting logs directly without debugsvnlog. |
|
219 | Also tests getting logs directly without debugsvnlog. | |
224 |
|
220 | |||
225 | $ svnadmin create svn-empty |
|
221 | $ svnadmin create svn-empty | |
226 | $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" |
|
222 | $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" | |
227 | $ hg --config convert.svn.trunk= --config convert.svn.debugsvnlog=0 convert svn-empty |
|
223 | $ hg --config convert.svn.trunk= --config convert.svn.debugsvnlog=0 convert svn-empty | |
228 | assuming destination svn-empty-hg |
|
224 | assuming destination svn-empty-hg | |
229 | initializing destination svn-empty-hg repository |
|
225 | initializing destination svn-empty-hg repository | |
230 | scanning source... |
|
226 | scanning source... | |
231 | sorting... |
|
227 | sorting... | |
232 | converting... |
|
228 | converting... | |
233 | 1 init projA |
|
229 | 1 init projA | |
234 | 0 adddir |
|
230 | 0 adddir | |
235 | $ hg --config convert.svn.trunk= convert "$SVNREPOURL/../svn-empty/trunk" |
|
231 | $ hg --config convert.svn.trunk= convert "$SVNREPOURL/../svn-empty/trunk" | |
236 | assuming destination trunk-hg |
|
232 | assuming destination trunk-hg | |
237 | initializing destination trunk-hg repository |
|
233 | initializing destination trunk-hg repository | |
238 | scanning source... |
|
234 | scanning source... | |
239 | sorting... |
|
235 | sorting... | |
240 | converting... |
|
236 | converting... | |
241 | 1 init projA |
|
237 | 1 init projA | |
242 | 0 adddir |
|
238 | 0 adddir | |
243 |
|
239 | |||
244 | Test that a too-new repository format is properly rejected: |
|
240 | Test that a too-new repository format is properly rejected: | |
245 | $ mv svn-empty/format format |
|
241 | $ mv svn-empty/format format | |
246 | $ echo 999 > svn-empty/format |
|
242 | $ echo 999 > svn-empty/format | |
247 | It's important that this command explicitly specify svn, otherwise it |
|
243 | It's important that this command explicitly specify svn, otherwise it | |
248 | can have surprising side effects (like falling back to a perforce |
|
244 | can have surprising side effects (like falling back to a perforce | |
249 | depot that can be seen from the test environment and slurping from that.) |
|
245 | depot that can be seen from the test environment and slurping from that.) | |
250 | $ hg convert --source-type svn svn-empty this-will-fail |
|
246 | $ hg convert --source-type svn svn-empty this-will-fail | |
251 | initializing destination this-will-fail repository |
|
247 | initializing destination this-will-fail repository | |
252 | file:/*/$TESTTMP/svn-empty does not look like a Subversion repository to libsvn version 1.*.* (glob) |
|
248 | file:/*/$TESTTMP/svn-empty does not look like a Subversion repository to libsvn version 1.*.* (glob) | |
253 | abort: svn-empty: missing or unsupported repository |
|
249 | abort: svn-empty: missing or unsupported repository | |
254 | [255] |
|
250 | [255] | |
255 | $ mv format svn-empty/format |
|
251 | $ mv format svn-empty/format | |
256 |
|
252 | |||
257 | enable svn subrepos |
|
253 | enable svn subrepos | |
258 |
|
254 | |||
259 | $ cat >> $HGRCPATH <<EOF |
|
255 | $ cat >> $HGRCPATH <<EOF | |
260 | > [subrepos] |
|
256 | > [subrepos] | |
261 | > svn:allowed = true |
|
257 | > svn:allowed = true | |
262 | > EOF |
|
258 | > EOF | |
263 |
|
259 | |||
264 | try converting when we have an svn subrepo and a merge in hg superrepo (issue5657) |
|
260 | try converting when we have an svn subrepo and a merge in hg superrepo (issue5657) | |
265 |
|
261 | |||
266 | $ cd "$TESTTMP" |
|
262 | $ cd "$TESTTMP" | |
267 | $ hg init withmerge |
|
263 | $ hg init withmerge | |
268 | $ cd withmerge |
|
264 | $ cd withmerge | |
269 | $ echo "subrepo = [svn]$SVNREPOURL" >.hgsub |
|
265 | $ echo "subrepo = [svn]$SVNREPOURL" >.hgsub | |
270 | $ hg add .hgsub |
|
266 | $ hg add .hgsub | |
271 | $ svn checkout "$SVNREPOURL" subrepo | sort |
|
267 | $ svn checkout "$SVNREPOURL" subrepo | sort | |
272 | A subrepo/proj B |
|
268 | A subrepo/proj B | |
273 | A subrepo/proj B/mytrunk |
|
269 | A subrepo/proj B/mytrunk | |
274 | A subrepo/proj B/mytrunk/letter .txt |
|
270 | A subrepo/proj B/mytrunk/letter .txt | |
275 | A subrepo/proj B/mytrunk/letter2.txt |
|
271 | A subrepo/proj B/mytrunk/letter2.txt | |
276 | A subrepo/proj B/tags |
|
272 | A subrepo/proj B/tags | |
277 | A subrepo/proj B/tags/v0.1 |
|
273 | A subrepo/proj B/tags/v0.1 | |
278 | A subrepo/proj B/tags/v0.1/letter .txt |
|
274 | A subrepo/proj B/tags/v0.1/letter .txt | |
279 | A subrepo/proj B/tags/v0.2 |
|
275 | A subrepo/proj B/tags/v0.2 | |
280 | A subrepo/proj B/tags/v0.2/letter .txt |
|
276 | A subrepo/proj B/tags/v0.2/letter .txt | |
281 | A subrepo/proj B/tags/v0.2/letter2.txt |
|
277 | A subrepo/proj B/tags/v0.2/letter2.txt | |
282 | Checked out revision 9. |
|
278 | Checked out revision 9. | |
283 | $ hg ci -m "Adding svn subrepo" |
|
279 | $ hg ci -m "Adding svn subrepo" | |
284 | $ touch file1.txt |
|
280 | $ touch file1.txt | |
285 | $ hg add file1.txt |
|
281 | $ hg add file1.txt | |
286 | $ hg ci -m "Adding file1" |
|
282 | $ hg ci -m "Adding file1" | |
287 | $ hg up 0 |
|
283 | $ hg up 0 | |
288 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
284 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
289 | $ touch file2.txt |
|
285 | $ touch file2.txt | |
290 | $ hg add file2.txt |
|
286 | $ hg add file2.txt | |
291 | $ hg ci -m "Adding file2" |
|
287 | $ hg ci -m "Adding file2" | |
292 | created new head |
|
288 | created new head | |
293 | $ hg merge 1 |
|
289 | $ hg merge 1 | |
294 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
290 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
295 | (branch merge, don't forget to commit) |
|
291 | (branch merge, don't forget to commit) | |
296 | $ hg ci -m "merged" |
|
292 | $ hg ci -m "merged" | |
297 | $ cd .. |
|
293 | $ cd .. | |
298 | $ hg --config extensions.convert= convert withmerge withmerge-converted |
|
294 | $ hg --config extensions.convert= convert withmerge withmerge-converted | |
299 | initializing destination withmerge-converted repository |
|
295 | initializing destination withmerge-converted repository | |
300 | scanning source... |
|
296 | scanning source... | |
301 | sorting... |
|
297 | sorting... | |
302 | converting... |
|
298 | converting... | |
303 | 3 Adding svn subrepo |
|
299 | 3 Adding svn subrepo | |
304 | 2 Adding file1 |
|
300 | 2 Adding file1 | |
305 | 1 Adding file2 |
|
301 | 1 Adding file2 | |
306 | 0 merged |
|
302 | 0 merged | |
307 | $ cd withmerge-converted |
|
303 | $ cd withmerge-converted | |
308 | $ hg up | sort |
|
304 | $ hg up | sort | |
309 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
305 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
310 | A subrepo/proj B |
|
306 | A subrepo/proj B | |
311 | A subrepo/proj B/mytrunk |
|
307 | A subrepo/proj B/mytrunk | |
312 | A subrepo/proj B/mytrunk/letter .txt |
|
308 | A subrepo/proj B/mytrunk/letter .txt | |
313 | A subrepo/proj B/mytrunk/letter2.txt |
|
309 | A subrepo/proj B/mytrunk/letter2.txt | |
314 | A subrepo/proj B/tags |
|
310 | A subrepo/proj B/tags | |
315 | A subrepo/proj B/tags/v0.1 |
|
311 | A subrepo/proj B/tags/v0.1 | |
316 | A subrepo/proj B/tags/v0.1/letter .txt |
|
312 | A subrepo/proj B/tags/v0.1/letter .txt | |
317 | A subrepo/proj B/tags/v0.2 |
|
313 | A subrepo/proj B/tags/v0.2 | |
318 | A subrepo/proj B/tags/v0.2/letter .txt |
|
314 | A subrepo/proj B/tags/v0.2/letter .txt | |
319 | A subrepo/proj B/tags/v0.2/letter2.txt |
|
315 | A subrepo/proj B/tags/v0.2/letter2.txt | |
320 | Checked out revision 9. |
|
316 | Checked out revision 9. | |
321 | $ ls |
|
317 | $ ls | |
322 | file1.txt |
|
318 | file1.txt | |
323 | file2.txt |
|
319 | file2.txt | |
324 | subrepo |
|
320 | subrepo |
@@ -1,63 +1,52 | |||||
1 | #require svn13 |
|
1 | #require svn13 | |
2 |
|
2 | |||
3 | $ cat <<EOF >> $HGRCPATH |
|
3 | $ cat <<EOF >> $HGRCPATH | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > mq = |
|
5 | > mq = | |
6 | > [diff] |
|
6 | > [diff] | |
7 | > nodates = 1 |
|
7 | > nodates = 1 | |
8 | > [subrepos] |
|
8 | > [subrepos] | |
9 | > allowed = true |
|
9 | > allowed = true | |
10 | > svn:allowed = true |
|
10 | > svn:allowed = true | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | fn to create new repository, and cd into it |
|
13 | fn to create new repository, and cd into it | |
14 | $ mkrepo() { |
|
14 | $ mkrepo() { | |
15 | > hg init $1 |
|
15 | > hg init $1 | |
16 | > cd $1 |
|
16 | > cd $1 | |
17 | > hg qinit |
|
17 | > hg qinit | |
18 | > } |
|
18 | > } | |
19 |
|
19 | |||
20 |
|
20 | |||
21 | handle svn subrepos safely |
|
21 | handle svn subrepos safely | |
22 |
|
22 | |||
23 | $ svnadmin create svn-repo-2499 |
|
23 | $ svnadmin create svn-repo-2499 | |
24 |
|
24 | |||
25 | $ SVNREPOPATH=`pwd`/svn-repo-2499/project |
|
25 | $ SVNREPOPATH=`pwd`/svn-repo-2499/project | |
26 |
|
26 | $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" | ||
27 | #if py3 |
|
|||
28 | $ pathquoted=`"$PYTHON" -c "import sys, urllib.parse; sys.stdout.write(urllib.parse.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
29 | #else |
|
|||
30 | $ pathquoted=`"$PYTHON" -c "import sys, urllib; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
31 | #endif |
|
|||
32 |
|
||||
33 | #if windows |
|
|||
34 | $ SVNREPOURL=file:///$pathquoted |
|
|||
35 | #else |
|
|||
36 | $ SVNREPOURL=file://$pathquoted |
|
|||
37 | #endif |
|
|||
38 |
|
|
27 | ||
39 |
$ |
|
28 | $ mkdir -p svn-project-2499/trunk | |
40 | $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" |
|
29 | $ svn import -qm 'init project' svn-project-2499 "$SVNREPOURL" | |
41 |
|
30 | |||
42 | qnew on repo w/svn subrepo |
|
31 | qnew on repo w/svn subrepo | |
43 | $ mkrepo repo-2499-svn-subrepo |
|
32 | $ mkrepo repo-2499-svn-subrepo | |
44 | $ svn co "$SVNREPOURL"/trunk sub |
|
33 | $ svn co "$SVNREPOURL"/trunk sub | |
45 | Checked out revision 1. |
|
34 | Checked out revision 1. | |
46 | $ echo 'sub = [svn]sub' >> .hgsub |
|
35 | $ echo 'sub = [svn]sub' >> .hgsub | |
47 | $ hg add .hgsub |
|
36 | $ hg add .hgsub | |
48 | $ hg status -S -X '**/format' |
|
37 | $ hg status -S -X '**/format' | |
49 | A .hgsub |
|
38 | A .hgsub | |
50 | $ hg qnew -m0 0.diff |
|
39 | $ hg qnew -m0 0.diff | |
51 | $ cd sub |
|
40 | $ cd sub | |
52 | $ echo a > a |
|
41 | $ echo a > a | |
53 | $ svn add a |
|
42 | $ svn add a | |
54 | A a |
|
43 | A a | |
55 | $ svn st |
|
44 | $ svn st | |
56 | A* a (glob) |
|
45 | A* a (glob) | |
57 | $ cd .. |
|
46 | $ cd .. | |
58 | $ hg status -S # doesn't show status for svn subrepos (yet) |
|
47 | $ hg status -S # doesn't show status for svn subrepos (yet) | |
59 | $ hg qnew -m1 1.diff |
|
48 | $ hg qnew -m1 1.diff | |
60 | abort: uncommitted changes in subrepository "sub" |
|
49 | abort: uncommitted changes in subrepository "sub" | |
61 | [255] |
|
50 | [255] | |
62 |
|
51 | |||
63 | $ cd .. |
|
52 | $ cd .. |
@@ -1,690 +1,686 | |||||
1 | #require svn15 |
|
1 | #require svn15 | |
2 |
|
2 | |||
3 | $ SVNREPOPATH=`pwd`/svn-repo |
|
3 | $ SVNREPOPATH=`pwd`/svn-repo | |
4 | #if windows |
|
4 | $ SVNREPOURL="`$PYTHON $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" | |
5 | $ SVNREPOURL=file:///`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
6 | #else |
|
|||
7 | $ SVNREPOURL=file://`"$PYTHON" -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
|
|||
8 | #endif |
|
|||
9 |
|
|
5 | ||
10 | $ filter_svn_output () { |
|
6 | $ filter_svn_output () { | |
11 | > egrep -v 'Committing|Transmitting|Updating|(^$)' || true |
|
7 | > egrep -v 'Committing|Transmitting|Updating|(^$)' || true | |
12 | > } |
|
8 | > } | |
13 |
|
9 | |||
14 | create subversion repo |
|
10 | create subversion repo | |
15 |
|
11 | |||
16 | $ WCROOT="`pwd`/svn-wc" |
|
12 | $ WCROOT="`pwd`/svn-wc" | |
17 | $ svnadmin create svn-repo |
|
13 | $ svnadmin create svn-repo | |
18 | $ svn co "$SVNREPOURL" svn-wc |
|
14 | $ svn co "$SVNREPOURL" svn-wc | |
19 | Checked out revision 0. |
|
15 | Checked out revision 0. | |
20 | $ cd svn-wc |
|
16 | $ cd svn-wc | |
21 | $ mkdir src |
|
17 | $ mkdir src | |
22 | $ echo alpha > src/alpha |
|
18 | $ echo alpha > src/alpha | |
23 | $ svn add src |
|
19 | $ svn add src | |
24 | A src |
|
20 | A src | |
25 | A src/alpha |
|
21 | A src/alpha | |
26 | $ mkdir externals |
|
22 | $ mkdir externals | |
27 | $ echo other > externals/other |
|
23 | $ echo other > externals/other | |
28 | $ svn add externals |
|
24 | $ svn add externals | |
29 | A externals |
|
25 | A externals | |
30 | A externals/other |
|
26 | A externals/other | |
31 | $ svn ci -qm 'Add alpha' |
|
27 | $ svn ci -qm 'Add alpha' | |
32 | $ svn up -q |
|
28 | $ svn up -q | |
33 | $ echo "externals -r1 $SVNREPOURL/externals" > extdef |
|
29 | $ echo "externals -r1 $SVNREPOURL/externals" > extdef | |
34 | $ svn propset -F extdef svn:externals src |
|
30 | $ svn propset -F extdef svn:externals src | |
35 | property 'svn:externals' set on 'src' |
|
31 | property 'svn:externals' set on 'src' | |
36 | $ svn ci -qm 'Setting externals' |
|
32 | $ svn ci -qm 'Setting externals' | |
37 | $ cd .. |
|
33 | $ cd .. | |
38 |
|
34 | |||
39 | create hg repo |
|
35 | create hg repo | |
40 |
|
36 | |||
41 | $ mkdir sub |
|
37 | $ mkdir sub | |
42 | $ cd sub |
|
38 | $ cd sub | |
43 | $ hg init t |
|
39 | $ hg init t | |
44 | $ cd t |
|
40 | $ cd t | |
45 |
|
41 | |||
46 | first revision, no sub |
|
42 | first revision, no sub | |
47 |
|
43 | |||
48 | $ echo a > a |
|
44 | $ echo a > a | |
49 | $ hg ci -Am0 |
|
45 | $ hg ci -Am0 | |
50 | adding a |
|
46 | adding a | |
51 |
|
47 | |||
52 | add first svn sub with leading whitespaces |
|
48 | add first svn sub with leading whitespaces | |
53 |
|
49 | |||
54 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub |
|
50 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub | |
55 | $ echo "subdir/s = [svn] $SVNREPOURL/src" >> .hgsub |
|
51 | $ echo "subdir/s = [svn] $SVNREPOURL/src" >> .hgsub | |
56 | $ svn co --quiet "$SVNREPOURL"/src s |
|
52 | $ svn co --quiet "$SVNREPOURL"/src s | |
57 | $ mkdir subdir |
|
53 | $ mkdir subdir | |
58 | $ svn co --quiet "$SVNREPOURL"/src subdir/s |
|
54 | $ svn co --quiet "$SVNREPOURL"/src subdir/s | |
59 | $ hg add .hgsub |
|
55 | $ hg add .hgsub | |
60 |
|
56 | |||
61 | svn subrepo is disabled by default |
|
57 | svn subrepo is disabled by default | |
62 |
|
58 | |||
63 | $ hg ci -m1 |
|
59 | $ hg ci -m1 | |
64 | abort: svn subrepos not allowed |
|
60 | abort: svn subrepos not allowed | |
65 | (see 'hg help config.subrepos' for details) |
|
61 | (see 'hg help config.subrepos' for details) | |
66 | [255] |
|
62 | [255] | |
67 |
|
63 | |||
68 | so enable it |
|
64 | so enable it | |
69 |
|
65 | |||
70 | $ cat >> $HGRCPATH <<EOF |
|
66 | $ cat >> $HGRCPATH <<EOF | |
71 | > [subrepos] |
|
67 | > [subrepos] | |
72 | > svn:allowed = true |
|
68 | > svn:allowed = true | |
73 | > EOF |
|
69 | > EOF | |
74 |
|
70 | |||
75 | $ hg ci -m1 |
|
71 | $ hg ci -m1 | |
76 |
|
72 | |||
77 | make sure we avoid empty commits (issue2445) |
|
73 | make sure we avoid empty commits (issue2445) | |
78 |
|
74 | |||
79 | $ hg sum |
|
75 | $ hg sum | |
80 | parent: 1:* tip (glob) |
|
76 | parent: 1:* tip (glob) | |
81 | 1 |
|
77 | 1 | |
82 | branch: default |
|
78 | branch: default | |
83 | commit: (clean) |
|
79 | commit: (clean) | |
84 | update: (current) |
|
80 | update: (current) | |
85 | phases: 2 draft |
|
81 | phases: 2 draft | |
86 | $ hg ci -moops |
|
82 | $ hg ci -moops | |
87 | nothing changed |
|
83 | nothing changed | |
88 | [1] |
|
84 | [1] | |
89 |
|
85 | |||
90 | debugsub |
|
86 | debugsub | |
91 |
|
87 | |||
92 | $ hg debugsub |
|
88 | $ hg debugsub | |
93 | path s |
|
89 | path s | |
94 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
90 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
95 | revision 2 |
|
91 | revision 2 | |
96 | path subdir/s |
|
92 | path subdir/s | |
97 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
93 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
98 | revision 2 |
|
94 | revision 2 | |
99 |
|
95 | |||
100 | change file in svn and hg, commit |
|
96 | change file in svn and hg, commit | |
101 |
|
97 | |||
102 | $ echo a >> a |
|
98 | $ echo a >> a | |
103 | $ echo alpha >> s/alpha |
|
99 | $ echo alpha >> s/alpha | |
104 | $ hg sum |
|
100 | $ hg sum | |
105 | parent: 1:* tip (glob) |
|
101 | parent: 1:* tip (glob) | |
106 | 1 |
|
102 | 1 | |
107 | branch: default |
|
103 | branch: default | |
108 | commit: 1 modified, 1 subrepos |
|
104 | commit: 1 modified, 1 subrepos | |
109 | update: (current) |
|
105 | update: (current) | |
110 | phases: 2 draft |
|
106 | phases: 2 draft | |
111 | $ hg commit --subrepos -m 'Message!' | filter_svn_output |
|
107 | $ hg commit --subrepos -m 'Message!' | filter_svn_output | |
112 | committing subrepository s |
|
108 | committing subrepository s | |
113 | Sending*s/alpha (glob) |
|
109 | Sending*s/alpha (glob) | |
114 | Committed revision 3. |
|
110 | Committed revision 3. | |
115 | Fetching external item into '*s/externals'* (glob) |
|
111 | Fetching external item into '*s/externals'* (glob) | |
116 | External at revision 1. |
|
112 | External at revision 1. | |
117 | At revision 3. |
|
113 | At revision 3. | |
118 | $ hg debugsub |
|
114 | $ hg debugsub | |
119 | path s |
|
115 | path s | |
120 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
116 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
121 | revision 3 |
|
117 | revision 3 | |
122 | path subdir/s |
|
118 | path subdir/s | |
123 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
119 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
124 | revision 2 |
|
120 | revision 2 | |
125 |
|
121 | |||
126 | missing svn file, commit should fail |
|
122 | missing svn file, commit should fail | |
127 |
|
123 | |||
128 | $ rm s/alpha |
|
124 | $ rm s/alpha | |
129 | $ hg commit --subrepos -m 'abort on missing file' |
|
125 | $ hg commit --subrepos -m 'abort on missing file' | |
130 | committing subrepository s |
|
126 | committing subrepository s | |
131 | abort: cannot commit missing svn entries (in subrepository "s") |
|
127 | abort: cannot commit missing svn entries (in subrepository "s") | |
132 | [255] |
|
128 | [255] | |
133 | $ svn revert s/alpha > /dev/null |
|
129 | $ svn revert s/alpha > /dev/null | |
134 |
|
130 | |||
135 | add an unrelated revision in svn and update the subrepo to without |
|
131 | add an unrelated revision in svn and update the subrepo to without | |
136 | bringing any changes. |
|
132 | bringing any changes. | |
137 |
|
133 | |||
138 | $ svn mkdir "$SVNREPOURL/unrelated" -qm 'create unrelated' |
|
134 | $ svn mkdir "$SVNREPOURL/unrelated" -qm 'create unrelated' | |
139 | $ svn up -q s |
|
135 | $ svn up -q s | |
140 | $ hg sum |
|
136 | $ hg sum | |
141 | parent: 2:* tip (glob) |
|
137 | parent: 2:* tip (glob) | |
142 | Message! |
|
138 | Message! | |
143 | branch: default |
|
139 | branch: default | |
144 | commit: (clean) |
|
140 | commit: (clean) | |
145 | update: (current) |
|
141 | update: (current) | |
146 | phases: 3 draft |
|
142 | phases: 3 draft | |
147 |
|
143 | |||
148 | $ echo a > s/a |
|
144 | $ echo a > s/a | |
149 |
|
145 | |||
150 | should be empty despite change to s/a |
|
146 | should be empty despite change to s/a | |
151 |
|
147 | |||
152 | $ hg st |
|
148 | $ hg st | |
153 |
|
149 | |||
154 | add a commit from svn |
|
150 | add a commit from svn | |
155 |
|
151 | |||
156 | $ cd "$WCROOT/src" |
|
152 | $ cd "$WCROOT/src" | |
157 | $ svn up -q |
|
153 | $ svn up -q | |
158 | $ echo xyz >> alpha |
|
154 | $ echo xyz >> alpha | |
159 | $ svn propset svn:mime-type 'text/xml' alpha |
|
155 | $ svn propset svn:mime-type 'text/xml' alpha | |
160 | property 'svn:mime-type' set on 'alpha' |
|
156 | property 'svn:mime-type' set on 'alpha' | |
161 | $ svn ci -qm 'amend a from svn' |
|
157 | $ svn ci -qm 'amend a from svn' | |
162 | $ cd ../../sub/t |
|
158 | $ cd ../../sub/t | |
163 |
|
159 | |||
164 | this commit from hg will fail |
|
160 | this commit from hg will fail | |
165 |
|
161 | |||
166 | $ echo zzz >> s/alpha |
|
162 | $ echo zzz >> s/alpha | |
167 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' |
|
163 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' | |
168 | committing subrepository s |
|
164 | committing subrepository s | |
169 | abort: svn:*Commit failed (details follow): (glob) |
|
165 | abort: svn:*Commit failed (details follow): (glob) | |
170 | [255] |
|
166 | [255] | |
171 | $ svn revert -q s/alpha |
|
167 | $ svn revert -q s/alpha | |
172 |
|
168 | |||
173 | this commit fails because of meta changes |
|
169 | this commit fails because of meta changes | |
174 |
|
170 | |||
175 | $ svn propset svn:mime-type 'text/html' s/alpha |
|
171 | $ svn propset svn:mime-type 'text/html' s/alpha | |
176 | property 'svn:mime-type' set on 's/alpha' |
|
172 | property 'svn:mime-type' set on 's/alpha' | |
177 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' |
|
173 | $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' | |
178 | committing subrepository s |
|
174 | committing subrepository s | |
179 | abort: svn:*Commit failed (details follow): (glob) |
|
175 | abort: svn:*Commit failed (details follow): (glob) | |
180 | [255] |
|
176 | [255] | |
181 | $ svn revert -q s/alpha |
|
177 | $ svn revert -q s/alpha | |
182 |
|
178 | |||
183 | this commit fails because of externals changes |
|
179 | this commit fails because of externals changes | |
184 |
|
180 | |||
185 | $ echo zzz > s/externals/other |
|
181 | $ echo zzz > s/externals/other | |
186 | $ hg ci --subrepos -m 'amend externals from hg' |
|
182 | $ hg ci --subrepos -m 'amend externals from hg' | |
187 | committing subrepository s |
|
183 | committing subrepository s | |
188 | abort: cannot commit svn externals (in subrepository "s") |
|
184 | abort: cannot commit svn externals (in subrepository "s") | |
189 | [255] |
|
185 | [255] | |
190 | $ hg diff --subrepos -r 1:2 | grep -v diff |
|
186 | $ hg diff --subrepos -r 1:2 | grep -v diff | |
191 | --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 |
|
187 | --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 | |
192 | +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 |
|
188 | +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 | |
193 | @@ -1,2 +1,2 @@ |
|
189 | @@ -1,2 +1,2 @@ | |
194 | -2 s |
|
190 | -2 s | |
195 | +3 s |
|
191 | +3 s | |
196 | 2 subdir/s |
|
192 | 2 subdir/s | |
197 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
193 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
198 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
194 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
199 | @@ -1,1 +1,2 @@ |
|
195 | @@ -1,1 +1,2 @@ | |
200 | a |
|
196 | a | |
201 | +a |
|
197 | +a | |
202 | $ svn revert -q s/externals/other |
|
198 | $ svn revert -q s/externals/other | |
203 |
|
199 | |||
204 | this commit fails because of externals meta changes |
|
200 | this commit fails because of externals meta changes | |
205 |
|
201 | |||
206 | $ svn propset svn:mime-type 'text/html' s/externals/other |
|
202 | $ svn propset svn:mime-type 'text/html' s/externals/other | |
207 | property 'svn:mime-type' set on 's/externals/other' |
|
203 | property 'svn:mime-type' set on 's/externals/other' | |
208 | $ hg ci --subrepos -m 'amend externals from hg' |
|
204 | $ hg ci --subrepos -m 'amend externals from hg' | |
209 | committing subrepository s |
|
205 | committing subrepository s | |
210 | abort: cannot commit svn externals (in subrepository "s") |
|
206 | abort: cannot commit svn externals (in subrepository "s") | |
211 | [255] |
|
207 | [255] | |
212 | $ svn revert -q s/externals/other |
|
208 | $ svn revert -q s/externals/other | |
213 |
|
209 | |||
214 | clone |
|
210 | clone | |
215 |
|
211 | |||
216 | $ cd .. |
|
212 | $ cd .. | |
217 | $ hg clone t tc |
|
213 | $ hg clone t tc | |
218 | updating to branch default |
|
214 | updating to branch default | |
219 | A tc/s/alpha |
|
215 | A tc/s/alpha | |
220 | U tc/s |
|
216 | U tc/s | |
221 |
|
217 | |||
222 | Fetching external item into 'tc/s/externals'* (glob) |
|
218 | Fetching external item into 'tc/s/externals'* (glob) | |
223 | A tc/s/externals/other |
|
219 | A tc/s/externals/other | |
224 | Checked out external at revision 1. |
|
220 | Checked out external at revision 1. | |
225 |
|
221 | |||
226 | Checked out revision 3. |
|
222 | Checked out revision 3. | |
227 | A tc/subdir/s/alpha |
|
223 | A tc/subdir/s/alpha | |
228 | U tc/subdir/s |
|
224 | U tc/subdir/s | |
229 |
|
225 | |||
230 | Fetching external item into 'tc/subdir/s/externals'* (glob) |
|
226 | Fetching external item into 'tc/subdir/s/externals'* (glob) | |
231 | A tc/subdir/s/externals/other |
|
227 | A tc/subdir/s/externals/other | |
232 | Checked out external at revision 1. |
|
228 | Checked out external at revision 1. | |
233 |
|
229 | |||
234 | Checked out revision 2. |
|
230 | Checked out revision 2. | |
235 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
231 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
236 | $ cd tc |
|
232 | $ cd tc | |
237 |
|
233 | |||
238 | debugsub in clone |
|
234 | debugsub in clone | |
239 |
|
235 | |||
240 | $ hg debugsub |
|
236 | $ hg debugsub | |
241 | path s |
|
237 | path s | |
242 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
238 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
243 | revision 3 |
|
239 | revision 3 | |
244 | path subdir/s |
|
240 | path subdir/s | |
245 | source file:/*/$TESTTMP/svn-repo/src (glob) |
|
241 | source file:/*/$TESTTMP/svn-repo/src (glob) | |
246 | revision 2 |
|
242 | revision 2 | |
247 |
|
243 | |||
248 | verify subrepo is contained within the repo directory |
|
244 | verify subrepo is contained within the repo directory | |
249 |
|
245 | |||
250 | $ "$PYTHON" -c "from __future__ import print_function; import os.path; print(os.path.exists('s'))" |
|
246 | $ "$PYTHON" -c "from __future__ import print_function; import os.path; print(os.path.exists('s'))" | |
251 | True |
|
247 | True | |
252 |
|
248 | |||
253 | update to nullrev (must delete the subrepo) |
|
249 | update to nullrev (must delete the subrepo) | |
254 |
|
250 | |||
255 | $ hg up null |
|
251 | $ hg up null | |
256 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
252 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
257 | $ ls |
|
253 | $ ls | |
258 |
|
254 | |||
259 | Check hg update --clean |
|
255 | Check hg update --clean | |
260 | $ cd "$TESTTMP/sub/t" |
|
256 | $ cd "$TESTTMP/sub/t" | |
261 | $ cd s |
|
257 | $ cd s | |
262 | $ echo c0 > alpha |
|
258 | $ echo c0 > alpha | |
263 | $ echo c1 > f1 |
|
259 | $ echo c1 > f1 | |
264 | $ echo c1 > f2 |
|
260 | $ echo c1 > f2 | |
265 | $ svn add f1 -q |
|
261 | $ svn add f1 -q | |
266 | $ svn status | sort |
|
262 | $ svn status | sort | |
267 |
|
263 | |||
268 | ? * a (glob) |
|
264 | ? * a (glob) | |
269 | ? * f2 (glob) |
|
265 | ? * f2 (glob) | |
270 | A * f1 (glob) |
|
266 | A * f1 (glob) | |
271 | M * alpha (glob) |
|
267 | M * alpha (glob) | |
272 | Performing status on external item at 'externals'* (glob) |
|
268 | Performing status on external item at 'externals'* (glob) | |
273 | X * externals (glob) |
|
269 | X * externals (glob) | |
274 | $ cd ../.. |
|
270 | $ cd ../.. | |
275 | $ hg -R t update -C |
|
271 | $ hg -R t update -C | |
276 |
|
272 | |||
277 | Fetching external item into 't/s/externals'* (glob) |
|
273 | Fetching external item into 't/s/externals'* (glob) | |
278 | Checked out external at revision 1. |
|
274 | Checked out external at revision 1. | |
279 |
|
275 | |||
280 | Checked out revision 3. |
|
276 | Checked out revision 3. | |
281 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
277 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
282 | $ cd t/s |
|
278 | $ cd t/s | |
283 | $ svn status | sort |
|
279 | $ svn status | sort | |
284 |
|
280 | |||
285 | ? * a (glob) |
|
281 | ? * a (glob) | |
286 | ? * f1 (glob) |
|
282 | ? * f1 (glob) | |
287 | ? * f2 (glob) |
|
283 | ? * f2 (glob) | |
288 | Performing status on external item at 'externals'* (glob) |
|
284 | Performing status on external item at 'externals'* (glob) | |
289 | X * externals (glob) |
|
285 | X * externals (glob) | |
290 |
|
286 | |||
291 | Sticky subrepositories, no changes |
|
287 | Sticky subrepositories, no changes | |
292 | $ cd "$TESTTMP/sub/t" |
|
288 | $ cd "$TESTTMP/sub/t" | |
293 | $ hg id -n |
|
289 | $ hg id -n | |
294 | 2 |
|
290 | 2 | |
295 | $ cd s |
|
291 | $ cd s | |
296 | $ svnversion |
|
292 | $ svnversion | |
297 | 3 |
|
293 | 3 | |
298 | $ cd .. |
|
294 | $ cd .. | |
299 | $ hg update 1 |
|
295 | $ hg update 1 | |
300 | U *s/alpha (glob) |
|
296 | U *s/alpha (glob) | |
301 |
|
297 | |||
302 | Fetching external item into '*s/externals'* (glob) |
|
298 | Fetching external item into '*s/externals'* (glob) | |
303 | Checked out external at revision 1. |
|
299 | Checked out external at revision 1. | |
304 |
|
300 | |||
305 | Checked out revision 2. |
|
301 | Checked out revision 2. | |
306 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
302 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
307 | $ hg id -n |
|
303 | $ hg id -n | |
308 | 1 |
|
304 | 1 | |
309 | $ cd s |
|
305 | $ cd s | |
310 | $ svnversion |
|
306 | $ svnversion | |
311 | 2 |
|
307 | 2 | |
312 | $ cd .. |
|
308 | $ cd .. | |
313 |
|
309 | |||
314 | Sticky subrepositories, file changes |
|
310 | Sticky subrepositories, file changes | |
315 | $ touch s/f1 |
|
311 | $ touch s/f1 | |
316 | $ cd s |
|
312 | $ cd s | |
317 | $ svn add f1 |
|
313 | $ svn add f1 | |
318 | A f1 |
|
314 | A f1 | |
319 | $ cd .. |
|
315 | $ cd .. | |
320 | $ hg id -n |
|
316 | $ hg id -n | |
321 | 1+ |
|
317 | 1+ | |
322 | $ cd s |
|
318 | $ cd s | |
323 | $ svnversion |
|
319 | $ svnversion | |
324 | 2M |
|
320 | 2M | |
325 | $ cd .. |
|
321 | $ cd .. | |
326 | $ hg update tip |
|
322 | $ hg update tip | |
327 | subrepository s diverged (local revision: 2, remote revision: 3) |
|
323 | subrepository s diverged (local revision: 2, remote revision: 3) | |
328 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
324 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | |
329 | subrepository sources for s differ |
|
325 | subrepository sources for s differ | |
330 | use (l)ocal source (2) or (r)emote source (3)? l |
|
326 | use (l)ocal source (2) or (r)emote source (3)? l | |
331 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
327 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
332 | $ hg id -n |
|
328 | $ hg id -n | |
333 | 2+ |
|
329 | 2+ | |
334 | $ cd s |
|
330 | $ cd s | |
335 | $ svnversion |
|
331 | $ svnversion | |
336 | 2M |
|
332 | 2M | |
337 | $ cd .. |
|
333 | $ cd .. | |
338 | $ hg update --clean tip |
|
334 | $ hg update --clean tip | |
339 | U *s/alpha (glob) |
|
335 | U *s/alpha (glob) | |
340 |
|
336 | |||
341 | Fetching external item into '*s/externals'* (glob) |
|
337 | Fetching external item into '*s/externals'* (glob) | |
342 | Checked out external at revision 1. |
|
338 | Checked out external at revision 1. | |
343 |
|
339 | |||
344 | Checked out revision 3. |
|
340 | Checked out revision 3. | |
345 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
341 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
346 |
|
342 | |||
347 | Sticky subrepository, revision updates |
|
343 | Sticky subrepository, revision updates | |
348 | $ hg id -n |
|
344 | $ hg id -n | |
349 | 2 |
|
345 | 2 | |
350 | $ cd s |
|
346 | $ cd s | |
351 | $ svnversion |
|
347 | $ svnversion | |
352 | 3 |
|
348 | 3 | |
353 | $ cd .. |
|
349 | $ cd .. | |
354 | $ cd s |
|
350 | $ cd s | |
355 | $ svn update -qr 1 |
|
351 | $ svn update -qr 1 | |
356 | $ cd .. |
|
352 | $ cd .. | |
357 | $ hg update 1 |
|
353 | $ hg update 1 | |
358 | subrepository s diverged (local revision: 3, remote revision: 2) |
|
354 | subrepository s diverged (local revision: 3, remote revision: 2) | |
359 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
355 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | |
360 | subrepository sources for s differ (in checked out version) |
|
356 | subrepository sources for s differ (in checked out version) | |
361 | use (l)ocal source (1) or (r)emote source (2)? l |
|
357 | use (l)ocal source (1) or (r)emote source (2)? l | |
362 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
358 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
363 | $ hg id -n |
|
359 | $ hg id -n | |
364 | 1+ |
|
360 | 1+ | |
365 | $ cd s |
|
361 | $ cd s | |
366 | $ svnversion |
|
362 | $ svnversion | |
367 | 1 |
|
363 | 1 | |
368 | $ cd .. |
|
364 | $ cd .. | |
369 |
|
365 | |||
370 | Sticky subrepository, file changes and revision updates |
|
366 | Sticky subrepository, file changes and revision updates | |
371 | $ touch s/f1 |
|
367 | $ touch s/f1 | |
372 | $ cd s |
|
368 | $ cd s | |
373 | $ svn add f1 |
|
369 | $ svn add f1 | |
374 | A f1 |
|
370 | A f1 | |
375 | $ svnversion |
|
371 | $ svnversion | |
376 | 1M |
|
372 | 1M | |
377 | $ cd .. |
|
373 | $ cd .. | |
378 | $ hg id -n |
|
374 | $ hg id -n | |
379 | 1+ |
|
375 | 1+ | |
380 | $ hg update tip |
|
376 | $ hg update tip | |
381 | subrepository s diverged (local revision: 3, remote revision: 3) |
|
377 | subrepository s diverged (local revision: 3, remote revision: 3) | |
382 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
378 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | |
383 | subrepository sources for s differ |
|
379 | subrepository sources for s differ | |
384 | use (l)ocal source (1) or (r)emote source (3)? l |
|
380 | use (l)ocal source (1) or (r)emote source (3)? l | |
385 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
381 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
386 | $ hg id -n |
|
382 | $ hg id -n | |
387 | 2+ |
|
383 | 2+ | |
388 | $ cd s |
|
384 | $ cd s | |
389 | $ svnversion |
|
385 | $ svnversion | |
390 | 1M |
|
386 | 1M | |
391 | $ cd .. |
|
387 | $ cd .. | |
392 |
|
388 | |||
393 | Sticky repository, update --clean |
|
389 | Sticky repository, update --clean | |
394 | $ hg update --clean tip | grep -v 's[/\]externals[/\]other' |
|
390 | $ hg update --clean tip | grep -v 's[/\]externals[/\]other' | |
395 | U *s/alpha (glob) |
|
391 | U *s/alpha (glob) | |
396 | U *s (glob) |
|
392 | U *s (glob) | |
397 |
|
393 | |||
398 | Fetching external item into '*s/externals'* (glob) |
|
394 | Fetching external item into '*s/externals'* (glob) | |
399 | Checked out external at revision 1. |
|
395 | Checked out external at revision 1. | |
400 |
|
396 | |||
401 | Checked out revision 3. |
|
397 | Checked out revision 3. | |
402 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
398 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
403 | $ hg id -n |
|
399 | $ hg id -n | |
404 | 2 |
|
400 | 2 | |
405 | $ cd s |
|
401 | $ cd s | |
406 | $ svnversion |
|
402 | $ svnversion | |
407 | 3 |
|
403 | 3 | |
408 | $ cd .. |
|
404 | $ cd .. | |
409 |
|
405 | |||
410 | Test subrepo already at intended revision: |
|
406 | Test subrepo already at intended revision: | |
411 | $ cd s |
|
407 | $ cd s | |
412 | $ svn update -qr 2 |
|
408 | $ svn update -qr 2 | |
413 | $ cd .. |
|
409 | $ cd .. | |
414 | $ hg update 1 |
|
410 | $ hg update 1 | |
415 | subrepository s diverged (local revision: 3, remote revision: 2) |
|
411 | subrepository s diverged (local revision: 3, remote revision: 2) | |
416 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
412 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | |
417 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
413 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
418 | $ hg id -n |
|
414 | $ hg id -n | |
419 | 1+ |
|
415 | 1+ | |
420 | $ cd s |
|
416 | $ cd s | |
421 | $ svnversion |
|
417 | $ svnversion | |
422 | 2 |
|
418 | 2 | |
423 | $ cd .. |
|
419 | $ cd .. | |
424 |
|
420 | |||
425 | Test case where subversion would fail to update the subrepo because there |
|
421 | Test case where subversion would fail to update the subrepo because there | |
426 | are unknown directories being replaced by tracked ones (happens with rebase). |
|
422 | are unknown directories being replaced by tracked ones (happens with rebase). | |
427 |
|
423 | |||
428 | $ cd "$WCROOT/src" |
|
424 | $ cd "$WCROOT/src" | |
429 | $ mkdir dir |
|
425 | $ mkdir dir | |
430 | $ echo epsilon.py > dir/epsilon.py |
|
426 | $ echo epsilon.py > dir/epsilon.py | |
431 | $ svn add dir |
|
427 | $ svn add dir | |
432 | A dir |
|
428 | A dir | |
433 | A dir/epsilon.py |
|
429 | A dir/epsilon.py | |
434 | $ svn ci -qm 'Add dir/epsilon.py' |
|
430 | $ svn ci -qm 'Add dir/epsilon.py' | |
435 | $ cd ../.. |
|
431 | $ cd ../.. | |
436 | $ hg init rebaserepo |
|
432 | $ hg init rebaserepo | |
437 | $ cd rebaserepo |
|
433 | $ cd rebaserepo | |
438 | $ svn co -r5 --quiet "$SVNREPOURL"/src s |
|
434 | $ svn co -r5 --quiet "$SVNREPOURL"/src s | |
439 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub |
|
435 | $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub | |
440 | $ hg add .hgsub |
|
436 | $ hg add .hgsub | |
441 | $ hg ci -m addsub |
|
437 | $ hg ci -m addsub | |
442 | $ echo a > a |
|
438 | $ echo a > a | |
443 | $ hg add . |
|
439 | $ hg add . | |
444 | adding a |
|
440 | adding a | |
445 | $ hg ci -m adda |
|
441 | $ hg ci -m adda | |
446 | $ hg up 0 |
|
442 | $ hg up 0 | |
447 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
443 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
448 | $ svn up -qr6 s |
|
444 | $ svn up -qr6 s | |
449 | $ hg ci -m updatesub |
|
445 | $ hg ci -m updatesub | |
450 | created new head |
|
446 | created new head | |
451 | $ echo pyc > s/dir/epsilon.pyc |
|
447 | $ echo pyc > s/dir/epsilon.pyc | |
452 | $ hg up 1 |
|
448 | $ hg up 1 | |
453 | D *s/dir (glob) |
|
449 | D *s/dir (glob) | |
454 |
|
450 | |||
455 | Fetching external item into '*s/externals'* (glob) |
|
451 | Fetching external item into '*s/externals'* (glob) | |
456 | Checked out external at revision 1. |
|
452 | Checked out external at revision 1. | |
457 |
|
453 | |||
458 | Checked out revision 5. |
|
454 | Checked out revision 5. | |
459 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
455 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
460 | $ hg up -q 2 |
|
456 | $ hg up -q 2 | |
461 |
|
457 | |||
462 | Modify one of the externals to point to a different path so we can |
|
458 | Modify one of the externals to point to a different path so we can | |
463 | test having obstructions when switching branches on checkout: |
|
459 | test having obstructions when switching branches on checkout: | |
464 | $ hg checkout tip |
|
460 | $ hg checkout tip | |
465 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
461 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
466 | $ echo "obstruct = [svn] $SVNREPOURL/externals" >> .hgsub |
|
462 | $ echo "obstruct = [svn] $SVNREPOURL/externals" >> .hgsub | |
467 | $ svn co -r5 --quiet "$SVNREPOURL"/externals obstruct |
|
463 | $ svn co -r5 --quiet "$SVNREPOURL"/externals obstruct | |
468 | $ hg commit -m 'Start making obstructed working copy' |
|
464 | $ hg commit -m 'Start making obstructed working copy' | |
469 | $ hg book other |
|
465 | $ hg book other | |
470 | $ hg co -r 'p1(tip)' |
|
466 | $ hg co -r 'p1(tip)' | |
471 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
467 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
472 | (leaving bookmark other) |
|
468 | (leaving bookmark other) | |
473 | $ echo "obstruct = [svn] $SVNREPOURL/src" >> .hgsub |
|
469 | $ echo "obstruct = [svn] $SVNREPOURL/src" >> .hgsub | |
474 | $ svn co -r5 --quiet "$SVNREPOURL"/src obstruct |
|
470 | $ svn co -r5 --quiet "$SVNREPOURL"/src obstruct | |
475 | $ hg commit -m 'Other branch which will be obstructed' |
|
471 | $ hg commit -m 'Other branch which will be obstructed' | |
476 | created new head |
|
472 | created new head | |
477 |
|
473 | |||
478 | Switching back to the head where we have another path mapped to the |
|
474 | Switching back to the head where we have another path mapped to the | |
479 | same subrepo should work if the subrepo is clean. |
|
475 | same subrepo should work if the subrepo is clean. | |
480 | $ hg co other |
|
476 | $ hg co other | |
481 | A *obstruct/other (glob) |
|
477 | A *obstruct/other (glob) | |
482 | Checked out revision 1. |
|
478 | Checked out revision 1. | |
483 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
479 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
484 | (activating bookmark other) |
|
480 | (activating bookmark other) | |
485 |
|
481 | |||
486 | This is surprising, but is also correct based on the current code: |
|
482 | This is surprising, but is also correct based on the current code: | |
487 | $ echo "updating should (maybe) fail" > obstruct/other |
|
483 | $ echo "updating should (maybe) fail" > obstruct/other | |
488 | $ hg co tip |
|
484 | $ hg co tip | |
489 | abort: uncommitted changes |
|
485 | abort: uncommitted changes | |
490 | (commit or update --clean to discard changes) |
|
486 | (commit or update --clean to discard changes) | |
491 | [255] |
|
487 | [255] | |
492 |
|
488 | |||
493 | Point to a Subversion branch which has since been deleted and recreated |
|
489 | Point to a Subversion branch which has since been deleted and recreated | |
494 | First, create that condition in the repository. |
|
490 | First, create that condition in the repository. | |
495 |
|
491 | |||
496 | $ hg ci --subrepos -m cleanup | filter_svn_output |
|
492 | $ hg ci --subrepos -m cleanup | filter_svn_output | |
497 | committing subrepository obstruct |
|
493 | committing subrepository obstruct | |
498 | Sending obstruct/other |
|
494 | Sending obstruct/other | |
499 | Committed revision 7. |
|
495 | Committed revision 7. | |
500 | At revision 7. |
|
496 | At revision 7. | |
501 | $ svn mkdir -qm "baseline" $SVNREPOURL/trunk |
|
497 | $ svn mkdir -qm "baseline" $SVNREPOURL/trunk | |
502 | $ svn copy -qm "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch |
|
498 | $ svn copy -qm "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
503 | $ svn co --quiet "$SVNREPOURL"/branch tempwc |
|
499 | $ svn co --quiet "$SVNREPOURL"/branch tempwc | |
504 | $ cd tempwc |
|
500 | $ cd tempwc | |
505 | $ echo "something old" > somethingold |
|
501 | $ echo "something old" > somethingold | |
506 | $ svn add somethingold |
|
502 | $ svn add somethingold | |
507 | A somethingold |
|
503 | A somethingold | |
508 | $ svn ci -qm 'Something old' |
|
504 | $ svn ci -qm 'Something old' | |
509 | $ svn rm -qm "remove branch" $SVNREPOURL/branch |
|
505 | $ svn rm -qm "remove branch" $SVNREPOURL/branch | |
510 | $ svn copy -qm "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch |
|
506 | $ svn copy -qm "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch | |
511 | $ svn up -q |
|
507 | $ svn up -q | |
512 | $ echo "something new" > somethingnew |
|
508 | $ echo "something new" > somethingnew | |
513 | $ svn add somethingnew |
|
509 | $ svn add somethingnew | |
514 | A somethingnew |
|
510 | A somethingnew | |
515 | $ svn ci -qm 'Something new' |
|
511 | $ svn ci -qm 'Something new' | |
516 | $ cd .. |
|
512 | $ cd .. | |
517 | $ rm -rf tempwc |
|
513 | $ rm -rf tempwc | |
518 | $ svn co "$SVNREPOURL/branch"@10 recreated |
|
514 | $ svn co "$SVNREPOURL/branch"@10 recreated | |
519 | A recreated/somethingold |
|
515 | A recreated/somethingold | |
520 | Checked out revision 10. |
|
516 | Checked out revision 10. | |
521 | $ echo "recreated = [svn] $SVNREPOURL/branch" >> .hgsub |
|
517 | $ echo "recreated = [svn] $SVNREPOURL/branch" >> .hgsub | |
522 | $ hg ci -m addsub |
|
518 | $ hg ci -m addsub | |
523 | $ cd recreated |
|
519 | $ cd recreated | |
524 | $ svn up -q |
|
520 | $ svn up -q | |
525 | $ cd .. |
|
521 | $ cd .. | |
526 | $ hg ci -m updatesub |
|
522 | $ hg ci -m updatesub | |
527 | $ hg up -r-2 |
|
523 | $ hg up -r-2 | |
528 | D *recreated/somethingnew (glob) |
|
524 | D *recreated/somethingnew (glob) | |
529 | A *recreated/somethingold (glob) |
|
525 | A *recreated/somethingold (glob) | |
530 | Checked out revision 10. |
|
526 | Checked out revision 10. | |
531 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
527 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
532 | (leaving bookmark other) |
|
528 | (leaving bookmark other) | |
533 | $ test -f recreated/somethingold |
|
529 | $ test -f recreated/somethingold | |
534 |
|
530 | |||
535 | Test archive |
|
531 | Test archive | |
536 |
|
532 | |||
537 | $ hg archive -S ../archive-all --debug --config progress.debug=true |
|
533 | $ hg archive -S ../archive-all --debug --config progress.debug=true | |
538 | archiving: 0/2 files (0.00%) |
|
534 | archiving: 0/2 files (0.00%) | |
539 | archiving: .hgsub 1/2 files (50.00%) |
|
535 | archiving: .hgsub 1/2 files (50.00%) | |
540 | archiving: .hgsubstate 2/2 files (100.00%) |
|
536 | archiving: .hgsubstate 2/2 files (100.00%) | |
541 | archiving (obstruct): 0/1 files (0.00%) |
|
537 | archiving (obstruct): 0/1 files (0.00%) | |
542 | archiving (obstruct): 1/1 files (100.00%) |
|
538 | archiving (obstruct): 1/1 files (100.00%) | |
543 | archiving (recreated): 0/1 files (0.00%) |
|
539 | archiving (recreated): 0/1 files (0.00%) | |
544 | archiving (recreated): 1/1 files (100.00%) |
|
540 | archiving (recreated): 1/1 files (100.00%) | |
545 | archiving (s): 0/2 files (0.00%) |
|
541 | archiving (s): 0/2 files (0.00%) | |
546 | archiving (s): 1/2 files (50.00%) |
|
542 | archiving (s): 1/2 files (50.00%) | |
547 | archiving (s): 2/2 files (100.00%) |
|
543 | archiving (s): 2/2 files (100.00%) | |
548 |
|
544 | |||
549 | $ hg archive -S ../archive-exclude --debug --config progress.debug=true -X **old |
|
545 | $ hg archive -S ../archive-exclude --debug --config progress.debug=true -X **old | |
550 | archiving: 0/2 files (0.00%) |
|
546 | archiving: 0/2 files (0.00%) | |
551 | archiving: .hgsub 1/2 files (50.00%) |
|
547 | archiving: .hgsub 1/2 files (50.00%) | |
552 | archiving: .hgsubstate 2/2 files (100.00%) |
|
548 | archiving: .hgsubstate 2/2 files (100.00%) | |
553 | archiving (obstruct): 0/1 files (0.00%) |
|
549 | archiving (obstruct): 0/1 files (0.00%) | |
554 | archiving (obstruct): 1/1 files (100.00%) |
|
550 | archiving (obstruct): 1/1 files (100.00%) | |
555 | archiving (recreated): 0 files |
|
551 | archiving (recreated): 0 files | |
556 | archiving (s): 0/2 files (0.00%) |
|
552 | archiving (s): 0/2 files (0.00%) | |
557 | archiving (s): 1/2 files (50.00%) |
|
553 | archiving (s): 1/2 files (50.00%) | |
558 | archiving (s): 2/2 files (100.00%) |
|
554 | archiving (s): 2/2 files (100.00%) | |
559 | $ find ../archive-exclude | sort |
|
555 | $ find ../archive-exclude | sort | |
560 | ../archive-exclude |
|
556 | ../archive-exclude | |
561 | ../archive-exclude/.hg_archival.txt |
|
557 | ../archive-exclude/.hg_archival.txt | |
562 | ../archive-exclude/.hgsub |
|
558 | ../archive-exclude/.hgsub | |
563 | ../archive-exclude/.hgsubstate |
|
559 | ../archive-exclude/.hgsubstate | |
564 | ../archive-exclude/obstruct |
|
560 | ../archive-exclude/obstruct | |
565 | ../archive-exclude/obstruct/other |
|
561 | ../archive-exclude/obstruct/other | |
566 | ../archive-exclude/s |
|
562 | ../archive-exclude/s | |
567 | ../archive-exclude/s/alpha |
|
563 | ../archive-exclude/s/alpha | |
568 | ../archive-exclude/s/dir |
|
564 | ../archive-exclude/s/dir | |
569 | ../archive-exclude/s/dir/epsilon.py |
|
565 | ../archive-exclude/s/dir/epsilon.py | |
570 |
|
566 | |||
571 | Test forgetting files, not implemented in svn subrepo, used to |
|
567 | Test forgetting files, not implemented in svn subrepo, used to | |
572 | traceback |
|
568 | traceback | |
573 |
|
569 | |||
574 | $ hg forget 'notafile*' |
|
570 | $ hg forget 'notafile*' | |
575 | notafile*: $ENOENT$ |
|
571 | notafile*: $ENOENT$ | |
576 | [1] |
|
572 | [1] | |
577 |
|
573 | |||
578 | Test a subrepo referencing a just moved svn path. Last commit rev will |
|
574 | Test a subrepo referencing a just moved svn path. Last commit rev will | |
579 | be different from the revision, and the path will be different as |
|
575 | be different from the revision, and the path will be different as | |
580 | well. |
|
576 | well. | |
581 |
|
577 | |||
582 | $ cd "$WCROOT" |
|
578 | $ cd "$WCROOT" | |
583 | $ svn up > /dev/null |
|
579 | $ svn up > /dev/null | |
584 | $ mkdir trunk/subdir branches |
|
580 | $ mkdir trunk/subdir branches | |
585 | $ echo a > trunk/subdir/a |
|
581 | $ echo a > trunk/subdir/a | |
586 | $ svn add trunk/subdir branches |
|
582 | $ svn add trunk/subdir branches | |
587 | A trunk/subdir |
|
583 | A trunk/subdir | |
588 | A trunk/subdir/a |
|
584 | A trunk/subdir/a | |
589 | A branches |
|
585 | A branches | |
590 | $ svn ci -qm addsubdir |
|
586 | $ svn ci -qm addsubdir | |
591 | $ svn cp -qm branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch |
|
587 | $ svn cp -qm branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch | |
592 | $ cd .. |
|
588 | $ cd .. | |
593 |
|
589 | |||
594 | $ hg init repo2 |
|
590 | $ hg init repo2 | |
595 | $ cd repo2 |
|
591 | $ cd repo2 | |
596 | $ svn co $SVNREPOURL/branches/somebranch/subdir |
|
592 | $ svn co $SVNREPOURL/branches/somebranch/subdir | |
597 | A subdir/a |
|
593 | A subdir/a | |
598 | Checked out revision 15. |
|
594 | Checked out revision 15. | |
599 | $ echo "subdir = [svn] $SVNREPOURL/branches/somebranch/subdir" > .hgsub |
|
595 | $ echo "subdir = [svn] $SVNREPOURL/branches/somebranch/subdir" > .hgsub | |
600 | $ hg add .hgsub |
|
596 | $ hg add .hgsub | |
601 | $ hg ci -m addsub |
|
597 | $ hg ci -m addsub | |
602 | $ hg up null |
|
598 | $ hg up null | |
603 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
599 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
604 | $ hg up |
|
600 | $ hg up | |
605 | A *subdir/a (glob) |
|
601 | A *subdir/a (glob) | |
606 | Checked out revision 15. |
|
602 | Checked out revision 15. | |
607 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
603 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
608 | $ cd .. |
|
604 | $ cd .. | |
609 |
|
605 | |||
610 | Test sanitizing ".hg/hgrc" in subrepo |
|
606 | Test sanitizing ".hg/hgrc" in subrepo | |
611 |
|
607 | |||
612 | $ cd sub/t |
|
608 | $ cd sub/t | |
613 | $ hg update -q -C tip |
|
609 | $ hg update -q -C tip | |
614 | $ cd s |
|
610 | $ cd s | |
615 | $ mkdir .hg |
|
611 | $ mkdir .hg | |
616 | $ echo '.hg/hgrc in svn repo' > .hg/hgrc |
|
612 | $ echo '.hg/hgrc in svn repo' > .hg/hgrc | |
617 | $ mkdir -p sub/.hg |
|
613 | $ mkdir -p sub/.hg | |
618 | $ echo 'sub/.hg/hgrc in svn repo' > sub/.hg/hgrc |
|
614 | $ echo 'sub/.hg/hgrc in svn repo' > sub/.hg/hgrc | |
619 | $ svn add .hg sub |
|
615 | $ svn add .hg sub | |
620 | A .hg |
|
616 | A .hg | |
621 | A .hg/hgrc |
|
617 | A .hg/hgrc | |
622 | A sub |
|
618 | A sub | |
623 | A sub/.hg |
|
619 | A sub/.hg | |
624 | A sub/.hg/hgrc |
|
620 | A sub/.hg/hgrc | |
625 | $ svn ci -qm 'add .hg/hgrc to be sanitized at hg update' |
|
621 | $ svn ci -qm 'add .hg/hgrc to be sanitized at hg update' | |
626 | $ svn up -q |
|
622 | $ svn up -q | |
627 | $ cd .. |
|
623 | $ cd .. | |
628 | $ hg commit -S -m 'commit with svn revision including .hg/hgrc' |
|
624 | $ hg commit -S -m 'commit with svn revision including .hg/hgrc' | |
629 | $ grep ' s$' .hgsubstate |
|
625 | $ grep ' s$' .hgsubstate | |
630 | 16 s |
|
626 | 16 s | |
631 | $ cd .. |
|
627 | $ cd .. | |
632 |
|
628 | |||
633 | $ hg -R tc pull -u -q 2>&1 | sort |
|
629 | $ hg -R tc pull -u -q 2>&1 | sort | |
634 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/.hg' |
|
630 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/.hg' | |
635 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/sub/.hg' |
|
631 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/sub/.hg' | |
636 | $ cd tc |
|
632 | $ cd tc | |
637 | $ grep ' s$' .hgsubstate |
|
633 | $ grep ' s$' .hgsubstate | |
638 | 16 s |
|
634 | 16 s | |
639 | $ test -f s/.hg/hgrc |
|
635 | $ test -f s/.hg/hgrc | |
640 | [1] |
|
636 | [1] | |
641 | $ test -f s/sub/.hg/hgrc |
|
637 | $ test -f s/sub/.hg/hgrc | |
642 | [1] |
|
638 | [1] | |
643 |
|
639 | |||
644 | Test that sanitizing is omitted in meta data area: |
|
640 | Test that sanitizing is omitted in meta data area: | |
645 |
|
641 | |||
646 | $ mkdir s/.svn/.hg |
|
642 | $ mkdir s/.svn/.hg | |
647 | $ echo '.hg/hgrc in svn metadata area' > s/.svn/.hg/hgrc |
|
643 | $ echo '.hg/hgrc in svn metadata area' > s/.svn/.hg/hgrc | |
648 | $ hg update -q -C '.^1' |
|
644 | $ hg update -q -C '.^1' | |
649 |
|
645 | |||
650 | $ cd ../.. |
|
646 | $ cd ../.. | |
651 |
|
647 | |||
652 | SEC: test for ssh exploit |
|
648 | SEC: test for ssh exploit | |
653 |
|
649 | |||
654 | $ hg init ssh-vuln |
|
650 | $ hg init ssh-vuln | |
655 | $ cd ssh-vuln |
|
651 | $ cd ssh-vuln | |
656 | $ echo "s = [svn]$SVNREPOURL/src" >> .hgsub |
|
652 | $ echo "s = [svn]$SVNREPOURL/src" >> .hgsub | |
657 | $ svn co --quiet "$SVNREPOURL"/src s |
|
653 | $ svn co --quiet "$SVNREPOURL"/src s | |
658 | $ hg add .hgsub |
|
654 | $ hg add .hgsub | |
659 | $ hg ci -m1 |
|
655 | $ hg ci -m1 | |
660 | $ echo "s = [svn]svn+ssh://-oProxyCommand=touch%20owned%20nested" > .hgsub |
|
656 | $ echo "s = [svn]svn+ssh://-oProxyCommand=touch%20owned%20nested" > .hgsub | |
661 | $ hg ci -m2 |
|
657 | $ hg ci -m2 | |
662 | $ cd .. |
|
658 | $ cd .. | |
663 | $ hg clone ssh-vuln ssh-vuln-clone |
|
659 | $ hg clone ssh-vuln ssh-vuln-clone | |
664 | updating to branch default |
|
660 | updating to branch default | |
665 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") |
|
661 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") | |
666 | [255] |
|
662 | [255] | |
667 |
|
663 | |||
668 | also check that a percent encoded '-' (%2D) doesn't work |
|
664 | also check that a percent encoded '-' (%2D) doesn't work | |
669 |
|
665 | |||
670 | $ cd ssh-vuln |
|
666 | $ cd ssh-vuln | |
671 | $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20nested" > .hgsub |
|
667 | $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20nested" > .hgsub | |
672 | $ hg ci -m3 |
|
668 | $ hg ci -m3 | |
673 | $ cd .. |
|
669 | $ cd .. | |
674 | $ rm -r ssh-vuln-clone |
|
670 | $ rm -r ssh-vuln-clone | |
675 | $ hg clone ssh-vuln ssh-vuln-clone |
|
671 | $ hg clone ssh-vuln ssh-vuln-clone | |
676 | updating to branch default |
|
672 | updating to branch default | |
677 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") |
|
673 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") | |
678 | [255] |
|
674 | [255] | |
679 |
|
675 | |||
680 | also check that hiding the attack in the username doesn't work: |
|
676 | also check that hiding the attack in the username doesn't work: | |
681 |
|
677 | |||
682 | $ cd ssh-vuln |
|
678 | $ cd ssh-vuln | |
683 | $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20foo@example.com/nested" > .hgsub |
|
679 | $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20foo@example.com/nested" > .hgsub | |
684 | $ hg ci -m3 |
|
680 | $ hg ci -m3 | |
685 | $ cd .. |
|
681 | $ cd .. | |
686 | $ rm -r ssh-vuln-clone |
|
682 | $ rm -r ssh-vuln-clone | |
687 | $ hg clone ssh-vuln ssh-vuln-clone |
|
683 | $ hg clone ssh-vuln ssh-vuln-clone | |
688 | updating to branch default |
|
684 | updating to branch default | |
689 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned foo@example.com/nested' (in subrepository "s") |
|
685 | abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned foo@example.com/nested' (in subrepository "s") | |
690 | [255] |
|
686 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now