changeset 48763:3984e7d4b9fd

rank: add minimal test This adds a small test checking the rank computation in the case of a merge. Differential Revision: https://phab.mercurial-scm.org/D12141
author pacien <pacien.trangirard@pacien.net>
date Fri, 28 Jan 2022 11:45:18 +0100
parents d5121df04808
children f7d7facd7b9f
files tests/test-rank.t
diffstat 1 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rank.t	Fri Jan 28 11:45:18 2022 +0100
@@ -0,0 +1,38 @@
+=============================================================
+Check that we can compute and exchange revision rank properly
+=============================================================
+
+  $ cat << EOF >> $HGRCPATH
+  > [format]
+  > exp-use-changelog-v2=enable-unstable-format-and-corrupt-my-data
+  > EOF
+
+
+Test minimal rank computation with merge
+
+  $ hg init rank-repo-minimal
+  $ cd rank-repo-minimal
+  $ touch 0
+  $ hg commit -Aqm 0
+  $ touch 1
+  $ hg commit -Aqm 1
+  $ hg update -qr 0
+  $ touch 2
+  $ hg commit -Aqm 2
+  $ hg merge -qr 1
+  $ hg commit -m 3
+  $ touch 4
+  $ hg commit -Aqm 4
+  $ hg log --graph --template '{rev} {_fast_rank}\n'
+  @  4 5
+  |
+  o    3 4
+  |\
+  | o  2 2
+  | |
+  o |  1 2
+  |/
+  o  0 1
+  
+  $ cd ..
+