changeset 277:79279550c8ff

merge: update permissions even if file contents didn't change -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 merge: update permissions even if file contents didn't change manifest hash: f24ed7970c6ca48329a7aa9c2037d96333f7172e -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCpz0PywK+sNU5EO8RArOMAJ9CImCJMdubq5HsB3KrxOt1EG7PEgCgpPWg lnVxviZhv31EHtnxujQBoqM= =qxYq -----END PGP SIGNATURE-----
author mpm@selenic.com
date Wed, 08 Jun 2005 10:46:39 -0800
parents 10e325db7347
children 777e388c06d6
files mercurial/hg.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Jun 08 10:16:33 2005 -0800
+++ b/mercurial/hg.py	Wed Jun 08 10:46:39 2005 -0800
@@ -896,6 +896,8 @@
 
         for f, n in mw.iteritems():
             if f in m2:
+                s = 0
+
                 if n != m2[f]:
                     a = ma.get(f, nullid)
                     if n != a and m2[f] != a:
@@ -906,9 +908,24 @@
                         a, b, c = mfa.get(f, 0), mfw[f], mf2[f]
                         mode = ((a^b) | (a^c)) ^ a
                         merge[f] = (m1.get(f, nullid), m2[f], mode)
+                        s = 1
                     elif m2[f] != a:
                         self.ui.debug(" remote %s is newer, get\n" % f)
                         get[f] = m2[f]
+                        s = 1
+
+                if not s and mfw[f] != mf2[f]:
+                    if force:
+                        self.ui.debug(" updating permissions for %s\n" % f)
+                        set_exec(self.wjoin(f), mf2[f])
+                    else:
+                        a, b, c = mfa.get(f, 0), mfw[f], mf2[f]
+                        mode = ((a^b) | (a^c)) ^ a
+                        print a, b, c, mode
+                        if mode != b:
+                            self.ui.debug(" updating permissions for %s\n" % f)
+                            set_exec(self.wjoin(f), mode)
+
                 del m2[f]
             elif f in ma:
                 if not force and n != ma[f]: