changeset 45581:76b69f81629c

tests: add few debugrevlogindex and a log call to see changes in next test In upcoming patches, we will create a new filenode in couple of cases. Let's add some debugrevlogindex and a log call so that we can observe those changes better. Differential Revision: https://phab.mercurial-scm.org/D8987
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 03 Sep 2020 13:54:46 +0530
parents 76d79b80d953
children 463ca8af8c72
files tests/test-merge-criss-cross.t
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-merge-criss-cross.t	Mon Sep 14 14:40:12 2020 +0530
+++ b/tests/test-merge-criss-cross.t	Thu Sep 03 13:54:46 2020 +0530
@@ -534,6 +534,10 @@
   $ hg ci -m "merge-deleting-the-file-from-deleted"
   $ hg manifest
   other-file
+  $ hg debugrevlogindex the-file
+     rev linkrev nodeid       p1           p2
+       0       0 4b69178b9bda 000000000000 000000000000
+       1       1 59e363a07dc8 4b69178b9bda 000000000000
 
   $ hg update 'desc("updating-both-file")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -544,6 +548,10 @@
   created new head
   $ hg manifest
   other-file
+  $ hg debugrevlogindex the-file
+     rev linkrev nodeid       p1           p2
+       0       0 4b69178b9bda 000000000000 000000000000
+       1       1 59e363a07dc8 4b69178b9bda 000000000000
 
   $ hg update 'desc("delete-the-file")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -556,6 +564,15 @@
   other-file
   the-file
 
+XXX: This should create a new filenode because user explicitly decided to keep
+the file. If we reuse the same filenode, future merges (criss-cross ones mostly)
+will think that file remain unchanged and user explicit choice will not be taken
+in consideration.
+  $ hg debugrevlogindex the-file
+     rev linkrev nodeid       p1           p2
+       0       0 4b69178b9bda 000000000000 000000000000
+       1       1 59e363a07dc8 4b69178b9bda 000000000000
+
   $ hg update 'desc("updating-both-file")'
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("delete-the-file")' -t :local
@@ -567,6 +584,31 @@
   other-file
   the-file
 
+XXX: This should create a new filenode because user explicitly decided to keep
+the file. If we reuse the same filenode, future merges (criss-cross ones mostly)
+will think that file remain unchanged and user explicit choice will not be taken
+in consideration.
+  $ hg debugrevlogindex the-file
+     rev linkrev nodeid       p1           p2
+       0       0 4b69178b9bda 000000000000 000000000000
+       1       1 59e363a07dc8 4b69178b9bda 000000000000
+
+  $ hg log -G -T '{node|short} {desc}\n'
+  @    5e3eccec60d8 merge-keeping-the-file-from-updated
+  |\
+  +---o  e9b708131723 merge-keeping-the-file-from-deleted
+  | |/
+  +---o  a4e0e44229dc merge-deleting-the-file-from-updated
+  | |/
+  +---o  adfd88e5d7d3 merge-deleting-the-file-from-deleted
+  | |/
+  | o  7801bc9b9899 delete-the-file
+  | |
+  o |  9b610631ab29 updating-both-file
+  |/
+  o  955800955977 root-commit
+  
+
 There the resulting merge together (leading to criss cross situation). Check
 the conflict is properly detected.