##// END OF EJS Templates
merge: simplify flag merging code slightly
Matt Mackall -
r8733:f8be48c6 default
parent child Browse files
Show More
@@ -136,24 +136,17 b' def manifestmerge(repo, p1, p2, pa, over'
136 action = []
136 action = []
137 copy, copied, diverge = {}, {}, {}
137 copy, copied, diverge = {}, {}, {}
138
138
139 def fmerge(f, f2=None, fa=None):
139 def fmerge(f, f2, fa):
140 """merge flags"""
140 """merge flags"""
141 if not f2:
142 f2 = f
143 fa = f
144 a, m, n = ma.flags(fa), m1.flags(f), m2.flags(f2)
141 a, m, n = ma.flags(fa), m1.flags(f), m2.flags(f2)
145 if m == n: # flags agree
142 if m == n: # flags agree
146 return m # unchanged
143 return m # unchanged
147 if m and n: # flags are set but don't agree
144 if m and n and not a: # flags set, don't agree, differ from parent
148 if not a: # both differ from parent
149 r = repo.ui.prompt(
145 r = repo.ui.prompt(
150 _(" conflicting flags for %s\n"
146 _(" conflicting flags for %s\n"
151 "(n)one, e(x)ec or sym(l)ink?") % f,
147 "(n)one, e(x)ec or sym(l)ink?") % f,
152 (_("&None"), _("E&xec"), _("Sym&link")), _("n"))
148 (_("&None"), _("E&xec"), _("Sym&link")), _("n"))
153 return r != _("n") and r or ''
149 return r != _("n") and r or ''
154 if m == a:
155 return n # changed from m to n
156 return m # changed from n to m
157 if m and m != a: # changed from a to m
150 if m and m != a: # changed from a to m
158 return m
151 return m
159 if n and n != a: # changed from a to n
152 if n and n != a: # changed from a to n
@@ -180,7 +173,7 b' def manifestmerge(repo, p1, p2, pa, over'
180 if overwrite or backwards:
173 if overwrite or backwards:
181 rflags = m2.flags(f)
174 rflags = m2.flags(f)
182 else:
175 else:
183 rflags = fmerge(f)
176 rflags = fmerge(f, f, f)
184 # are files different?
177 # are files different?
185 if n != m2[f]:
178 if n != m2[f]:
186 a = ma.get(f, nullid)
179 a = ma.get(f, nullid)
General Comments 0
You need to be logged in to leave comments. Login now