##// END OF EJS Templates
merge: rework iteration over mergeresult object in checkpathconflicts()...
Pulkit Goyal -
r45902:150900a1 default
parent child Browse files
Show More
@@ -414,30 +414,33 b' def checkpathconflicts(repo, wctx, mctx,'
414 414 # The set of files deleted by all the actions.
415 415 deletedfiles = set()
416 416
417 for f, (m, args, msg) in mresult.actions.items():
418 if m in (
417 for (f, args, msg) in mresult.getactions(
418 (
419 419 mergestatemod.ACTION_CREATED,
420 420 mergestatemod.ACTION_DELETED_CHANGED,
421 421 mergestatemod.ACTION_MERGE,
422 422 mergestatemod.ACTION_CREATED_MERGE,
423 ):
424 # This action may create a new local file.
425 createdfiledirs.update(pathutil.finddirs(f))
426 if mf.hasdir(f):
427 # The file aliases a local directory. This might be ok if all
428 # the files in the local directory are being deleted. This
429 # will be checked once we know what all the deleted files are.
430 remoteconflicts.add(f)
431 # Track the names of all deleted files.
432 if m == mergestatemod.ACTION_REMOVE:
433 deletedfiles.add(f)
434 if m == mergestatemod.ACTION_MERGE:
435 f1, f2, fa, move, anc = args
436 if move:
437 deletedfiles.add(f1)
438 if m == mergestatemod.ACTION_DIR_RENAME_MOVE_LOCAL:
439 f2, flags = args
440 deletedfiles.add(f2)
423 )
424 ):
425 # This action may create a new local file.
426 createdfiledirs.update(pathutil.finddirs(f))
427 if mf.hasdir(f):
428 # The file aliases a local directory. This might be ok if all
429 # the files in the local directory are being deleted. This
430 # will be checked once we know what all the deleted files are.
431 remoteconflicts.add(f)
432 # Track the names of all deleted files.
433 for (f, args, msg) in mresult.getactions((mergestatemod.ACTION_REMOVE,)):
434 deletedfiles.add(f)
435 for (f, args, msg) in mresult.getactions((mergestatemod.ACTION_MERGE,)):
436 f1, f2, fa, move, anc = args
437 if move:
438 deletedfiles.add(f1)
439 for (f, args, msg) in mresult.getactions(
440 (mergestatemod.ACTION_DIR_RENAME_MOVE_LOCAL,)
441 ):
442 f2, flags = args
443 deletedfiles.add(f2)
441 444
442 445 # Check all directories that contain created files for path conflicts.
443 446 for p in createdfiledirs:
General Comments 0
You need to be logged in to leave comments. Login now