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.
--- 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'