Patchwork [2,of,2] tests: replace parents with log revset RFC

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 23, 2015, 7:57 p.m.
Message ID <829cb9e4e735b1ab2dfb.1450900628@waste.org>
Download mbox | patch
Permalink /patch/12308/
State Changes Requested
Delegated to: Yuya Nishihara
Headers show

Comments

timeless@mozdev.org - Dec. 23, 2015, 7:57 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450889771 0
#      Wed Dec 23 16:56:11 2015 +0000
# Node ID 829cb9e4e735b1ab2dfb3de5812d669c74b12c38
# Parent  362b7b756dbc8e6e3fc7dfbcc8f0e7cc2fcc6955
tests: replace parents with log revset RFC

Since `hg parents` is deprecated, we should avoid using it
in general testing.

This changeset does a complete replacement of `hg parent(s)`
outside of test-parents.t, according to the documentation
from `hg help parents`.

Note that in many cases there is no p2() necessary for the test,
it would be reasonable for those tests to be "optimized" to not
include p2(), but that's left as an exercise for a later date.
Yuya Nishihara - Dec. 30, 2015, 4:57 a.m.
On Wed, 23 Dec 2015 13:57:08 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450889771 0
> #      Wed Dec 23 16:56:11 2015 +0000
> # Node ID 829cb9e4e735b1ab2dfb3de5812d669c74b12c38
> # Parent  362b7b756dbc8e6e3fc7dfbcc8f0e7cc2fcc6955
> tests: replace parents with log revset RFC
> 
> Since `hg parents` is deprecated, we should avoid using it
> in general testing.
> 
> This changeset does a complete replacement of `hg parent(s)`
> outside of test-parents.t, according to the documentation
> from `hg help parents`.
> 
> Note that in many cases there is no p2() necessary for the test,
> it would be reasonable for those tests to be "optimized" to not
> include p2(), but that's left as an exercise for a later date.

I agree we should use "hg log" instead of "hg parents", but bulk-replacing
them would make tests less readable. I guess most of them just want
"parents()". And "max(::p1() and file()) + max(::p2() and file())" seems
obfuscated.
Matt Mackall - Jan. 8, 2016, 5:39 p.m.
On Wed, 2015-12-23 at 13:57 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450889771 0
> #      Wed Dec 23 16:56:11 2015 +0000
> # Node ID 829cb9e4e735b1ab2dfb3de5812d669c74b12c38
> # Parent  362b7b756dbc8e6e3fc7dfbcc8f0e7cc2fcc6955
> tests: replace parents with log revset RFC
> 
> Since `hg parents` is deprecated, we should avoid using it
> in general testing.

Mercurial's deprecated is not the rest of the world's deprecated. We'll always
have a parents command, there's no point removing it from the tests.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/tests/test-1993.t b/tests/test-1993.t
--- a/tests/test-1993.t
+++ b/tests/test-1993.t
@@ -28,7 +28,7 @@ 
   
   $ hg update 'tag(default)'
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:f7b1eb17ad24
   tag:         default
   user:        test
@@ -37,7 +37,7 @@ 
   
   $ hg update 'branch(default)'
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   2:30a83d1e4a1e
   tag:         tip
   user:        test
diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -264,7 +264,7 @@ 
 
   $ cat > $TESTTMP/checkvisibility.sh <<EOF
   > echo "==== \$1:"
-  > hg parents --template "{rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "{rev}:{node|short}\n"
   > echo "===="
   > EOF
 
diff --git a/tests/test-bisect.t b/tests/test-bisect.t
--- a/tests/test-bisect.t
+++ b/tests/test-bisect.t
@@ -517,7 +517,7 @@ 
 
 ensure that we still don't have a working dir
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
 
 
 test the same case, this time with updating
diff --git a/tests/test-bookmarks-merge.t b/tests/test-bookmarks-merge.t
--- a/tests/test-bookmarks-merge.t
+++ b/tests/test-bookmarks-merge.t
@@ -84,7 +84,7 @@ 
   $ hg merge
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   4:a0546fcfe0fb
   bookmark:    e@diverged
   user:        test
diff --git a/tests/test-branch-tag-confict.t b/tests/test-branch-tag-confict.t
--- a/tests/test-branch-tag-confict.t
+++ b/tests/test-branch-tag-confict.t
@@ -42,7 +42,7 @@ 
 
   $ hg up 'tag(branchortag)'
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:f57387372b5d
   tag:         branchortag
   user:        test
@@ -53,7 +53,7 @@ 
 
   $ hg up 'branch(branchortag)'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   2:10519b3f489a
   branch:      branchortag
   tag:         tip
diff --git a/tests/test-casecollision-merge.t b/tests/test-casecollision-merge.t
--- a/tests/test-casecollision-merge.t
+++ b/tests/test-casecollision-merge.t
@@ -146,7 +146,7 @@ 
   $ hg merge
   abort: case-folding collision between a and A
   [255]
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   4
   $ hg status -A
   C a
@@ -159,7 +159,7 @@ 
   $ hg merge
   abort: case-folding collision between a and A
   [255]
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   2
   $ hg status -A
   C A
@@ -281,7 +281,7 @@ 
 
   $ hg update 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   0
   $ hg status -A
   C a
@@ -291,7 +291,7 @@ 
 
   $ hg update --check 0
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   0
   $ hg status -A
   C a
@@ -300,7 +300,7 @@ 
 
   $ hg update --clean 2
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   2
   $ hg status -A
   C A
@@ -336,7 +336,7 @@ 
 
   $ hg update --clean
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents --template '{rev}\n'
+  $ hg log -r "p1()+p2()" --template '{rev}\n'
   1
   $ hg status -A
   C b
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -182,7 +182,7 @@ 
   $ hg ci -m "another change for branch stable"
   $ hg up ref2
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   13:e8ece76546a6
   branch:      stable
   tag:         ref2
diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -881,10 +881,10 @@ 
 Test that amend with --edit invokes editor forcibly
 ---------------------------------------------------
 
-  $ hg parents --template "{desc}\n"
+  $ hg log -r "p1()+p2()" --template "{desc}\n"
   amend as secret
   $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
-  $ hg parents --template "{desc}\n"
+  $ hg log -r "p1()+p2()" --template "{desc}\n"
   editor should be suppressed
 
   $ hg status --rev '.^1::.'
@@ -899,7 +899,7 @@ 
   HG: user: test
   HG: branch 'silliness'
   HG: added foo
-  $ hg parents --template "{desc}\n"
+  $ hg log -r "p1()+p2()" --template "{desc}\n"
   editor should be invoked
 
 Test that "diff()" in committemplate works correctly for amending
@@ -914,7 +914,7 @@ 
   >     {splitlines(diff()) % 'HG: {line}\n'}
   > EOF
 
-  $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
+  $ hg log -r "p1()+p2()" --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
   M: 
   A: foo
   R: 
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -477,7 +477,7 @@ 
   $ hg status -amr
   A added
   R removed
-  $ hg parents --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
+  $ hg log -r "p1()+p2()" --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
   M changed
   A 
   R 
@@ -546,7 +546,7 @@ 
   HG: files=added removed
   $ hg status -amr
   M changed
-  $ hg parents --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
+  $ hg log -r "p1()+p2()" --template "M {file_mods}\nA {file_adds}\nR {file_dels}\n"
   M 
   A added
   R removed
diff --git a/tests/test-convert-hg-sink.t b/tests/test-convert-hg-sink.t
--- a/tests/test-convert-hg-sink.t
+++ b/tests/test-convert-hg-sink.t
@@ -72,7 +72,7 @@ 
 dirstate should be empty:
 
   $ hg debugstate
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   $ hg up -C
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg copy bar baz
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1251,9 +1251,9 @@ 
   
   $ hg log --template "{file_mods}\n" -r 1
   
-  $ hg parents --template "{node|short}\n" -r 1
+  $ hg log -r "p1(1)+p2(1)" --template "{node|short}\n"
   2ef0ac749a14
-  $ hg parents --template "{node|short}\n" -r 1 foo
+  $ hg log -r "max(::p1(1) and file(foo)) + max(::p2(1) and file(foo))" --template "{node|short}\n"
   2ef0ac749a14
 
   $ get-with-headers.py 127.0.0.1:$HGPORT 'file/1/foo'
@@ -1377,9 +1377,9 @@ 
 
   $ hg log --template "{file_mods}\n" -r 2
   foo
-  $ hg parents --template "{node|short}\n" -r 2
+  $ hg log -r "p1(2)+p2(2)" --template "{node|short}\n"
   a4f92ed23982
-  $ hg parents --template "{node|short}\n" -r 2 foo
+  $ hg log -r "max(::p1(2) and file(foo)) + max(::p2(2) and file(foo))" --template "{node|short}\n"
   2ef0ac749a14
 
   $ get-with-headers.py 127.0.0.1:$HGPORT 'file/2/foo'
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -199,9 +199,9 @@ 
   $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
   a
   b
-  $ hg parents --template "{node|short}\n" -r tip
+  $ hg log -r "p1(tip)+p2(tip)" --template "{node|short}\n"
   0cd96de13884
-  $ hg parents --template "{node|short}\n" -r tip b
+  $ hg log -r "max(::p1(tip) and file(b)) + max(::p2(tip) and file(b))" --template "{node|short}\n"
   0cd96de13884
 
   $ get-with-headers.py localhost:$HGPORT 'diff/tip/b'
@@ -481,9 +481,9 @@ 
   $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
   a
   b
-  $ hg parents --template "{node|short}\n" -r tip
+  $ hg log -r "p1(tip)+p2(tip)" --template "{node|short}\n"
   0cd96de13884
-  $ hg parents --template "{node|short}\n" -r tip a
+  $ hg log -r "max(::p1(tip) and file(a)) + max(::p2(tip) and file(a))" --template "{node|short}\n"
   0cd96de13884
 
   $ get-with-headers.py localhost:$HGPORT 'diff/tip/a'
@@ -588,7 +588,7 @@ 
 
 comparison new file
 
-  $ hg parents --template "{rev}:{node|short}\n" -r 0
+  $ hg log -r "p1(0)+p2(0)" --template "{rev}:{node|short}\n"
   $ hg log --template "{rev}:{node|short}\n" -r 0
   0:0cd96de13884
 
@@ -717,7 +717,7 @@ 
   $ echo a >> a
   $ hg ci -mc
 
-  $ hg parents --template "{rev}:{node|short}\n" -r tip
+  $ hg log -r "p1(tip)+p2(tip)" --template "{rev}:{node|short}\n"
   1:559edbd9ed20
   $ hg log --template "{rev}:{node|short}\n" -r tip
   2:d73db4d812ff
@@ -849,7 +849,7 @@ 
   $ hg rm a
   $ hg ci -md
 
-  $ hg parents --template "{rev}:{node|short}\n" -r tip
+  $ hg log -r "p1(tip)+p2(tip)" --template "{rev}:{node|short}\n"
   2:d73db4d812ff
   $ hg log --template "{rev}:{node|short}\n" -r tip
   3:20e80271eb7a
@@ -987,9 +987,9 @@ 
   $ hg tip --template "{rev}:{node|short}\n"
   5:41d9fc4a6ae1
   $ hg diff -c tip e
-  $ hg parents --template "{rev}:{node|short}\n" -r tip
+  $ hg log -r "p1(tip)+p2(tip)" --template "{rev}:{node|short}\n"
   4:402bea3b0976
-  $ hg parents --template "{rev}:{node|short}\n" -r tip e
+  $ hg log -r "max(::p1(tip) and file(e)) + max(::p2(tip) and file(e))" --template "{rev}:{node|short}\n"
   4:402bea3b0976
 
   $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e'
diff --git a/tests/test-import-merge.t b/tests/test-import-merge.t
--- a/tests/test-import-merge.t
+++ b/tests/test-import-merge.t
@@ -2,7 +2,7 @@ 
   $ echo "mq=" >> $HGRCPATH
 
   $ tipparents() {
-  > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
+  > hg log -r "p1(tip)+p2(tip)" --template "{rev}:{node|short} {desc|firstline}\n"
   > }
 
 Test import and merge diffs
