Patchwork D8530: flags: also test merging a rename with and exec flag change

login
register
mail settings
Submitter phabricator
Date May 16, 2020, 8:11 p.m.
Message ID <differential-rev-PHID-DREV-m4cs7tsnpky44bhofzpz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46318/
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
  This case is currently buggy and was not tested. This is probably a quite old
  regression. The next changeset fix this case. Move exec+rename related bug will
  gain a test later.
  
  To highlight the expected behavior the currently missing line are marked with (false !)
  and the bad one with (true !)
  
  note: we should probably gain explicit "test bool" for this usecases.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

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
@@ -80,3 +80,60 @@ 
 
   $ cd ..
 
+Testing merging mode change with rename
+=======================================
+
+  $ hg clone base-repo rename-merge-repo
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd rename-merge-repo
+
+make "a" executable on one side
+
+  $ chmod +x a
+  $ hg status
+  M a
+  $ hg ci -m "make a executable"
+  $ [ -x a ] || echo "executable bit not recorded"
+  $ 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 executable")'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved (false !)
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved (true !)
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z (false !)
+    a (false !)
+  $ [ -x z ] || echo "executable bit lost"
+  executable bit lost (true !)
+
+merge them (from the chmod side)
+
+  $ hg up -C 'desc("make a 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 (false !)
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved (true !)
+  (branch merge, don't forget to commit)
+  $ hg st --copies
+  M z
+    a (false !)
+  R a
+  $ [ -x z ] || echo "executable bit lost"
+  executable bit lost (true !)
+
+
+  $ cd ..