From patchwork Sat May 16 20:11:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: D8529: flags: introduce explicit testing for merging change to exec flag From: phabricator X-Patchwork-Id: 46317 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 16 May 2020 20:11:32 +0000 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 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 .. +