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

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 23, 2020, 8:18 a.m.
Message ID <ef3e8f2050103f8c9fff.1600849099@workspace>
Download mbox | patch
Permalink /patch/47250/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 23, 2020, 8:18 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1599121486 -19800
#      Thu Sep 03 13:54:46 2020 +0530
# Node ID ef3e8f2050103f8c9fff9654ee20e7b401c42fcf
# Parent  967306618158321fb9367c02fe12d1fe52aacb29
# EXP-Topic merge-newnode
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
@@ -530,6 +530,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
@@ -540,6 +544,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
@@ -552,6 +560,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
@@ -563,6 +580,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.