D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute added a comment.
marmoute abandoned this revision.


  superseeded by D8392 

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers, durin42
Cc: pulkit, durin42, martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D8243#125293 , @pulkit wrote:
  
  > D8392  is an attempt to fix the same 
issue by storing extra information in mergestate.
  
  The approach (storing in the merge state) is the one I planned to implement 
before handling the task to Pulkit. so +1 on the approach.
  
  (feel free to reuse that very same diff for it.)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers, durin42
Cc: pulkit, durin42, martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  D8392  is an attempt to fix the same 
issue by storing extra information in mergestate.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers, durin42
Cc: pulkit, durin42, martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-01 Thread durin42 (Augie Fackler)
This revision now requires changes to proceed.
durin42 added a comment.
durin42 requested changes to this revision.


  Per irc checkin,  we expect changes on this before review.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers, durin42
Cc: durin42, martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-19 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  In D8243#124077 , @marmoute 
wrote:
  
  > In D8243#123559 , @martinvonz 
wrote:
  >
  >> This is pretty ugly and it doesn't seem that the next patch depends on it. 
You said you'll soon clean it up anyway, so I wonder if should just wait for 
the better solution instead. It doesn't seem like this fixes a serious bug so 
we have to rush it. Thoughts?
  >
  > My initial motivation to rush the ugly way was "getting the behavior right 
to compare with the changeset centric one and being able to test performance 
improvement for the changeset centric one while having access to a specific 
repository". However, cancelling of all travel has cancelled the window to 
access that repo. I'll resubmit a cleaner versions soon.
  > since you did not commented on it, I assume the new behavior is fine by 
you, right?
  
  You mean the new behavior in this patch? Yes, I think I'm fine with it. I 
initially wasn't sure if the old behavior should be considered a bug, but I 
think you're right that it should.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-19 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D8243#123559 , @martinvonz 
wrote:
  
  > This is pretty ugly and it doesn't seem that the next patch depends on it. 
You said you'll soon clean it up anyway, so I wonder if should just wait for 
the better solution instead. It doesn't seem like this fixes a serious bug so 
we have to rush it. Thoughts?
  
  My initial motivation to rush the ugly way was "getting the behavior right to 
compare with the changeset centric one and being able to test performance 
improvement for the changeset centric one while having access to a specific 
repository". However, cancelling of all travel has cancelled the window to 
access that repo. I'll resubmit a cleaner versions soon.
  
  since you did not commented on it, I assume the new behavior is fine by you, 
right?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-12 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  This is pretty ugly and it doesn't seem that the next patch depends on it. 
You said you'll soon clean it up anyway, so I wonder if should just wait for 
the better solution instead. It doesn't seem like this fixes a serious bug so 
we have to rush it. Thoughts?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-11 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment.


  FYI, I'd like to look at this patch, but I'm busy with other things right now 
(switching back and forth between browser tabs to delay the interview feedback 
that I'm actually supposed to write), so it will take a bit longer before I'll 
find time for this one.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-11 Thread marmoute (Pierre-Yves David)
marmoute updated this revision to Diff 20755.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8243?vs=20595=20755

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-convert-hg-source.t
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -212,7 +212,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBDm-0 simple merge - one way'
   $ hg up 'desc("d-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -314,8 +314,7 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1  10 b004912a8510  
-   2  15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
+   2  22 c72365ee036f  
   $ hg up 'desc("b-1")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("f-2")'
@@ -323,7 +322,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBFm-0 simple merge - one way'
   $ hg up 'desc("f-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -537,17 +536,12 @@
 - one with change to an unrelated file
 - one deleting and recreating the change
 
-Note:
-| In this case, one of the merge wrongly record a merge while there is none.
-| This lead to bad copy tracing information to be dug up.
-
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
   M d
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
   M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
   M b
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
@@ -557,18 +551,14 @@
   M b
   M d
 
-The bugs makes recorded copy is different depending of where we started the 
merge from since
+
+The result must be the same for both merges
 
   $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644   d'
-  0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644   d
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
 
-The 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 entry is wrong, since the file was
-deleted on one side (then recreate) and untouched on the other side, no "merge"
-has happened. The resulting `d` file is the untouched version from branch `D`,
-not a merge.
-
   $ hg manifest --debug --rev 'desc("d-2")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("b-1")' | grep '644   d'
@@ -577,29 +567,16 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1  10 b004912a8510  
-   2  15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
-   4  23 863d9bc49190 01c2f5eabdc4 c72365ee036f
-   5  25 7bded9d9da1f 01c2f5eabdc4 
-   6  26 f04cac32d703 b004912a8510 7bded9d9da1f
-   7  27 d7a5eafb9322 7bded9d9da1f b004912a8510
-   8  28 2ed7a51aed47 c72365ee036f 7bded9d9da1f
-
-(This `hg log` output if wrong, since no merge actually happened).
+   2  22 c72365ee036f  
+   3  25 7bded9d9da1f 01c2f5eabdc4 
+   4  26 f04cac32d703 b004912a8510 7bded9d9da1f
+   5  27 d7a5eafb9322 7bded9d9da1f b004912a8510
+   6  28 2ed7a51aed47 c72365ee036f 7bded9d9da1f
 
   $ hg log -Gfr 'desc("mBDm-0")' d
-  o15 mBDm-0 simple merge - one way]
-  |\
-  o :  14 d-2 re-add d]
-  :/
-  o  2 i-2: c -move-> d]
+  o  14 d-2 re-add d]
   |
