commit: catch changed exec bit on files from p1 (issue4382) stable
authorMatt Mackall <mpm@selenic.com>
Sun, 21 Sep 2014 10:07:06 -0500
branchstable
changeset 22492 d5261db0011f
parent 22456 4bbcee186fc6
child 22493 abf4e98b8ff2
commit: catch changed exec bit on files from p1 (issue4382)
mercurial/localrepo.py
tests/test-changelog-exec.t
--- a/mercurial/localrepo.py	Fri Sep 12 02:29:19 2014 +0900
+++ b/mercurial/localrepo.py	Sun Sep 21 10:07:06 2014 -0500
@@ -1127,7 +1127,7 @@
         text = fctx.data()
         flog = self.file(fname)
         fparent1 = manifest1.get(fname, nullid)
-        fparent2 = fparent2o = manifest2.get(fname, nullid)
+        fparent2 = manifest2.get(fname, nullid)
 
         meta = {}
         copy = fctx.renamed()
@@ -1193,9 +1193,8 @@
         if fparent2 != nullid or flog.cmp(fparent1, text) or meta:
             changelist.append(fname)
             return flog.add(text, meta, tr, linkrev, fparent1, fparent2)
-
         # are just the flags changed during merge?
-        if fparent1 != fparent2o and manifest1.flags(fname) != fctx.flags():
+        elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():
             changelist.append(fname)
 
         return fparent1
--- a/tests/test-changelog-exec.t	Fri Sep 12 02:29:19 2014 +0900
+++ b/tests/test-changelog-exec.t	Sun Sep 21 10:07:06 2014 -0500
@@ -32,17 +32,19 @@
   $ hg merge
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
+  $ chmod +x foo
   $ hg ci -m 'merge'
 
-this should not mention bar:
+this should not mention bar but should mention foo:
 
   $ hg tip -v
-  changeset:   3:ef2fc9b4a51b
+  changeset:   3:c53d17ff3380
   tag:         tip
   parent:      2:ed1b79f46b9a
   parent:      1:d394a8db219b
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       foo
   description:
   merge