comparison mercurial/merge.py @ 8737:a1808b40a8fb

merge: reorder get cases for future simplification
author Matt Mackall <mpm@selenic.com>
date Mon, 08 Jun 2009 18:14:44 -0500
parents 7619b16ea880
children 8a9899a6327e
comparison
equal deleted inserted replaced
8736:7619b16ea880 8737:a1808b40a8fb
176 if f in m2: 176 if f in m2:
177 rflags = fmerge(f, f, f) 177 rflags = fmerge(f, f, f)
178 # are files different? 178 # are files different?
179 if n != m2[f]: 179 if n != m2[f]:
180 a = ma.get(f, nullid) 180 a = ma.get(f, nullid)
181 # are we clobbering?
182 if overwrite:
183 act("clobbering", "g", f, rflags)
184 # or are we going back in time and clean?
185 elif backwards:
186 if not n[20:] or not p2[f].cmp(p1[f].data()):
187 act("reverting", "g", f, rflags)
188 # are both different from the ancestor? 181 # are both different from the ancestor?
189 elif n != a and m2[f] != a: 182 if n != a and m2[f] != a:
190 act("versions differ", "m", f, f, f, rflags, False) 183 act("versions differ", "m", f, f, f, rflags, False)
191 # is remote's version newer? 184 # is remote's version newer?
192 elif m2[f] != a: 185 elif m2[f] != a:
193 act("remote is newer", "g", f, rflags) 186 # are we clobbering?
187 if overwrite:
188 act("clobbering", "g", f, rflags)
189 # or are we going back in time and clean?
190 elif backwards:
191 if not n[20:] or not p2[f].cmp(p1[f].data()):
192 act("reverting", "g", f, rflags)
193 else:
194 act("remote is newer", "g", f, rflags)
194 # local is newer, not overwrite, check mode bits 195 # local is newer, not overwrite, check mode bits
195 elif m1.flags(f) != rflags: 196 elif m1.flags(f) != rflags:
196 act("update permissions", "e", f, rflags) 197 act("update permissions", "e", f, rflags)
197 # contents same, check mode bits 198 # contents same, check mode bits
198 elif m1.flags(f) != rflags: 199 elif m1.flags(f) != rflags: