##// END OF EJS Templates
copies: fix detection of divergent directory renames...
Matt Mackall -
r27876:602add6a default
parent child Browse files
Show More
@@ -401,13 +401,13 b' def mergecopies(repo, c1, c2, ca):'
401 continue
401 continue
402 elif dsrc in d1 and ddst in d1:
402 elif dsrc in d1 and ddst in d1:
403 # directory wasn't entirely moved locally
403 # directory wasn't entirely moved locally
404 invalid.add(dsrc)
404 invalid.add(dsrc + "/")
405 elif dsrc in d2 and ddst in d2:
405 elif dsrc in d2 and ddst in d2:
406 # directory wasn't entirely moved remotely
406 # directory wasn't entirely moved remotely
407 invalid.add(dsrc)
407 invalid.add(dsrc + "/")
408 elif dsrc in dirmove and dirmove[dsrc] != ddst:
408 elif dsrc + "/" in dirmove and dirmove[dsrc + "/"] != ddst + "/":
409 # files from the same directory moved to two different places
409 # files from the same directory moved to two different places
410 invalid.add(dsrc)
410 invalid.add(dsrc + "/")
411 else:
411 else:
412 # looks good so far
412 # looks good so far
413 dirmove[dsrc + "/"] = ddst + "/"
413 dirmove[dsrc + "/"] = ddst + "/"
@@ -231,3 +231,63 b' Second scenario with two repos:'
231 R a/f
231 R a/f
232
232
233 $ cd ..
233 $ cd ..
234
235 Test renames to separate directories
236
237 $ hg init a
238 $ cd a
239 $ mkdir a
240 $ touch a/s
241 $ touch a/t
242 $ hg ci -Am0
243 adding a/s
244 adding a/t
245
246 Add more files
247
248 $ touch a/s2
249 $ touch a/t2
250 $ hg ci -Am1
251 adding a/s2
252 adding a/t2
253
254 Do moves on a branch
255
256 $ hg up 0
257 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
258 $ mkdir s
259 $ mkdir t
260 $ hg mv a/s s
261 $ hg mv a/t t
262 $ hg ci -Am2
263 created new head
264 $ hg st --copies --change .
265 A s/s
266 a/s
267 A t/t
268 a/t
269 R a/s
270 R a/t
271
272 Merge shouldn't move s2, t2
273
274 $ hg merge
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 (branch merge, don't forget to commit)
277 $ hg st --copies
278 M a/s2
279 M a/t2
280
281 Try the merge in the other direction. It may or may not be appropriate for
282 status to list copies here.
283
284 $ hg up -C 1
285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
286 $ hg merge
287 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 (branch merge, don't forget to commit)
289 $ hg st --copies
290 M s/s
291 M t/t
292 R a/s
293 R a/t
General Comments 0
You need to be logged in to leave comments. Login now