##// END OF EJS Templates
merge: add _checkunknowndirs function for detecting path conflicts...
Mark Thomas -
r34551:53e4bcab default
parent child Browse files
Show More
@@ -641,6 +641,34 b' def _checkunknownfile(repo, wctx, mctx, '
641 and repo.dirstate.normalize(f) not in repo.dirstate
641 and repo.dirstate.normalize(f) not in repo.dirstate
642 and mctx[f2].cmp(wctx[f]))
642 and mctx[f2].cmp(wctx[f]))
643
643
644 def _checkunknowndirs(repo, f):
645 """
646 Look for any unknown files or directories that may have a path conflict
647 with a file. If any path prefix of the file exists as a file or link,
648 then it conflicts. If the file itself is a directory that contains any
649 file that is not tracked, then it conflicts.
650
651 Returns the shortest path at which a conflict occurs, or None if there is
652 no conflict.
653 """
654
655 # Check for path prefixes that exist as unknown files.
656 for p in reversed(list(util.finddirs(f))):
657 if (repo.wvfs.audit.check(p)
658 and repo.wvfs.isfileorlink(p)
659 and repo.dirstate.normalize(p) not in repo.dirstate):
660 return p
661
662 # Check if the file conflicts with a directory containing unknown files.
663 if repo.wvfs.audit.check(f) and repo.wvfs.isdir(f):
664 # Does the directory contain any files that are not in the dirstate?
665 for p, dirs, files in repo.wvfs.walk(f):
666 for fn in files:
667 relf = repo.dirstate.normalize(repo.wvfs.reljoin(p, fn))
668 if relf not in repo.dirstate:
669 return f
670 return None
671
644 def _checkunknownfiles(repo, wctx, mctx, force, actions, mergeforce):
672 def _checkunknownfiles(repo, wctx, mctx, force, actions, mergeforce):
645 """
673 """
646 Considers any actions that care about the presence of conflicting unknown
674 Considers any actions that care about the presence of conflicting unknown
General Comments 0
You need to be logged in to leave comments. Login now