mercurial/merge.py
changeset 16284 2b0a406d3043
parent 16261 7b9bf72430ba
child 16478 cbf2ea2f5ca1
equal deleted inserted replaced
16279:531e69ff348f 16284:2b0a406d3043
    82         return r
    82         return r
    83 
    83 
    84 def _checkunknownfile(repo, wctx, mctx, f):
    84 def _checkunknownfile(repo, wctx, mctx, f):
    85     return (not repo.dirstate._ignore(f)
    85     return (not repo.dirstate._ignore(f)
    86         and os.path.exists(repo.wjoin(f))
    86         and os.path.exists(repo.wjoin(f))
       
    87         and repo.dirstate.normalize(f) not in repo.dirstate
    87         and mctx[f].cmp(wctx[f]))
    88         and mctx[f].cmp(wctx[f]))
    88 
    89 
    89 def _checkunknown(repo, wctx, mctx):
    90 def _checkunknown(repo, wctx, mctx):
    90     "check for collisions between unknown files and files in mctx"
    91     "check for collisions between unknown files and files in mctx"
    91 
    92 
   543                                      hint=_("use 'hg update' "
   544                                      hint=_("use 'hg update' "
   544                                             "or check 'hg heads'"))
   545                                             "or check 'hg heads'"))
   545             if not force and (wc.files() or wc.deleted()):
   546             if not force and (wc.files() or wc.deleted()):
   546                 raise util.Abort(_("outstanding uncommitted changes"),
   547                 raise util.Abort(_("outstanding uncommitted changes"),
   547                                  hint=_("use 'hg status' to list changes"))
   548                                  hint=_("use 'hg status' to list changes"))
   548             if not force:
       
   549                 _checkunknown(repo, wc, p2)
       
   550             for s in wc.substate:
   549             for s in wc.substate:
   551                 if wc.sub(s).dirty():
   550                 if wc.sub(s).dirty():
   552                     raise util.Abort(_("outstanding uncommitted changes in "
   551                     raise util.Abort(_("outstanding uncommitted changes in "
   553                                        "subrepository '%s'") % s)
   552                                        "subrepository '%s'") % s)
   554 
   553 
   568         ### calculate phase
   567         ### calculate phase
   569         action = []
   568         action = []
   570         folding = not util.checkcase(repo.path)
   569         folding = not util.checkcase(repo.path)
   571         if folding:
   570         if folding:
   572             _checkcollision(p2, branchmerge and p1)
   571             _checkcollision(p2, branchmerge and p1)
       
   572         if not force:
       
   573             _checkunknown(repo, wc, p2)
   573         action += _forgetremoved(wc, p2, branchmerge)
   574         action += _forgetremoved(wc, p2, branchmerge)
   574         action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
   575         action += manifestmerge(repo, wc, p2, pa, overwrite, partial)
   575 
   576 
   576         ### apply phase
   577         ### apply phase
   577         if not branchmerge: # just jump to the new rev
   578         if not branchmerge: # just jump to the new rev