diff --git a/tests/test-import.t b/tests/test-import.t
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -459,11 +459,11 @@ 
 
   $ cat > $TESTTMP/checkvisibility.sh <<EOF
   > echo "===="
-  > hg parents --template "VISIBLE {rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "VISIBLE {rev}:{node|short}\n"
   > hg status -amr
   > # test that pending changes are hidden
   > unset HG_PENDING
-  > hg parents --template "ACTUAL  {rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "ACTUAL  {rev}:{node|short}\n"
   > hg status -amr
   > echo "===="
   > EOF
@@ -1065,7 +1065,7 @@ 
   > EOF
   $ hg import -d '0 0' a.patch
   applying a.patch
-  $ hg parents -v
+  $ hg log -r "p1()+p2()" -v
   changeset:   0:5a681217c0ad
   tag:         tip
   user:        test
@@ -1097,7 +1097,7 @@ 
   > +a
   > EOF
   > hg import -d '0 0' a.patch
-  > hg parents -v
+  > hg log -r "p1()+p2()" -v
   > cd ..
   > 
   > echo '% tricky header splitting'
diff --git a/tests/test-mq-qpush-exact.t b/tests/test-mq-qpush-exact.t
--- a/tests/test-mq-qpush-exact.t
+++ b/tests/test-mq-qpush-exact.t
@@ -47,7 +47,7 @@ 
   $ hg qpush -e
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -55,7 +55,7 @@ 
   $ hg qpush -e p0
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -64,7 +64,7 @@ 
   applying p0
   applying p1
   now at: p1
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -76,7 +76,7 @@ 
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -86,7 +86,7 @@ 
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -97,7 +97,7 @@ 
   applying p0
   applying p1
   now at: p1
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -108,7 +108,7 @@ 
   applying p0
   applying p1
   now at: p1
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -120,7 +120,7 @@ 
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -130,7 +130,7 @@ 
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   applying p0
   now at: p0
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -141,7 +141,7 @@ 
   applying p0
   applying p1
   now at: p1
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
@@ -152,7 +152,7 @@ 
   applying p0
   applying p1
   now at: p1
-  $ hg parents -qr qbase
+  $ hg log -r "p1(qbase)+p2(qbase)" -q
   1:d7fe2034f71b
   $ hg qpop -aq
   patch queue now empty
diff --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t
--- a/tests/test-mq-qpush-fail.t
+++ b/tests/test-mq-qpush-fail.t
@@ -61,7 +61,7 @@ 
   done
   abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
   [255]
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:bbd179dfa0a7
   tag:         tip
   user:        test
@@ -399,7 +399,7 @@ 
   [255]
   $ hg qtop
   p2
-  $ hg parents --template "{rev} {desc}\n"
+  $ hg log -r "p1()+p2()" --template "{rev} {desc}\n"
   2 imported patch p2
   $ hg st b
   M b
diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t
--- a/tests/test-mq-qrefresh-replace-log-message.t
+++ b/tests/test-mq-qrefresh-replace-log-message.t
@@ -204,7 +204,7 @@ 
 
   $ cat > $TESTTMP/checkvisibility.sh <<EOF
   > echo "===="
-  > hg parents --template "{rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "{rev}:{node|short}\n" 2> /dev/null
   > hg status -arm
   > echo "===="
   > EOF
diff --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t
+++ b/tests/test-mq-subrepo.t
@@ -458,9 +458,9 @@ 
   +++ b/.hgsubstate
   @@ -0,0 +1,1 @@
   +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
-  $ hg parents --template '{node}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n'
   f69e96d86e75a6d4fd88285dc9697acb23951041
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsub .hgsubstate
 
 check also whether qnew not including ".hgsubstate" explicitly causes
@@ -473,9 +473,9 @@ 
   $ hg add .hgsub
   $ rm -f .hgsubstate
   $ hg qnew -u test -d '0 0' import-at-qnew
-  $ hg parents --template '{node}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n'
   f69e96d86e75a6d4fd88285dc9697acb23951041
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsub .hgsubstate
 
 check whether qrefresh imports updated .hgsubstate correctly
@@ -486,7 +486,7 @@ 
   $ hg qpush
   applying import-at-qnew
   now at: import-at-qnew
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsub .hgsubstate
 
   $ hg qnew import-at-qrefresh
@@ -517,7 +517,7 @@ 
   @@ -1,1 +1,1 @@
   -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
   +88ac1bef5ed43b689d1d200b59886b675dec474b sub
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsubstate
 
   $ hg qrefresh -u test -d '0 0'
@@ -542,7 +542,7 @@ 
   @@ -1,1 +1,1 @@
   -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
   +88ac1bef5ed43b689d1d200b59886b675dec474b sub
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsubstate
 
   $ hg update -C tip
@@ -589,7 +589,7 @@ 
   @@ -1,1 +1,1 @@
   -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
   +88ac1bef5ed43b689d1d200b59886b675dec474b sub
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsubstate
 
 check whether qrefresh not including ".hgsubstate" explicitly causes
@@ -603,9 +603,9 @@ 
   $ echo > .hgsubstate
   $ hg add .hgsub .hgsubstate
   $ hg qrefresh -u test -d '0 0'
-  $ hg parents --template '{node}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n'
   7c48c35501aae6770ed9c2517014628615821a8e
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsub .hgsubstate
 
   $ hg qpop -a -q
@@ -616,9 +616,9 @@ 
   $ hg add .hgsub
   $ rm -f .hgsubstate
   $ hg qrefresh -u test -d '0 0'
-  $ hg parents --template '{node}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n'
   7c48c35501aae6770ed9c2517014628615821a8e
-  $ hg parents --template '{files}\n'
+  $ hg log -r "p1()+p2()" --template '{files}\n'
   .hgsub .hgsubstate
 
   $ cd ..
diff --git a/tests/test-newbranch.t b/tests/test-newbranch.t
--- a/tests/test-newbranch.t
+++ b/tests/test-newbranch.t
@@ -233,7 +233,7 @@ 
   $ hg branch
   foo
   $ hg commit -m'Merge ff into foo'
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   6:185ffbfefa30
   branch:      foo
   tag:         tip
diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t
--- a/tests/test-repair-strip.t
+++ b/tests/test-repair-strip.t
@@ -6,7 +6,7 @@ 
   $ teststrip() {
   >   hg -q up -C $1
   >   echo % before update $1, strip $2
-  >   hg parents
+  >   hg log -r "p1()+p2()"
   >   chmod -$3 $4
   >   hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
   >   echo % after update $1, strip $2
diff --git a/tests/test-rollback.t b/tests/test-rollback.t
--- a/tests/test-rollback.t
+++ b/tests/test-rollback.t
@@ -10,7 +10,7 @@ 
   crosschecking files in changesets and manifests
   checking files
   1 files, 1 changesets, 1 total revisions
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:1f0dee641bb7
   tag:         tip
   user:        test
@@ -29,7 +29,7 @@ 
   crosschecking files in changesets and manifests
   checking files
   0 files, 0 changesets, 0 total revisions
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   $ hg status
   A a
 
diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -310,7 +310,7 @@ 
   $ hg heads -q --template '{rev}\n'
   5
   4
-  $ hg parents -q --template '{rev}\n'
+  $ hg log -r "p1()+p2()" -q --template '{rev}\n'
   4
   5
   $ hg status
@@ -357,7 +357,7 @@ 
   unshelve of 'default' aborted
   $ hg heads -q
   3:2e69b451d1ea
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   3:2e69b451d1ea
   tag:         tip
   user:        test
@@ -407,7 +407,7 @@ 
 
 ensure the repo is as we hope
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   3:2e69b451d1ea
   tag:         tip
   user:        test
@@ -475,7 +475,7 @@ 
   rebasing shelved changes
   rebasing 6:2f694dd83a13 "changes to: second" (tip)
   merging a/a
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   4:33f7f61e6c5e
   $ hg shelve -l
   default         (*)* changes to: second (glob)
@@ -499,7 +499,7 @@ 
   rebasing 6:2f694dd83a13 "changes to: second" (tip)
   merging a/a
   note: rebase of 6:2f694dd83a13 created no changes to commit
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   4:33f7f61e6c5e
   $ hg shelve -l
   $ hg status
@@ -1045,10 +1045,10 @@ 
 
   $ cat > $TESTTMP/checkvisibility.sh <<EOF
   > echo "==== \$1:"
-  > hg parents --template "VISIBLE {rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "VISIBLE {rev}:{node|short}\n"
   > # test that pending changes are hidden
   > unset HG_PENDING
-  > hg parents --template "ACTUAL  {rev}:{node|short}\n"
+  > hg log -r "p1()+p2()" --template "ACTUAL  {rev}:{node|short}\n"
   > echo "===="
   > EOF
 
diff --git a/tests/test-strip.t b/tests/test-strip.t
--- a/tests/test-strip.t
+++ b/tests/test-strip.t
@@ -10,10 +10,10 @@ 
   $ teststrip() {
   >     hg up -C $1
   >     echo % before update $1, strip $2
-  >     hg parents
+  >     hg log -r "p1()+p2()"
   >     hg --traceback strip $2
   >     echo % after update $1, strip $2
-  >     hg parents
+  >     hg log -r "p1()+p2()"
   >     restore
   > }
 
@@ -191,7 +191,7 @@ 
   
   $ hg up -C 4
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   4:264128213d29
   tag:         tip
   parent:      1:ef3a871183d7
@@ -203,7 +203,7 @@ 
   $ hg --traceback strip 4
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob)
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   1:ef3a871183d7
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -258,7 +258,7 @@ 
 
 before strip of merge parent
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   2:65bd5f99a4a3
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -277,7 +277,7 @@ 
 
 after strip of merge parent
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   1:ef3a871183d7
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -625,7 +625,7 @@ 
   $ grep ' s$' .hgsubstate
   32a343883b74769118bb1d3b4b1fbf9156f4dddc s
   $ hg commit -qm 'commit with git revision including .hg/hgrc'
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   8:3473d20bddcf
   $ grep ' s$' .hgsubstate
   c4069473b459cf27fd4d7c2f50c4346b4e936599 s
@@ -636,7 +636,7 @@ 
   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
   $ cd tc
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   8:3473d20bddcf
   $ grep ' s$' .hgsubstate
   c4069473b459cf27fd4d7c2f50c4346b4e936599 s
@@ -665,7 +665,7 @@ 
   $ grep ' s$' .hgsubstate
   32a343883b74769118bb1d3b4b1fbf9156f4dddc s
   $ hg commit -qm 'commit with git revision including .hg/hgrc'
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   9:ed23f7fe024e
   $ grep ' s$' .hgsubstate
   f262643c1077219fbd3858d54e78ef050ef84fbf s
@@ -683,7 +683,7 @@ 
   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
   $ cd tc
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   9:ed23f7fe024e
   $ grep ' s$' .hgsubstate
   f262643c1077219fbd3858d54e78ef050ef84fbf s
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -43,13 +43,13 @@ 
 
 test handling .hgsubstate "added" explicitly.
 
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   7cf8cfea66e410e8e3336508dfeec07b3192de51
   .hgsub .hgsubstate
   $ hg rollback -q
   $ hg add .hgsubstate
   $ hg ci -m1
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   7cf8cfea66e410e8e3336508dfeec07b3192de51
   .hgsub .hgsubstate
 
@@ -130,14 +130,14 @@ 
 
 test handling .hgsubstate "modified" explicitly.
 
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   df30734270ae757feb35e643b7018e818e78a9aa
   .hgsubstate
   $ hg rollback -q
   $ hg status -A .hgsubstate
   M .hgsubstate
   $ hg ci -m2
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   df30734270ae757feb35e643b7018e818e78a9aa
   .hgsubstate
 
@@ -228,13 +228,13 @@ 
 
 test handling .hgsubstate "removed" explicitly.
 
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   96615c1dad2dc8e3796d7332c77ce69156f7b78e
   .hgsub .hgsubstate
   $ hg rollback -q
   $ hg remove .hgsubstate
   $ hg ci -m8
-  $ hg parents --template '{node}\n{files}\n'
+  $ hg log -r "p1()+p2()" --template '{node}\n{files}\n'
   96615c1dad2dc8e3796d7332c77ce69156f7b78e
   .hgsub .hgsubstate
 
diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -180,7 +180,7 @@ 
   working directory now based on revision 1
   $ hg tip -q
   4:a53251cdf717
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   1:d11e3596cc1a
   $ hg status
   ? b1
@@ -884,7 +884,7 @@ 
   $ hg rollback -q
   $ rm -f abort
   $ hg update -q -C d11e3596cc1a
-  $ hg parents -T "{node|short}\n"
+  $ hg log -r "p1()+p2()" -T "{node|short}\n"
   d11e3596cc1a
   $ hg status -A
   C r1
@@ -908,7 +908,7 @@ 
   > pretxncommit.abort = !
   > EOF
 
-  $ hg parents -T "{node|short}\n"
+  $ hg log -r "p1()+p2()" -T "{node|short}\n"
   d11e3596cc1a
   $ hg status -A
   M r1
diff --git a/tests/test-up-local-change.t b/tests/test-up-local-change.t
--- a/tests/test-up-local-change.t
+++ b/tests/test-up-local-change.t
@@ -33,7 +33,7 @@ 
   $ hg -q pull ../r1
   $ hg status
   M a
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:c19d34741b0a
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -59,7 +59,7 @@ 
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   1:1e71731e6fbb
   tag:         tip
   user:        test
@@ -83,13 +83,13 @@ 
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   0 files updated, 1 files merged, 1 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:c19d34741b0a
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     1
   
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:c19d34741b0a
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -115,7 +115,7 @@ 
   launching merge tool: true *$TESTTMP/r2/a* * * (glob)
   merge tool returned: 0
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   1:1e71731e6fbb
   tag:         tip
   user:        test
@@ -165,7 +165,7 @@ 
   $ hg -q pull ../r1
   $ hg status
   M a
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   1:1e71731e6fbb
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -68,7 +68,7 @@ 
   >     test $dirtyflag = dirty && echo dirty > foo
   >     test $dirtyflag = dirtysub && echo dirty > sub/suba
   >     hg up $opt $targetrev
-  >     hg parent --template 'parent={rev}\n'
+  >     hg log -r 'p1()+p2()' --template 'parent={rev}\n'
   >     hg stat -S
   > }
 
@@ -81,7 +81,7 @@ 
   >     test $dirtyflag = dirty && echo dirty > foo
   >     test $dirtyflag = dirtysub && echo dirty > sub/suba
   >     hg up $opt
-  >     hg parent --template 'parent={rev}\n'
+  >     hg log -r 'p1()+p2()' --template 'parent={rev}\n'
   >     hg stat -S
   > }
 
diff --git a/tests/test-url-rev.t b/tests/test-url-rev.t
--- a/tests/test-url-rev.t
+++ b/tests/test-url-rev.t
@@ -175,7 +175,7 @@ 
   
 Pull should not have updated:
 
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   1:cd2a86ecc814
 
 Going back to the default branch:
@@ -183,7 +183,7 @@ 
   $ hg up -C 0
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   0:1f0dee641bb7
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -193,20 +193,20 @@ 
 
   $ hg pull -qu
 
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   0:1f0dee641bb7
 
   $ hg rollback
   repository tip rolled back to revision 1 (undo pull)
 
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   0:1f0dee641bb7
 
 Pull -u takes us back to branch foo:
 
   $ hg pull -qu
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   2:faba9097cad4
   branch:      foo
   tag:         tip
@@ -221,7 +221,7 @@ 
   $ hg up -C 0
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ hg parents -q
+  $ hg log -r "p1()+p2()" -q
   0:1f0dee641bb7
 
   $ hg heads -q
@@ -230,7 +230,7 @@ 
 
   $ hg pull -qur default default
 
-  $ hg parents
+  $ hg log -r "p1()+p2()"
   changeset:   3:4cd725637392
   tag:         tip
   parent:      0:1f0dee641bb7