##// END OF EJS Templates
merge: check created file dirs for path conflicts only once (issue5716)...
Mark Thomas -
r35182:a92b9f8e 4.4.2 stable
parent child Browse files
Show More
@@ -915,34 +915,21 b' def checkpathconflicts(repo, wctx, mctx,'
915 915 # can't be updated to cleanly.
916 916 invalidconflicts = set()
917 917
918 # The set of directories that contain files that are being created.
919 createdfiledirs = set()
920
918 921 # The set of files deleted by all the actions.
919 922 deletedfiles = set()
920 923
921 924 for f, (m, args, msg) in actions.items():
922 925 if m in ('c', 'dc', 'm', 'cm'):
923 926 # This action may create a new local file.
927 createdfiledirs.update(util.finddirs(f))
924 928 if mf.hasdir(f):
925 929 # The file aliases a local directory. This might be ok if all
926 930 # the files in the local directory are being deleted. This
927 931 # will be checked once we know what all the deleted files are.
928 932 remoteconflicts.add(f)
929 for p in util.finddirs(f):
930 if p in mf:
931 if p in mctx:
932 # The file is in a directory which aliases both a local
933 # and a remote file. This is an internal inconsistency
934 # within the remote manifest.
935 invalidconflicts.add(p)
936 else:
937 # The file is in a directory which aliases a local file.
938 # We will need to rename the local file.
939 localconflicts.add(p)
940 if p in actions and actions[p][0] in ('c', 'dc', 'm', 'cm'):
941 # The file is in a directory which aliases a remote file.
942 # This is an internal inconsistency within the remote
943 # manifest.
944 invalidconflicts.add(p)
945
946 933 # Track the names of all deleted files.
947 934 if m == 'r':
948 935 deletedfiles.add(f)
@@ -954,6 +941,24 b' def checkpathconflicts(repo, wctx, mctx,'
954 941 f2, flags = args
955 942 deletedfiles.add(f2)
956 943
944 # Check all directories that contain created files for path conflicts.
945 for p in createdfiledirs:
946 if p in mf:
947 if p in mctx:
948 # A file is in a directory which aliases both a local
949 # and a remote file. This is an internal inconsistency
950 # within the remote manifest.
951 invalidconflicts.add(p)
952 else:
953 # A file is in a directory which aliases a local file.
954 # We will need to rename the local file.
955 localconflicts.add(p)
956 if p in actions and actions[p][0] in ('c', 'dc', 'm', 'cm'):
957 # The file is in a directory which aliases a remote file.
958 # This is an internal inconsistency within the remote
959 # manifest.
960 invalidconflicts.add(p)
961
957 962 # Rename all local conflicting files that have not been deleted.
958 963 for p in localconflicts:
959 964 if p not in deletedfiles:
General Comments 0
You need to be logged in to leave comments. Login now