test-obsolete: use 'log -T {node}' instead of 'id --debug -i' to lookup hash
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 28 Feb 2015 01:12:54 -0500
changeset 24162 758dd85b6ad6
parent 24148 7a2194473155
child 24163 bb11081562d7
test-obsolete: use 'log -T {node}' instead of 'id --debug -i' to lookup hash I ran into a case when adding a test where there were cryptic hg command line errors. I eventually traced it back to 'hg id' printing debug messages before the hash: invalid branchheads cache (served): tip differs <hash> This method should eliminate any other output except the node.
tests/test-obsolete.t
--- a/tests/test-obsolete.t	Fri Feb 27 17:46:03 2015 -0600
+++ b/tests/test-obsolete.t	Sat Feb 28 01:12:54 2015 -0500
@@ -11,7 +11,7 @@
   >    hg ci -m "add $1"
   > }
   $ getid() {
-  >    hg id --debug --hidden -ir "desc('$1')"
+  >    hg log -T "{node}\n" --hidden -r "desc('$1')"
   > }
 
   $ cat > debugkeys.py <<EOF
@@ -621,7 +621,7 @@
 
 check filelog view
 
-  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
   200 Script output follows
 
   $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68'