mercurial/merge.py
branchstable
changeset 16478 cbf2ea2f5ca1
parent 16284 2b0a406d3043
child 16492 774e2dcd0a65
equal deleted inserted replaced
16477:70b5e25f1598 16478:cbf2ea2f5ca1
   108             raise util.Abort(_("case-folding collision between %s and %s")
   108             raise util.Abort(_("case-folding collision between %s and %s")
   109                              % (fn, folded[fold]))
   109                              % (fn, folded[fold]))
   110         folded[fold] = fn
   110         folded[fold] = fn
   111 
   111 
   112     if wctx:
   112     if wctx:
       
   113         # class to delay looking up copy mapping
       
   114         class pathcopies(object):
       
   115             @util.propertycache
       
   116             def map(self):
       
   117                 # {dst@mctx: src@wctx} copy mapping
       
   118                 return copies.pathcopies(wctx, mctx)
       
   119         pc = pathcopies()
       
   120 
   113         for fn in wctx:
   121         for fn in wctx:
   114             fold = util.normcase(fn)
   122             fold = util.normcase(fn)
   115             mfn = folded.get(fold, None)
   123             mfn = folded.get(fold, None)
   116             if mfn and (mfn != fn):
   124             if mfn and mfn != fn and pc.map.get(mfn) != fn:
   117                 raise util.Abort(_("case-folding collision between %s and %s")
   125                 raise util.Abort(_("case-folding collision between %s and %s")
   118                                  % (mfn, fn))
   126                                  % (mfn, fn))
   119 
   127 
   120 def _forgetremoved(wctx, mctx, branchmerge):
   128 def _forgetremoved(wctx, mctx, branchmerge):
   121     """
   129     """
   566 
   574 
   567         ### calculate phase
   575         ### calculate phase
   568         action = []
   576         action = []
   569         folding = not util.checkcase(repo.path)
   577         folding = not util.checkcase(repo.path)
   570         if folding:
   578         if folding:
   571             _checkcollision(p2, branchmerge and p1)
   579             # collision check is not needed for clean update
       
   580             if not branchmerge and force:
       
   581                 _checkcollision(p2, None)
       
   582             else:
       
   583                 _checkcollision(p2, wc)
   572         if not force:
   584         if not force:
   573             _checkunknown(repo, wc, p2)
   585             _checkunknown(repo, wc, p2)
   574         action += _forgetremoved(wc, p2, branchmerge)
   586         action += _forgetremoved(wc, p2, branchmerge)
   575         action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
   587         action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
   576 
   588