Debian Codegraph @

tests/test-convert-bzr-directories.t

raw
1 #require bzr
2
3 $ . "$TESTDIR/bzr-definitions"
4
5 Work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944379
6 $ mkdir -p "${HOME}/.config/breezy"
7
8 empty directory
9
10 $ mkdir test-empty
11 $ cd test-empty
12 $ brz init -q source
13 $ cd source
14 $ echo content > a
15 $ brz add -q a
16 $ brz commit -q -m 'Initial add'
17 $ mkdir empty
18 $ brz add -q empty
19 $ brz commit -q -m 'Empty directory added'
20 $ echo content > empty/something
21 $ brz add -q empty/something
22 $ brz commit -q -m 'Added file into directory'
23 $ cd ..
24 $ hg convert source source-hg
25 initializing destination source-hg repository
26 scanning source...
27 sorting...
28 converting...
29 2 Initial add
30 1 Empty directory added
31 0 Added file into directory
32 $ manifest source-hg 1
33 % manifest of 1
34 644 a
35 $ manifest source-hg tip
36 % manifest of tip
37 644 a
38 644 empty/something
39 $ cd ..
40
41 directory renames
42
43 $ mkdir test-dir-rename
44 $ cd test-dir-rename
45 $ brz init -q source
46 $ cd source
47 $ mkdir tpyo
48 $ echo content > tpyo/something
49 $ brz add -q tpyo
50 $ brz commit -q -m 'Added directory'
51 $ brz mv tpyo typo
52 tpyo => typo
53 $ brz commit -q -m 'Oops, typo'
54 $ cd ..
55 $ hg convert source source-hg
56 initializing destination source-hg repository
57 scanning source...
58 sorting...
59 converting...
60 1 Added directory
61 0 Oops, typo
62 $ manifest source-hg 0
63 % manifest of 0
64 644 tpyo/something
65 $ manifest source-hg tip
66 % manifest of tip
67 644 typo/something
68 $ cd ..
69
70 nested directory renames
71
72 $ mkdir test-nested-dir-rename
73 $ cd test-nested-dir-rename
74 $ brz init -q source
75 $ cd source
76 $ mkdir -p firstlevel/secondlevel/thirdlevel
77 $ echo content > firstlevel/secondlevel/file
78 $ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
79 $ brz add -q firstlevel
80 $ brz commit -q -m 'Added nested directories'
81 $ brz mv firstlevel/secondlevel secondlevel
82 firstlevel/secondlevel => secondlevel
83 $ brz commit -q -m 'Moved secondlevel one level up'
84 $ cd ..
85 $ hg convert source source-hg
86 initializing destination source-hg repository
87 scanning source...
88 sorting...
89 converting...
90 1 Added nested directories
91 0 Moved secondlevel one level up
92 $ manifest source-hg tip
93 % manifest of tip
94 644 secondlevel/file
95 644 secondlevel/thirdlevel/stuff
96 $ cd ..
97
98 directory remove
99
100 $ mkdir test-dir-remove
101 $ cd test-dir-remove
102 $ brz init -q source
103 $ cd source
104 $ mkdir src
105 $ echo content > src/sourcecode
106 $ brz add -q src
107 $ brz commit -q -m 'Added directory'
108 $ brz rm -q src
109 $ brz commit -q -m 'Removed directory'
110 $ cd ..
111 $ hg convert source source-hg
112 initializing destination source-hg repository
113 scanning source...
114 sorting...
115 converting...
116 1 Added directory
117 0 Removed directory
118 $ manifest source-hg 0
119 % manifest of 0
120 644 src/sourcecode
121 $ manifest source-hg tip
122 % manifest of tip
123 $ cd ..
124
125 directory replace
126
127 $ mkdir test-dir-replace
128 $ cd test-dir-replace
129 $ brz init -q source
130 $ cd source
131 $ mkdir first second
132 $ echo content > first/file
133 $ echo morecontent > first/dummy
134 $ echo othercontent > second/something
135 $ brz add -q first second
136 $ brz commit -q -m 'Initial layout'
137 $ brz mv first/file second/file
138 first/file => second/file
139 $ brz mv first third
140 first => third
141 $ brz commit -q -m 'Some conflicting moves'
142 $ cd ..
143 $ hg convert source source-hg
144 initializing destination source-hg repository
145 scanning source...
146 sorting...
147 converting...
148 1 Initial layout
149 0 Some conflicting moves
150 $ manifest source-hg tip
151 % manifest of tip
152 644 second/file
153 644 second/something
154 644 third/dummy
155 $ cd ..
156
157 divergent nested renames (issue3089)
158
159 $ mkdir test-divergent-renames
160 $ cd test-divergent-renames
161 $ brz init -q source
162 $ cd source
163 $ mkdir -p a/c
164 $ echo a > a/fa
165 $ echo c > a/c/fc
166 $ brz add -q a
167 $ brz commit -q -m 'Initial layout'
168 $ brz mv a b
169 a => b
170 $ mkdir a
171 $ brz add a
172 add(ed|ing) a (re)
173 $ brz mv b/c a/c
174 b/c => a/c
175 $ brz status
176 added:
177 a/
178 renamed:
179 a/? => b/? (re)
180 a/c/? => a/c/? (re)
181 $ brz commit -q -m 'Divergent renames'
182 $ cd ..
183 $ hg convert source source-hg
184 initializing destination source-hg repository
185 scanning source...
186 sorting...
187 converting...
188 1 Initial layout
189 0 Divergent renames
190 $ hg -R source-hg st -C --change 1
191 A b/fa
192 a/fa
193 R a/fa
194 $ hg -R source-hg manifest -r 1
195 a/c/fc
196 b/fa
197 $ cd ..