summaryrefslogtreecommitdiff
path: root/tests/test-convert-bzr-directories.t
blob: 613fd6a837067af6215de3a5afe2c6c151775847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151

  $ . "$TESTDIR/bzr-definitions"

empty directory

  $ mkdir test-empty
  $ cd test-empty
  $ bzr init -q source
  $ cd source
  $ echo content > a
  $ bzr add -q a
  $ bzr commit -q -m 'Initial add'
  $ mkdir empty
  $ bzr add -q empty
  $ bzr commit -q -m 'Empty directory added'
  $ echo content > empty/something
  $ bzr add -q empty/something
  $ bzr commit -q -m 'Added file into directory'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  2 Initial add
  1 Empty directory added
  0 Added file into directory
  $ manifest source-hg 1
  % manifest of 1
  644   a
  $ manifest source-hg tip
  % manifest of tip
  644   a
  644   empty/something
  $ cd ..

directory renames

  $ mkdir test-dir-rename
  $ cd test-dir-rename
  $ bzr init -q source
  $ cd source
  $ mkdir tpyo
  $ echo content > tpyo/something
  $ bzr add -q tpyo
  $ bzr commit -q -m 'Added directory'
  $ bzr mv tpyo typo
  tpyo => typo
  $ bzr commit -q -m 'Oops, typo'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  1 Added directory
  0 Oops, typo
  $ manifest source-hg 0
  % manifest of 0
  644   tpyo/something
  $ manifest source-hg tip
  % manifest of tip
  644   typo/something
  $ cd ..

nested directory renames

  $ mkdir test-nested-dir-rename
  $ cd test-nested-dir-rename
  $ bzr init -q source
  $ cd source
  $ mkdir -p firstlevel/secondlevel/thirdlevel
  $ echo content > firstlevel/secondlevel/file
  $ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
  $ bzr add -q firstlevel
  $ bzr commit -q -m 'Added nested directories'
  $ bzr mv firstlevel/secondlevel secondlevel
  firstlevel/secondlevel => secondlevel
  $ bzr commit -q -m 'Moved secondlevel one level up'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  1 Added nested directories
  0 Moved secondlevel one level up
  $ manifest source-hg tip
  % manifest of tip
  644   secondlevel/file
  644   secondlevel/thirdlevel/stuff
  $ cd ..

directory remove

  $ mkdir test-dir-remove
  $ cd test-dir-remove
  $ bzr init -q source
  $ cd source
  $ mkdir src
  $ echo content > src/sourcecode
  $ bzr add -q src
  $ bzr commit -q -m 'Added directory'
  $ bzr rm -q src
  $ bzr commit -q -m 'Removed directory'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  1 Added directory
  0 Removed directory
  $ manifest source-hg 0
  % manifest of 0
  644   src/sourcecode
  $ manifest source-hg tip
  % manifest of tip
  $ cd ..

directory replace

  $ mkdir test-dir-replace
  $ cd test-dir-replace
  $ bzr init -q source
  $ cd source
  $ mkdir first second
  $ echo content > first/file
  $ echo morecontent > first/dummy
  $ echo othercontent > second/something
  $ bzr add -q first second
  $ bzr commit -q -m 'Initial layout'
  $ bzr mv first/file second/file
  first/file => second/file
  $ bzr mv first third
  first => third
  $ bzr commit -q -m 'Some conflicting moves'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  1 Initial layout
  0 Some conflicting moves
  $ manifest source-hg tip
  % manifest of tip
  644   second/file
  644   second/something
  644   third/dummy
  $ cd ..