--- a/tests/test-wireproto-command-filedata.t Mon Dec 10 16:53:09 2018 +0000
+++ b/tests/test-wireproto-command-filedata.t Mon Dec 10 17:26:12 2018 +0000
@@ -27,9 +27,26 @@
$ hg commit -m 'commit 3'
created new head
+Create multiple heads introducing the same changeset
+
+ $ hg -q up -r 0
+ $ echo foo > dupe-file
+ $ hg commit -Am 'dupe 1'
+ adding dupe-file
+ created new head
+ $ hg -q up -r 0
+ $ echo foo > dupe-file
+ $ hg commit -Am 'dupe 2'
+ adding dupe-file
+ created new head
+
$ hg log -G -T '{rev}:{node} {desc}\n'
- @ 3:5ce944d7fece1252dae06c34422b573c191b9489 commit 3
+ @ 5:732c3dd7bee94242de656000e5f458e7ccfe2828 dupe 2
|
+ | o 4:4334f10897d13c3e8beb4b636f7272b4ec2d0322 dupe 1
+ |/
+ | o 3:5ce944d7fece1252dae06c34422b573c191b9489 commit 3
+ |/
| o 2:b3c27db01410dae01e5485d425b1440078df540c commit 2
| |
| o 1:3ef5e551f219ba505481d34d6b0316b017fa3f00 commit 1
@@ -47,6 +64,10 @@
rev linkrev nodeid p1 p2
0 0 bbba6c06b30f443d34ff841bc985c4d0827c6be4 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
+ $ hg --debug debugindex dupe-file
+ rev linkrev nodeid p1 p2
+ 0 4 2ed2a3912a0b24502043eae84ee4b279c18b90dd 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
+
$ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
$ cat hg.pid > $DAEMON_PIDS
@@ -309,4 +330,35 @@
b'a0\n00000000000000000000000000000000000000\n11111111111111111111111111111111111111\na2\n'
]
+Linknode for duplicate revision is the initial revision
+
+ $ sendhttpv2peer << EOF
+ > command filedata
+ > nodes eval:[b'\x2e\xd2\xa3\x91\x2a\x0b\x24\x50\x20\x43\xea\xe8\x4e\xe4\xb2\x79\xc1\x8b\x90\xdd']
+ > path eval:b'dupe-file'
+ > fields eval:[b'linknode', b'parents', b'revision']
+ > EOF
+ creating http peer for wire protocol version 2
+ sending filedata command
+ response: gen[
+ {
+ b'totalitems': 1
+ },
+ {
+ b'fieldsfollowing': [
+ [
+ b'revision',
+ 4
+ ]
+ ],
+ b'linknode': b'C4\xf1\x08\x97\xd1<>\x8b\xebKcorr\xb4\xec-\x03"',
+ b'node': b'.\xd2\xa3\x91*\x0b$P C\xea\xe8N\xe4\xb2y\xc1\x8b\x90\xdd',
+ b'parents': [
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
+ ]
+ },
+ b'foo\n'
+ ]
+
$ cat error.log