##// END OF EJS Templates
copies-rust: pre-indent some code to clarify the next changeset...
marmoute -
r46578:46a16b2c default
parent child Browse files
Show More
@@ -203,10 +203,12 b' fn merge_copies_dict('
203 203 for (dest, src_major) in major {
204 204 let overwrite;
205 205 if let Some(src_minor) = minor.get(&dest) {
206 {
206 207 if src_major.path == src_minor.path {
207 // we have the same value, but from other source;
208 // we have the same value, no need to battle;
208 209 if src_major.rev == src_minor.rev {
209 // If the two entry are identical, no need to do anything
210 // If the two entry are identical, no need to do
211 // anything
210 212 overwrite = false;
211 213 } else if is_ancestor(src_major.rev, src_minor.rev) {
212 214 overwrite = false;
@@ -220,26 +222,28 b' fn merge_copies_dict('
220 222 } else if src_major.path.is_none()
221 223 && changes.salvaged.contains(&dest)
222 224 {
223 // If the file is "deleted" in the major side but was salvaged
224 // by the merge, we keep the minor side alive
225 // If the file is "deleted" in the major side but was
226 // salvaged by the merge, we keep the minor side alive
225 227 overwrite = false;
226 228 } else if src_minor.path.is_none()
227 229 && changes.salvaged.contains(&dest)
228 230 {
229 // If the file is "deleted" in the minor side but was salvaged
230 // by the merge, unconditionnaly preserve the major side.
231 // If the file is "deleted" in the minor side but was
232 // salvaged by the merge, unconditionnaly preserve the
233 // major side.
231 234 overwrite = true;
232 235 } else if changes.merged.contains(&dest) {
233 // If the file was actively merged, copy information from each
234 // side might conflict. The major side will win such conflict.
236 // If the file was actively merged, copy information from
237 // each side might conflict. The major side will win such
238 // conflict.
235 239 overwrite = true;
236 240 } else if is_ancestor(src_major.rev, src_minor.rev) {
237 // If the minor side is strictly newer than the major side, it
238 // should be kept.
241 // If the minor side is strictly newer than the major side,
242 // it should be kept.
239 243 overwrite = false;
240 244 } else if src_major.path.is_some() {
241 // without any special case, the "major" value win other the
242 // "minor" one.
245 // without any special case, the "major" value win other
246 // the "minor" one.
243 247 overwrite = true;
244 248 } else if is_ancestor(src_minor.rev, src_major.rev) {
245 249 // the "major" rev is a direct ancestors of "minor", any
@@ -247,11 +251,12 b' fn merge_copies_dict('
247 251 overwrite = true;
248 252 } else {
249 253 // major version is None (so the file was deleted on that
250 // branch) annd that branch is independant (neither minor nor
251 // major is an ancestors of the other one.) We preserve the new
252 // information about the new file.
254 // branch) and that branch is independant (neither minor
255 // nor major is an ancestors of the other one.) We preserve
256 // the new information about the new file.
253 257 overwrite = false;
254 258 }
259 }
255 260 } else {
256 261 // minor had no value
257 262 overwrite = true;
General Comments 0
You need to be logged in to leave comments. Login now