Browse files

Ignore warnings when running hg commands.

hg may sometimes emit warnings that are not actually meaningful to the
command being run by post-review.  For instance, my hg will emit the
following for 'hg -q outgoing --template 'b:{branches}\nr:{rev}\n\n'
when run with python2.5:

warning: certificate for foo can't be verified (Python too old)"

This warning is not meaningful, so we just ignore it.

Reviewed at
  • Loading branch information...
1 parent 2612bfd commit fe27946ae759aad74e7616bad15e54e7e9792527 @csilvers csilvers committed with chipx86 Mar 29, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 rbtools/clients/
5 rbtools/clients/
@@ -245,7 +245,10 @@ def _get_outgoing_changesets(self, current_branch, remote):
if not pair.strip():
- branch, rev = pair.strip().split('\n')
+ # Ignore warning messages that hg might put in, such as
+ # "warning: certificate for foo can't be verified (Python too old)"
+ branch, rev = [l for l in pair.strip().split('\n')
+ if not l.startswith('warning: ')]
branch_name = branch[len('b:'):].strip()
branch_name = branch_name or 'default'

0 comments on commit fe27946

Please sign in to comment.