comparison mercurial/dirstate.py @ 24542:9fbda55c68d7

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 31 Mar 2015 16:14:14 -0500
parents e235b5dc5cf9 2bb13f2b778c
children afc29e29d569
comparison
equal deleted inserted replaced
24541:e235b5dc5cf9 24542:9fbda55c68d7
675 if nf in dmap: 675 if nf in dmap:
676 # file replaced by dir on disk but still in dirstate 676 # file replaced by dir on disk but still in dirstate
677 results[nf] = None 677 results[nf] = None
678 if matchedir: 678 if matchedir:
679 matchedir(nf) 679 matchedir(nf)
680 foundadd(nf) 680 foundadd((nf, ff))
681 elif kind == regkind or kind == lnkkind: 681 elif kind == regkind or kind == lnkkind:
682 results[nf] = st 682 results[nf] = st
683 else: 683 else:
684 badfn(ff, badtype(kind)) 684 badfn(ff, badtype(kind))
685 if nf in dmap: 685 if nf in dmap:
751 751
752 # step 1: find all explicit files 752 # step 1: find all explicit files
753 results, work, dirsnotfound = self._walkexplicit(match, subrepos) 753 results, work, dirsnotfound = self._walkexplicit(match, subrepos)
754 754
755 skipstep3 = skipstep3 and not (work or dirsnotfound) 755 skipstep3 = skipstep3 and not (work or dirsnotfound)
756 work = [d for d in work if not dirignore(d)] 756 work = [d for d in work if not dirignore(d[0])]
757 wadd = work.append 757 wadd = work.append
758 758
759 # step 2: visit subdirectories 759 # step 2: visit subdirectories
760 while work: 760 while work:
761 nd = work.pop() 761 nd, d = work.pop()
762 skip = None 762 skip = None
763 if nd == '.': 763 if nd == '.':
764 nd = '' 764 nd = ''
765 d = ''
765 else: 766 else:
766 skip = '.hg' 767 skip = '.hg'
767 try: 768 try:
768 entries = listdir(join(nd), stat=True, skip=skip) 769 entries = listdir(join(nd), stat=True, skip=skip)
769 except OSError, inst: 770 except OSError, inst:
774 for f, kind, st in entries: 775 for f, kind, st in entries:
775 if normalizefile: 776 if normalizefile:
776 # even though f might be a directory, we're only interested 777 # even though f might be a directory, we're only interested
777 # in comparing it to files currently in the dmap -- 778 # in comparing it to files currently in the dmap --
778 # therefore normalizefile is enough 779 # therefore normalizefile is enough
780 f = d and (d + "/" + f) or f
779 nf = normalizefile(nd and (nd + "/" + f) or f, True, True) 781 nf = normalizefile(nd and (nd + "/" + f) or f, True, True)
780 else: 782 else:
781 nf = nd and (nd + "/" + f) or f 783 nf = nd and (nd + "/" + f) or f
784 f = nf
782 if nf not in results: 785 if nf not in results:
783 if kind == dirkind: 786 if kind == dirkind:
784 if not ignore(nf): 787 if not ignore(nf):
785 if matchtdir: 788 if matchtdir:
786 matchtdir(nf) 789 matchtdir(nf)
787 wadd(nf) 790 wadd((nf, f))
788 if nf in dmap and (matchalways or matchfn(nf)): 791 if nf in dmap and (matchalways or matchfn(nf)):
789 results[nf] = None 792 results[nf] = None
790 elif kind == regkind or kind == lnkkind: 793 elif kind == regkind or kind == lnkkind:
791 if nf in dmap: 794 if nf in dmap:
792 if matchalways or matchfn(nf): 795 if matchalways or matchfn(nf):
793 results[nf] = st 796 results[nf] = st
794 elif (matchalways or matchfn(nf)) and not ignore(nf): 797 elif (matchalways or matchfn(f)) and not ignore(nf):
795 results[nf] = st 798 results[nf] = st
796 elif nf in dmap and (matchalways or matchfn(nf)): 799 elif nf in dmap and (matchalways or matchfn(nf)):
797 results[nf] = None 800 results[nf] = None
798 801
799 for s in subrepos: 802 for s in subrepos: