[PATCH STABLE] test: add test for the issue introduced by e410be860393 (issue3669)

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sun Oct 21 09:56:02 CDT 2012


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1350831165 -32400
# Branch stable
# Node ID ca94ae8b7660f0bd73354834ce17144f29c63f00
# Parent  b32e55e6c3c729c1eb0658a0c3bc109259bfdae6
test: add test for the issue introduced by e410be860393 (issue3669)

e410be860393 (released as Mercurial 2.3) introduced the issue that the
revset program started with 40 hexadecimal letters caused unexpected
result at "hg log" execution.

This issue was already fixed by bde1185f406c (released as 2.3.1), but
there is no test to examine whether this issue is certainly fixed or
not: no test fails even if bde1185f406c is backed out.

This patch adds test for this issue.

Added test is confirmed to fail, when it is tested against:

  - Mercurial 2.3, or
  - Mercurial 2.3.1 or later with backing bde1185f406c out

diff -r b32e55e6c3c7 -r ca94ae8b7660 tests/test-revset.t
--- a/tests/test-revset.t	Fri Oct 19 14:47:55 2012 -0500
+++ b/tests/test-revset.t	Sun Oct 21 23:52:45 2012 +0900
@@ -825,3 +825,38 @@
   3
 
   $ cd ..
+
+issue3669: test revsets started with 40 hexadecimal letters
+
+  $ hg init issue3669
+  $ cd issue3669
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m '#0'
+  $ echo 1 >> a
+  $ hg commit -m '#1'
+
+  $ TIP=`hg tip --template '{node}'`
+  $ hg log -r "${TIP}" --template '{rev}\n'
+  1
+  $ hg log -r "${TIP}^1" --template '{rev}\n'
+  0
+  $ hg log -r "sort(${TIP}^1 or ${TIP})" --template '{rev}\n'
+  0
+  1
+  $ hg log -r "${TIP}^1 or ${TIP}" --template '{rev}\n' | sort
+  0
+  1
+  $ hg debugrevspec "${TIP}"
+  1
+  $ hg debugrevspec "${TIP}^1"
+  0
+  $ hg debugrevspec "sort(${TIP}^1 or ${TIP})"
+  0
+  1
+  $ hg debugrevspec "${TIP}^1 or ${TIP}" | sort
+  0
+  1
+
+  $ cd ..


More information about the Mercurial-devel mailing list