comparison mercurial/copies.py @ 16795:e9ae770eff1c

merge: show renamed on one and deleted on the other side in debug output
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 23 May 2012 21:34:29 +0200
parents 98687cdddcb1
children 8b7cd9a998f0
comparison
equal deleted inserted replaced
16794:98687cdddcb1 16795:e9ae770eff1c
285 checkcopies(f, m1, m2) 285 checkcopies(f, m1, m2)
286 for f in u2: 286 for f in u2:
287 checkcopies(f, m2, m1) 287 checkcopies(f, m2, m1)
288 288
289 renamedelete = {} 289 renamedelete = {}
290 renamedelete2 = set()
290 diverge2 = set() 291 diverge2 = set()
291 for of, fl in diverge.items(): 292 for of, fl in diverge.items():
292 if len(fl) == 1 or of in c1 or of in c2: 293 if len(fl) == 1 or of in c1 or of in c2:
293 del diverge[of] # not actually divergent, or not a rename 294 del diverge[of] # not actually divergent, or not a rename
294 if of not in c1 and of not in c2: 295 if of not in c1 and of not in c2:
295 # renamed on one side, deleted on the other side, but filter 296 # renamed on one side, deleted on the other side, but filter
296 # out files that have been renamed and then deleted 297 # out files that have been renamed and then deleted
297 renamedelete[of] = [f for f in fl if f in c1 or f in c2] 298 renamedelete[of] = [f for f in fl if f in c1 or f in c2]
299 renamedelete2.update(fl) # reverse map for below
298 else: 300 else:
299 diverge2.update(fl) # reverse map for below 301 diverge2.update(fl) # reverse map for below
300 302
301 if fullcopy: 303 if fullcopy:
302 repo.ui.debug(" all copies found (* = to merge, ! = divergent):\n") 304 repo.ui.debug(" all copies found (* = to merge, ! = divergent, "
305 "% = renamed and deleted):\n")
303 for f in fullcopy: 306 for f in fullcopy:
304 note = "" 307 note = ""
305 if f in copy: 308 if f in copy:
306 note += "*" 309 note += "*"
307 if f in diverge2: 310 if f in diverge2:
308 note += "!" 311 note += "!"
312 if f in renamedelete2:
313 note += "%"
309 repo.ui.debug(" %s -> %s %s\n" % (f, fullcopy[f], note)) 314 repo.ui.debug(" %s -> %s %s\n" % (f, fullcopy[f], note))
310 del diverge2 315 del diverge2
311 316
312 if not fullcopy: 317 if not fullcopy:
313 return copy, diverge, renamedelete 318 return copy, diverge, renamedelete