928 fullcopy: files copied on the same side (as ctx), including those that |
928 fullcopy: files copied on the same side (as ctx), including those that |
929 merge.manifestmerge() won't care about |
929 merge.manifestmerge() won't care about |
930 addedfiles: added files on the other side (compared to ctx) |
930 addedfiles: added files on the other side (compared to ctx) |
931 """ |
931 """ |
932 # generate a directory move map |
932 # generate a directory move map |
933 d = ctx.dirs() |
|
934 invalid = set() |
933 invalid = set() |
935 dirmove = {} |
934 dirmove = {} |
936 |
935 |
937 # examine each file copy for a potential directory move, which is |
936 # examine each file copy for a potential directory move, which is |
938 # when all the files in a directory are moved to a new directory |
937 # when all the files in a directory are moved to a new directory |
939 for dst, src in pycompat.iteritems(fullcopy): |
938 for dst, src in pycompat.iteritems(fullcopy): |
940 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst) |
939 dsrc, ddst = pathutil.dirname(src), pathutil.dirname(dst) |
941 if dsrc in invalid: |
940 if dsrc in invalid: |
942 # already seen to be uninteresting |
941 # already seen to be uninteresting |
943 continue |
942 continue |
944 elif dsrc in d and ddst in d: |
943 elif ctx.hasdir(dsrc) and ctx.hasdir(ddst): |
945 # directory wasn't entirely moved locally |
944 # directory wasn't entirely moved locally |
946 invalid.add(dsrc) |
945 invalid.add(dsrc) |
947 elif dsrc in dirmove and dirmove[dsrc] != ddst: |
946 elif dsrc in dirmove and dirmove[dsrc] != ddst: |
948 # files from the same directory moved to two different places |
947 # files from the same directory moved to two different places |
949 invalid.add(dsrc) |
948 invalid.add(dsrc) |