equal
deleted
inserted
replaced
30 encoding, |
30 encoding, |
31 error, |
31 error, |
32 filemerge, |
32 filemerge, |
33 match as matchmod, |
33 match as matchmod, |
34 obsutil, |
34 obsutil, |
|
35 pathutil, |
35 pycompat, |
36 pycompat, |
36 scmutil, |
37 scmutil, |
37 subrepoutil, |
38 subrepoutil, |
38 util, |
39 util, |
39 worker, |
40 worker, |
811 if wctx.isinmemory(): |
812 if wctx.isinmemory(): |
812 # Nothing to do in IMM for the same reason as ``_checkunknownfile``. |
813 # Nothing to do in IMM for the same reason as ``_checkunknownfile``. |
813 return False |
814 return False |
814 |
815 |
815 # Check for path prefixes that exist as unknown files. |
816 # Check for path prefixes that exist as unknown files. |
816 for p in reversed(list(util.finddirs(f))): |
817 for p in reversed(list(pathutil.finddirs(f))): |
817 if p in self._missingdircache: |
818 if p in self._missingdircache: |
818 return |
819 return |
819 if p in self._unknowndircache: |
820 if p in self._unknowndircache: |
820 continue |
821 continue |
821 if repo.wvfs.audit.check(p): |
822 if repo.wvfs.audit.check(p): |
945 for f, (m, args, msg) in pycompat.iteritems(actions): |
946 for f, (m, args, msg) in pycompat.iteritems(actions): |
946 if m == ACTION_CREATED: |
947 if m == ACTION_CREATED: |
947 backup = ( |
948 backup = ( |
948 f in fileconflicts |
949 f in fileconflicts |
949 or f in pathconflicts |
950 or f in pathconflicts |
950 or any(p in pathconflicts for p in util.finddirs(f)) |
951 or any(p in pathconflicts for p in pathutil.finddirs(f)) |
951 ) |
952 ) |
952 (flags,) = args |
953 (flags,) = args |
953 actions[f] = (ACTION_GET, (flags, backup), msg) |
954 actions[f] = (ACTION_GET, (flags, backup), msg) |
954 |
955 |
955 |
956 |
1075 Generator that yields pairs of all the files in the manifest that are found |
1076 Generator that yields pairs of all the files in the manifest that are found |
1076 inside the directories listed in dirs, and which directory they are found |
1077 inside the directories listed in dirs, and which directory they are found |
1077 in. |
1078 in. |
1078 """ |
1079 """ |
1079 for f in manifest: |
1080 for f in manifest: |
1080 for p in util.finddirs(f): |
1081 for p in pathutil.finddirs(f): |
1081 if p in dirs: |
1082 if p in dirs: |
1082 yield f, p |
1083 yield f, p |
1083 break |
1084 break |
1084 |
1085 |
1085 |
1086 |
1114 ACTION_DELETED_CHANGED, |
1115 ACTION_DELETED_CHANGED, |
1115 ACTION_MERGE, |
1116 ACTION_MERGE, |
1116 ACTION_CREATED_MERGE, |
1117 ACTION_CREATED_MERGE, |
1117 ): |
1118 ): |
1118 # This action may create a new local file. |
1119 # This action may create a new local file. |
1119 createdfiledirs.update(util.finddirs(f)) |
1120 createdfiledirs.update(pathutil.finddirs(f)) |
1120 if mf.hasdir(f): |
1121 if mf.hasdir(f): |
1121 # The file aliases a local directory. This might be ok if all |
1122 # The file aliases a local directory. This might be ok if all |
1122 # the files in the local directory are being deleted. This |
1123 # the files in the local directory are being deleted. This |
1123 # will be checked once we know what all the deleted files are. |
1124 # will be checked once we know what all the deleted files are. |
1124 remoteconflicts.add(f) |
1125 remoteconflicts.add(f) |
1708 # If a file or directory exists with the same name, back that |
1709 # If a file or directory exists with the same name, back that |
1709 # up. Otherwise, look to see if there is a file that conflicts |
1710 # up. Otherwise, look to see if there is a file that conflicts |
1710 # with a directory this file is in, and if so, back that up. |
1711 # with a directory this file is in, and if so, back that up. |
1711 conflicting = f |
1712 conflicting = f |
1712 if not repo.wvfs.lexists(f): |
1713 if not repo.wvfs.lexists(f): |
1713 for p in util.finddirs(f): |
1714 for p in pathutil.finddirs(f): |
1714 if repo.wvfs.isfileorlink(p): |
1715 if repo.wvfs.isfileorlink(p): |
1715 conflicting = p |
1716 conflicting = p |
1716 break |
1717 break |
1717 if repo.wvfs.lexists(conflicting): |
1718 if repo.wvfs.lexists(conflicting): |
1718 orig = scmutil.backuppath(ui, repo, conflicting) |
1719 orig = scmutil.backuppath(ui, repo, conflicting) |