Patchwork test-obsolete: use 'log -T {node}' instead of 'id --debug -i' to lookup hash

login
register
mail settings
Submitter Matt Harbison
Date Feb. 28, 2015, 6:28 a.m.
Message ID <bc662fcdfcd2e4b91fb9.1425104913@Envy>
Download mbox | patch
Permalink /patch/7861/
State Accepted
Commit 758dd85b6ad621de82fa2028ea34f16a75599f87
Headers show

Comments

Matt Harbison - Feb. 28, 2015, 6:28 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1425103974 18000
#      Sat Feb 28 01:12:54 2015 -0500
# Node ID bc662fcdfcd2e4b91fb98b82695db9e0a4502383
# Parent  7a21944731557cd18dc5c53969318d80ec547e2d
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.
Augie Fackler - Feb. 28, 2015, 4:30 p.m.
Sure, queued, thanks.
On Feb 28, 2015, at 1:28 AM, Matt Harbison <mharbison72@gmail.com> wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1425103974 18000
> #      Sat Feb 28 01:12:54 2015 -0500
> # Node ID bc662fcdfcd2e4b91fb98b82695db9e0a4502383
> # Parent  7a21944731557cd18dc5c53969318d80ec547e2d
> 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.
> 
> diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
> --- a/tests/test-obsolete.t
> +++ b/tests/test-obsolete.t
> @@ -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'
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -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'