Patchwork D6408: convert: demonstrate broken {files} list in merge commits with file flags

login
register
mail settings
Submitter phabricator
Date May 17, 2019, 6:49 p.m.
Message ID <differential-rev-PHID-DREV-3nofrx52ybarhxgxftbg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/40131/
State Superseded
Headers show

Comments

phabricator - May 17, 2019, 6:49 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When there is a merge in which the flags for a file from p2 is
  non-empty, `hg convert` will incorrectly include that in the
  changeset's files list.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-convert-hg-sink.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - May 23, 2019, noon
pulkit added inline comments.

INLINE COMMENTS

> test-convert-hg-sink.t:604
> +# No files changed
> +  $ hg log -r 3 -T '{files}\n'
> +  

Shouldn't this show `b`?

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - May 23, 2019, 12:01 p.m.
pulkit added inline comments.

INLINE COMMENTS

> pulkit wrote in test-convert-hg-sink.t:604
> Shouldn't this show `b`?

Oh, I understood the merge commit other way. So this should show `a` or not? I am not sure whether we consider mod change as file change or not.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - May 23, 2019, 1:06 p.m.
martinvonz marked an inline comment as done.
martinvonz added inline comments.

INLINE COMMENTS

> pulkit wrote in test-convert-hg-sink.t:604
> Oh, I understood the merge commit other way. So this should show `a` or not? I am not sure whether we consider mod change as file change or not.

A file gets included pretty if it's different from both parents, so `a` should not be included here.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel

Patch

diff --git a/tests/test-convert-hg-sink.t b/tests/test-convert-hg-sink.t
--- a/tests/test-convert-hg-sink.t
+++ b/tests/test-convert-hg-sink.t
@@ -573,3 +573,51 @@ 
   M f
   A b-only
   R a-only
+
+Recorded {files} list does not get confused about flags on merge commits
+
+#if execbit
+  $ cd ..
+  $ hg init merge-flags-orig
+  $ cd merge-flags-orig
+  $ echo 0 > 0
+  $ hg ci -Aqm 'add 0'
+  $ echo a > a
+  $ chmod +x a
+  $ hg ci -qAm 'add executable file'
+  $ hg co -q 0
+  $ echo b > b
+  $ hg ci -qAm 'add file'
+  $ hg merge -q
+  $ hg ci -m 'merge'
+  $ hg log -G -T '{rev} {desc}\n'
+  @    3 merge
+  |\
+  | o  2 add file
+  | |
+  o |  1 add executable file
+  |/
+  o  0 add 0
+  
+
+# No files changed
+  $ hg log -r 3 -T '{files}\n'
+  
+
+  $ cd ..
+  $ hg convert merge-flags-orig merge-flags-new -q
+  $ cd merge-flags-new
+  $ hg log -G -T '{rev} {desc}\n'
+  o    3 merge
+  |\
+  | o  2 add file
+  | |
+  o |  1 add executable file
+  |/
+  o  0 add 0
+  
+BROKEN: now 'a' appears changed
+  $ hg log -r 3 -T '{files}\n'
+  a
+
+#endif