File: test-file-removal.t

package info (click to toggle)
hg-git 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,244 kB
  • sloc: python: 8,702; sh: 185; makefile: 23
file content (289 lines) | stat: -rw-r--r-- 7,959 bytes parent folder | download
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
Load commonly used test logic
  $ . "$TESTDIR/testutil"

  $ git init gitrepo
  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
  $ cd gitrepo
  $ echo alpha > alpha
  $ git add alpha
  $ fn_git_commit -m 'add alpha'
  $ echo beta > beta
  $ git add beta
  $ fn_git_commit -m 'add beta'
  $ mkdir foo
  $ echo blah > foo/bar
  $ git add foo
  $ fn_git_commit -m 'add foo'
  $ git rm alpha
  rm 'alpha'
  $ fn_git_commit -m 'remove alpha'
  $ git rm foo/bar
  rm 'foo/bar'
  $ fn_git_commit -m 'remove foo/bar'
  $ ln -s beta betalink
  $ git add betalink
  $ fn_git_commit -m 'add symlink to beta'
replace symlink with file
  $ rm betalink
  $ echo betalink > betalink
  $ git add betalink
  $ fn_git_commit -m 'replace symlink with file'
replace file with symlink
  $ rm betalink
  $ ln -s beta betalink
  $ git add betalink
  $ fn_git_commit -m 'replace file with symlink'
  $ git rm betalink
  rm 'betalink'
  $ fn_git_commit -m 'remove betalink'
final manifest in git is just beta
  $ git ls-files
  beta
  $ git log --pretty=medium
  commit 5ee11eeae239d6a99df5a99901ec00ffafbcc46b
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:18 2007 +0000
  
      remove betalink
  
  commit 2c7b324faeccb1acf89c35b7ad38e7956f5705fa
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:17 2007 +0000
  
      replace file with symlink
  
  commit ff0478d2ecc2571d01eb6d406ac29e4e63e5d3d5
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:16 2007 +0000
  
      replace symlink with file
  
  commit 5492e6e410e42df527956be945286cd1ae45acb8
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:15 2007 +0000
  
      add symlink to beta
  
  commit b991de8952c482a7cd51162674ffff8474862218
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:14 2007 +0000
  
      remove foo/bar
  
  commit b0edaf0adac19392cf2867498b983bc5192b41dd
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:13 2007 +0000
  
      remove alpha
  
  commit f2d0d5bfa905e12dee728b509b96cf265bb6ee43
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:12 2007 +0000
  
      add foo
  
  commit 9497a4ee62e16ee641860d7677cdb2589ea15554
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:11 2007 +0000
  
      add beta
  
  commit 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:10 2007 +0000
  
      add alpha

  $ cd ..
  $ git init -q --bare repo.git

  $ hg clone gitrepo hgrepo
  importing 9 git commits
  new changesets ff7a2f2d8d70:0995b8a0a943 (9 drafts)
  updating to bookmark master
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd hgrepo
  $ hg log --graph
  @  changeset:   8:0995b8a0a943
  |  bookmark:    master
  |  tag:         default/master
  |  tag:         tip
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:18 2007 +0000
  |  summary:     remove betalink
  |
  o  changeset:   7:a316d3a96c89
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:17 2007 +0000
  |  summary:     replace file with symlink
  |
  o  changeset:   6:1804acb71f3e
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:16 2007 +0000
  |  summary:     replace symlink with file
  |
  o  changeset:   5:e19c85becc87
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:15 2007 +0000
  |  summary:     add symlink to beta
  |
  o  changeset:   4:0d3086c3f8c3
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:14 2007 +0000
  |  summary:     remove foo/bar
  |
  o  changeset:   3:b2406125ef5c
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:13 2007 +0000
  |  summary:     remove alpha
  |
  o  changeset:   2:8b3b2f4b4158
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:12 2007 +0000
  |  summary:     add foo
  |
  o  changeset:   1:7fe02317c63d
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:11 2007 +0000
  |  summary:     add beta
  |
  o  changeset:   0:ff7a2f2d8d70
     user:        test <test@example.org>
     date:        Mon Jan 01 00:00:10 2007 +0000
     summary:     add alpha
  

make sure alpha is not in this manifest
  $ hg manifest -r 3
  beta
  foo/bar

make sure that only beta is in the manifest
  $ hg manifest
  beta

  $ hg debug-remove-hggit-state
  clearing out the git cache data
  $ ls .hg | grep git
  [1]
  $ hg push ../repo.git
  pushing to ../repo.git
  searching for changes
  adding objects
  remote: found 0 deltas to reuse
  added 9 commits with 8 trees and 5 blobs
  adding reference refs/heads/master

  $ cd ..
  $ git --git-dir=repo.git log --pretty=medium
  commit 5ee11eeae239d6a99df5a99901ec00ffafbcc46b
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:18 2007 +0000
  
      remove betalink
  
  commit 2c7b324faeccb1acf89c35b7ad38e7956f5705fa
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:17 2007 +0000
  
      replace file with symlink
  
  commit ff0478d2ecc2571d01eb6d406ac29e4e63e5d3d5
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:16 2007 +0000
  
      replace symlink with file
  
  commit 5492e6e410e42df527956be945286cd1ae45acb8
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:15 2007 +0000
  
      add symlink to beta
  
  commit b991de8952c482a7cd51162674ffff8474862218
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:14 2007 +0000
  
      remove foo/bar
  
  commit b0edaf0adac19392cf2867498b983bc5192b41dd
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:13 2007 +0000
  
      remove alpha
  
  commit f2d0d5bfa905e12dee728b509b96cf265bb6ee43
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:12 2007 +0000
  
      add foo
  
  commit 9497a4ee62e16ee641860d7677cdb2589ea15554
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:11 2007 +0000
  
      add beta
  
  commit 7eeab2ea75ec1ac0ff3d500b5b6f8a3447dd7c03
  Author: test <test@example.org>
  Date:   Mon Jan 1 00:00:10 2007 +0000
  
      add alpha

test with rename detection enabled
  $ hg --config git.similarity=100 clone gitrepo hgreporenames
  importing 9 git commits
  new changesets ff7a2f2d8d70:0995b8a0a943 (9 drafts)
  updating to bookmark master
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  $ cd hgreporenames
  $ hg log --graph
  @  changeset:   8:0995b8a0a943
  |  bookmark:    master
  |  tag:         default/master
  |  tag:         tip
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:18 2007 +0000
  |  summary:     remove betalink
  |
  o  changeset:   7:a316d3a96c89
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:17 2007 +0000
  |  summary:     replace file with symlink
  |
  o  changeset:   6:1804acb71f3e
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:16 2007 +0000
  |  summary:     replace symlink with file
  |
  o  changeset:   5:e19c85becc87
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:15 2007 +0000
  |  summary:     add symlink to beta
  |
  o  changeset:   4:0d3086c3f8c3
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:14 2007 +0000
  |  summary:     remove foo/bar
  |
  o  changeset:   3:b2406125ef5c
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:13 2007 +0000
  |  summary:     remove alpha
  |
  o  changeset:   2:8b3b2f4b4158
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:12 2007 +0000
  |  summary:     add foo
  |
  o  changeset:   1:7fe02317c63d
  |  user:        test <test@example.org>
  |  date:        Mon Jan 01 00:00:11 2007 +0000
  |  summary:     add beta
  |
  o  changeset:   0:ff7a2f2d8d70
     user:        test <test@example.org>
     date:        Mon Jan 01 00:00:10 2007 +0000
     summary:     add alpha