mercurial/merge.py
changeset 3018 db3f42261452
parent 2978 962b9c7df641
child 3097 fe9b13e35e46
equal deleted inserted replaced
3017:47aad3489da8 3018:db3f42261452
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 from node import *
     8 from node import *
     9 from i18n import gettext as _
     9 from i18n import gettext as _
    10 from demandload import *
    10 from demandload import *
    11 demandload(globals(), "util os tempfile")
    11 demandload(globals(), "errno util os tempfile")
    12 
    12 
    13 def fmerge(f, local, other, ancestor):
    13 def fmerge(f, local, other, ancestor):
    14     """merge executable flags"""
    14     """merge executable flags"""
    15     a, b, c = ancestor.execf(f), local.execf(f), other.execf(f)
    15     a, b, c = ancestor.execf(f), local.execf(f), other.execf(f)
    16     return ((a^b) | (a^c)) ^ a
    16     return ((a^b) | (a^c)) ^ a
   166             if not queued and m1.execf(f) != m2.execf(f):
   166             if not queued and m1.execf(f) != m2.execf(f):
   167                 if overwrite:
   167                 if overwrite:
   168                     repo.ui.debug(_(" updating permissions for %s\n") % f)
   168                     repo.ui.debug(_(" updating permissions for %s\n") % f)
   169                     util.set_exec(repo.wjoin(f), m2.execf(f))
   169                     util.set_exec(repo.wjoin(f), m2.execf(f))
   170                 else:
   170                 else:
   171                     if fmerge(f, m1, m2, ma) != m1.execf(f):
   171                     mode = fmerge(f, m1, m2, ma)
       
   172                     if mode != m1.execf(f):
   172                         repo.ui.debug(_(" updating permissions for %s\n")
   173                         repo.ui.debug(_(" updating permissions for %s\n")
   173                                       % f)
   174                                       % f)
   174                         util.set_exec(repo.wjoin(f), mode)
   175                         util.set_exec(repo.wjoin(f), mode)
   175             del m2[f]
   176             del m2[f]
   176         elif f in ma:
   177         elif f in ma: