Patchwork [3,of,9,V3] tests: add few debugrevlogindex and a log call to see changes in next test

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 28, 2020, 6:29 a.m.
Message ID <028e2b97c7ae12a43236.1601274555@workspace>
Download mbox | patch
Permalink /patch/47301/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 28, 2020, 6:29 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1599121486 -19800
#      Thu Sep 03 13:54:46 2020 +0530
# Node ID 028e2b97c7ae12a432364875a1fc4e9143d6f1de
# Parent  816dff4f80b66039ae155e9a593be897390813e0
# EXP-Topic merge-newnode-final
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

Patch

diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -534,6 +534,10 @@  Do all the merge combination (from the deleted or the update side × keeping and deleting the file
   $ 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 @@  Do all the merge combination (from the deleted or the update side × keeping and deleting the file
   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 @@  Do all the merge combination (from the deleted or the update side × keeping and deleting the file
   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 @@  Do all the merge combination (from the deleted or the update side × keeping and deleting the file
   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.