D10035: test-copies: don't use empty file for "same content" cases
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Mon Feb 22 14:33:44 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
For main case (using filelog or sidedata), this lead to the following hash
change.
Changesets:
- 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 â 319179230cc87769ab3a861ebffe7a534ebb3d85
- 01c2f5eabdc4 â 319179230cc8
- c72365ee036fca4fb27fd745459bfb6ea1ac6993 â 6cbc9c2b7b391dd738603173717c601648d3735f
- c72365ee036f â 6cbc9c2b7b39
File revision for `f`:
- 0dd616bc7ab1a111921d95d76f69cda5c2ac539c â cedeacc5bf5d9b9be4d7f8394d33a5349bb29c6e
- 0dd616bc7ab1 â cedeacc5bf5d
- eb806e34ef6be4c264effd5933d31004ad15a793 â ffb76cd765422a18759a335d8a81fa2bd455be6b
- eb806e34ef6b â ffb76cd76542
- 6da5a2eecb9c833f830b67a4972366d49a9a142c â 08d1ff5926fbd0285cdeb044cbe8ab651687e86a
- 6da5a2eecb9c â 08d1ff5926fb
File revision for `d`:
- 7bded9d9da1f7bf9bf7cbfb24fe1e6ccf68ec440 â ba177bbb45ea930ee48469a55d40224537bd57a9
For the "extra in changeset" case we get the following change for file `d`:
- 68d5bca9df0577b6bc2ea30ca724e13ead60da81 â b894de5c94aadcb4894ea7c358389819c27fbcce
- 68d5bca9df05 â b894de5c94aa
- b80de5d138758541c5f05265ad144ab9fa86d1db â 56647659eff080e06e45c18ea9e848836dadea71
- b80de5d13875 â 56647659eff0
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10035
AFFECTED FILES
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
@@ -45,12 +45,23 @@
#endif
+ $ cat > same-content.txt << EOF
+ > Here is some content that will be the same accros multiple file.
+ >
+ > This is done on purpose so that we end up in some merge situation, were the
+ > resulting content is the same as in the parent(s), but a new needs still
+ > need to be created to record some file history information (especially
+ > about copies).
+ > EOF
+
$ hg init repo-chain
$ cd repo-chain
Add some linear rename initialy
- $ touch a b h
+ $ cp ../same-content.txt a
+ $ cp ../same-content.txt b
+ $ cp ../same-content.txt h
$ hg ci -Am 'i-0 initial commit: a b h'
adding a
adding b
@@ -348,10 +359,10 @@
$ hg commit -m "f-2: rename i -> d"
$ hg debugindex d
rev linkrev nodeid p1 p2
- 0 2 01c2f5eabdc4 000000000000 000000000000 (no-changeset !)
- 0 2 b80de5d13875 000000000000 000000000000 (changeset !)
+ 0 2 319179230cc8 000000000000 000000000000 (no-changeset !)
+ 0 2 56647659eff0 000000000000 000000000000 (changeset !)
1 8 b004912a8510 000000000000 000000000000
- 2 22 c72365ee036f 000000000000 000000000000 (no-changeset !)
+ 2 22 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
$ hg up 'desc("b-1")'
3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
@@ -1124,15 +1135,15 @@
$ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
b004912a8510032a0350a74daa2803dadfb00e12 644 d
$ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
- 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d (no-changeset !)
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 d (changeset !)
+ 319179230cc87769ab3a861ebffe7a534ebb3d85 644 d (no-changeset !)
+ 56647659eff080e06e45c18ea9e848836dadea71 644 d (changeset !)
$ hg debugindex d | head -n 4
rev linkrev nodeid p1 p2
- 0 2 01c2f5eabdc4 000000000000 000000000000 (no-changeset !)
- 0 2 b80de5d13875 000000000000 000000000000 (changeset !)
+ 0 2 319179230cc8 000000000000 000000000000 (no-changeset !)
+ 0 2 56647659eff0 000000000000 000000000000 (changeset !)
1 8 b004912a8510 000000000000 000000000000
- 2 22 c72365ee036f 000000000000 000000000000 (no-changeset !)
- 2 25 68d5bca9df05 b80de5d13875 000000000000 (changeset !)
+ 2 22 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
+ 2 25 b894de5c94aa 56647659eff0 000000000000 (changeset !)
Log output should not include a merge commit as it did not happen
@@ -1183,30 +1194,30 @@
#if no-changeset
$ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
- eb806e34ef6be4c264effd5933d31004ad15a793 644 f
+ ffb76cd765422a18759a335d8a81fa2bd455be6b 644 f
$ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
- eb806e34ef6be4c264effd5933d31004ad15a793 644 f
+ ffb76cd765422a18759a335d8a81fa2bd455be6b 644 f
$ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
- 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f
+ cedeacc5bf5d9b9be4d7f8394d33a5349bb29c6e 644 f
$ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
- 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f
+ 08d1ff5926fbd0285cdeb044cbe8ab651687e86a 644 f
$ hg debugindex f
rev linkrev nodeid p1 p2
- 0 4 0dd616bc7ab1 000000000000 000000000000
- 1 10 6da5a2eecb9c 000000000000 000000000000
- 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
+ 0 4 cedeacc5bf5d 000000000000 000000000000
+ 1 10 08d1ff5926fb 000000000000 000000000000
+ 2 19 ffb76cd76542 cedeacc5bf5d 08d1ff5926fb
#else
$ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 f
+ 56647659eff080e06e45c18ea9e848836dadea71 644 f
$ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 f
+ 56647659eff080e06e45c18ea9e848836dadea71 644 f
$ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 f
+ 56647659eff080e06e45c18ea9e848836dadea71 644 f
$ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 f
+ 56647659eff080e06e45c18ea9e848836dadea71 644 f
$ hg debugindex f
rev linkrev nodeid p1 p2
- 0 4 b80de5d13875 000000000000 000000000000
+ 0 4 56647659eff0 000000000000 000000000000
#endif
# Here the filelog based implementation is not looking at the rename
@@ -1509,15 +1520,15 @@
Details on this hash ordering pick:
$ hg manifest --debug 'desc("g-1")' | egrep 'd$'
- 7bded9d9da1f7bf9bf7cbfb24fe1e6ccf68ec440 644 d (no-changeset !)
- 68d5bca9df0577b6bc2ea30ca724e13ead60da81 644 d (changeset !)
+ ba177bbb45ea930ee48469a55d40224537bd57a9 644 d (no-changeset !)
+ b894de5c94aadcb4894ea7c358389819c27fbcce 644 d (changeset !)
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
A d
a (no-changeset no-compatibility !)
$ hg manifest --debug 'desc("f-2")' | egrep 'd$'
- c72365ee036fca4fb27fd745459bfb6ea1ac6993 644 d (no-changeset !)
- b80de5d138758541c5f05265ad144ab9fa86d1db 644 d (changeset !)
+ 6cbc9c2b7b391dd738603173717c601648d3735f 644 d (no-changeset !)
+ 56647659eff080e06e45c18ea9e848836dadea71 644 d (changeset !)
$ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
A d
h (no-changeset no-compatibility !)
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list