Ignore warnings when running hg commands

Review Request #2995 — Created March 21, 2012 and submitted

Information

RBTools
master

Reviewers

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)"
b:
r:8869
---

This warning is not meaningful, so we just ignore it.
Manual testing with a version of hg that gives this warning.
Description From Last Updated

This is kind of expensive, since we're doing a pretty big operation on the list for each warning we find. …

chipx86chipx86
chipx86
  1. 
      
    1. I've commited other stuff in the middle, and I'm not sure how to use post-review when the two commits are far apart in time, so I've kinda hacked it together.  I hope it works...
  2. rbtools/clients/mercurial.py (Diff revision 1)
     
     
     
    Show all issues
    This is kind of expensive, since we're doing a pretty big operation on the list for each warning we find.
    
    Another way of doing this would be:
    
    branch, rev = [line for line in pair.strip().split('\n')
                   if not line.startswith('warning: ')]
    
    I haven't tested that, but it'd be worth trying.
    1. (The list is only 2-3 lines long, so I don't think it's *that* expensive, but you're right there's no reason not to rewrite it the way you've proposed.  Done.)
  3. 
      
CS
chipx86
  1. Ship It!
  2. 
      
CS
Review request changed
Status:
Completed
Change Summary:
Pushed to master (fe27946)