Patchwork D8536: flags: also test merge with executable bit removed

login
register
mail settings
Submitter phabricator
Date May 16, 2020, 8:12 p.m.
Message ID <differential-rev-PHID-DREV-lclzfr5u6jnffpkvurn7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46323/
State Superseded
Headers show

Comments

phabricator - May 16, 2020, 8:12 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This might catch more bug in the future.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8536

AFFECTED FILES
  tests/test-merge-exec.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-merge-exec.t b/tests/test-merge-exec.t
--- a/tests/test-merge-exec.t
+++ b/tests/test-merge-exec.t
@@ -106,8 +106,6 @@ 
 Removing the flag
 -----------------
 
-setup
-
 Change on one side, executable bit on the other
 
   $ hg clone base-exec simple-merge-repo-removal
@@ -162,6 +160,9 @@ 
 Testing merging mode change with rename
 =======================================
 
+Adding the flag
+---------------
+
   $ hg clone base-repo rename-merge-repo
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -213,10 +214,71 @@ 
 
   $ cd ..
 
+Removing the flag
+-----------------
+
+  $ hg clone base-exec rename-merge-repo-removal
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd rename-merge-repo-removal
+
+make "a" non-executable on one side
+
+  $ chmod -x a
+  $ hg status
+  M a
+  $ hg ci -m "make a non-executable"
+  $ [ -x a ] && echo "executable bit not removed"
+  [1]
+  $ hg up ".^"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+make "a" renamed on the other side
+
+  $ hg mv a z
+  $ hg st --copies
+  A z
+    a
+  R a
+  $ hg ci -m "rename a to z"
+  created new head
+
+merge them (from the rename side)
+
+  $ hg merge 'desc("make a non-executable")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z
+    a
+  $ [ -x z ] && echo "executable bit not removed"
+  [1]
+
+merge them (from the chmod side)
+
+  $ hg up -C 'desc("make a non-executable")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 'desc("rename a to z")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z
+    a
+  R a
+  $ [ -x z ] && echo "executable bit not removed"
+  [1]
+
+
+  $ cd ..
+
+
 Testing merging mode change with rename + modification on both side
 ===================================================================
 
 
+Adding the flag
+---------------
+
   $ hg clone base-repo rename+mod-merge-repo
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -290,3 +352,83 @@ 
   $ [ -x z ] || echo "executable bit lost"
 
   $ cd ..
+
+Removing the flag
+-----------------
+
+  $ hg clone base-exec rename+mod-merge-repo-removal
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd rename+mod-merge-repo-removal
+
+make "a" non-executable on one side
+
+  $ chmod -x a
+  $ cat << EOF > a
+  > 1
+  > x
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > 8
+  > 9
+  > EOF
+  $ hg status
+  M a
+  $ hg ci -m "make a non-executable, and change start"
+  $ [ -x z ] && echo "executable bit not removed"
+  [1]
+  $ hg up ".^"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+make "a" renamed on the other side
+
+  $ hg mv a z
+  $ hg st --copies
+  A z
+    a
+  R a
+  $ cat << EOF > z
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > x
+  > 9
+  > EOF
+  $ hg ci -m "rename a to z, and change end"
+  created new head
+
+merge them (from the rename side)
+
+  $ hg merge 'desc("make a non-executable")'
+  merging z and a to z
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z
+    a
+  $ [ -x z ] && echo "executable bit not removed"
+  [1]
+
+merge them (from the chmod side)
+
+  $ hg up -C 'desc("make a non-executable")'
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 'desc("rename a to z")'
+  merging a and z to z
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z
+    a
+  R a
+  $ [ -x z ] && echo "executable bit not removed"
+  [1]
+
+  $ cd ..