-  o  1 i-1: a -move-> c]
-  |
-  o  0 i-0 initial commit: a b h]
-  
-
-This `hg log` output is correct
+  ~
 
   $ hg log -Gfr 'desc("mDBm-0")' d
   o  14 d-2 re-add d]
@@ -609,7 +586,6 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
   M b
   A d
-a
   R a
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
   M b
@@ -685,8 +661,7 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
   M b
   A d
-a 

D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-06 Thread marmoute (Pierre-Yves David)
marmoute added inline comments.

INLINE COMMENTS

> martinvonz wrote in localrepo.py:2868-2874
> Is this correct when grafting (not merging), such as when rebasing? Is it 
> worth having a test case for that? Is it even possible to get here in that 
> case? Maybe when rebasing a merge commit?

I don't know, but not existing test broke. Consolidating test for the plain 
merge case already took a long time. Not having any test failure from exisitng 
rebase/graft test seemed enough to me while making progress on the correctness 
of this.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-03-06 Thread marmoute (Pierre-Yves David)
marmoute added a comment.
marmoute retitled this revision from "copies: stop recoding buggy file merge 
when new file overwrite an old one" to "copies: stop recording buggy file merge 
when new file overwrite an old one".
marmoute updated this revision to Diff 20595.


  series update after Martin feedback

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8243?vs=20550=20595

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8243/new/

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

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-convert-hg-source.t
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -212,7 +212,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBDm-0 simple merge - one way'
   $ hg up 'desc("d-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -314,8 +314,7 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1  10 b004912a8510  
-   2  15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
+   2  22 c72365ee036f  
   $ hg up 'desc("b-1")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("f-2")'
@@ -323,7 +322,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBFm-0 simple merge - one way'
   $ hg up 'desc("f-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -537,17 +536,12 @@
 - one with change to an unrelated file
 - one deleting and recreating the change
 
-Note:
-| In this case, one of the merge wrongly record a merge while there is none.
-| This lead to bad copy tracing information to be dug up.
-
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
   M d
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
   M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
   M b
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
@@ -557,18 +551,14 @@
   M b
   M d
 
-The bugs makes recorded copy is different depending of where we started the 
merge from since
+
+The result must be the same for both merges
 
   $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644   d'
-  0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644   d
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
 
-The 0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 entry is wrong, since the file was
-deleted on one side (then recreate) and untouched on the other side, no "merge"
-has happened. The resulting `d` file is the untouched version from branch `D`,
-not a merge.
-
   $ hg manifest --debug --rev 'desc("d-2")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("b-1")' | grep '644   d'
@@ -577,29 +567,16 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1  10 b004912a8510  
-   2  15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
-   4  23 863d9bc49190 01c2f5eabdc4 c72365ee036f
-   5  25 7bded9d9da1f 01c2f5eabdc4 
-   6  26 f04cac32d703 b004912a8510 7bded9d9da1f
-   7  27 d7a5eafb9322 7bded9d9da1f b004912a8510
-   8  28 2ed7a51aed47 c72365ee036f 7bded9d9da1f
-
-(This `hg log` output if wrong, since no merge actually happened).
+   2  22 c72365ee036f  
+   3  25 7bded9d9da1f 01c2f5eabdc4 
+   4  26 f04cac32d703 b004912a8510 7bded9d9da1f
+   5  27 d7a5eafb9322 7bded9d9da1f b004912a8510
+   6  28 2ed7a51aed47 c72365ee036f 7bded9d9da1f
 
   $ hg log -Gfr 'desc("mBDm-0")' d
-  o15 mBDm-0 simple merge - one way]
-  |\
-  o :  14 d-2 re-add d]
-  :/
-  o  2 i-2: c -move-> d]
+  o  14 d-2 re-add d]
   |
-  o  1 i-1: a -move-> c]
-  |
-  o  0 i-0 initial commit: a b h]
-  
-
-This `hg log` output is correct
+  ~
 
   $ hg log -Gfr 'desc("mDBm-0")' d
   o  14 d-2 re-add d]
@@ -609,7 +586,6 @@
   $ hg status