Patchwork D8529: flags: introduce explicit testing for merging change to exec flag

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

Comments

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

REVISION SUMMARY
  It turns out that we do not seems to test the simple case for merging exec flag
  changes. More advanced case are test (merging exec flag without a common
  ancestors, merging with a symlink, etc…) but not the basic.
  
  We are about introduce various fixes to merging flag change across renames,
  having  the most basic case tested first seems useful.
  
  note: We are only testing "adding" an exec flag here, not removing it. We
  introduce basic test on stable and will consolidate them on default.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

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
new file mode 100644
--- /dev/null
+++ b/tests/test-merge-exec.t
@@ -0,0 +1,82 @@ 
+===============================================
+Testing merge involving change to the exec flag
+===============================================
+
+#require execbit
+
+
+Initial setup
+==============
+
+
+  $ hg init base-repo
+  $ cd base-repo
+  $ cat << EOF > a
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > 8
+  > 9
+  > EOF
+  $ touch b
+  $ hg add a b
+  $ hg commit -m "initial commit"
+  $ cd ..
+
+Testing merging mode change
+===========================
+
+setup
+
+Change on one side, executable bit on the other
+
+  $ hg clone base-repo simple-merge-repo
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd simple-merge-repo
+  $ chmod +x a
+  $ hg ci -m "make a executable, no change"
+  $ [ -x a ] || echo "executable bit not recorded"
+  $ hg up ".^"
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat << EOF > a
+  > 1
+  > 2
+  > 3
+  > 4
+  > 5
+  > 6
+  > 7
+  > x
+  > 9
+  > EOF
+  $ hg commit -m "edit end of file"
+  created new head
+
+merge them (from the update side)
+
+  $ hg merge 'desc("make a executable, no change")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st
+  M a
+  $ [ -x a ] || echo "executable bit lost"
+
+merge them (from the chmod side)
+
+  $ hg up -C 'desc("make a executable, no change")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 'desc("edit end of file")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg st
+  M a
+  $ [ -x a ] || echo "executable bit lost"
+
+
+  $ cd ..
+