comparison mercurial/merge.py @ 5857:c704b03884ef

merge: add a bit more sanity to divergent copy checks
author Matt Mackall <mpm@selenic.com>
date Mon, 14 Jan 2008 16:28:32 -0600
parents f6bf89722e29
children 7855b88ba838
comparison
equal deleted inserted replaced
5856:85888efbdfff 5857:c704b03884ef
208 checkcopies(ctx(f, m1[f]), m2, ma) 208 checkcopies(ctx(f, m1[f]), m2, ma)
209 209
210 for f in u2: 210 for f in u2:
211 checkcopies(ctx(f, m2[f]), m1, ma) 211 checkcopies(ctx(f, m2[f]), m1, ma)
212 212
213 d2 = {} 213 diverge2 = {}
214 for of, fl in diverge.items(): 214 for of, fl in diverge.items():
215 for f in fl: 215 if len(fl) == 1:
216 fo = list(fl) 216 del diverge[of] # not actually divergent
217 fo.remove(f) 217 else:
218 d2[f] = (of, fo) 218 diverge2.update(dict.fromkeys(fl)) # reverse map for below
219 219
220 if fullcopy: 220 if fullcopy:
221 repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n")) 221 repo.ui.debug(_(" all copies found (* = to merge, ! = divergent):\n"))
222 for f in fullcopy: 222 for f in fullcopy:
223 note = "" 223 note = ""
224 if f in copy: note += "*" 224 if f in copy: note += "*"
225 if f in diverge: note += "!" 225 if f in diverge2: note += "!"
226 repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note)) 226 repo.ui.debug(_(" %s -> %s %s\n") % (f, fullcopy[f], note))
227
228 del diverge2
227 229
228 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True): 230 if not fullcopy or not repo.ui.configbool("merge", "followdirs", True):
229 return copy, diverge 231 return copy, diverge
230 232
231 repo.ui.debug(_(" checking for directory renames\n")) 233 repo.ui.debug(_(" checking for directory renames\n"))