• 
      

    Don't crash when .hgrc has lines like 'key ='

    Review Request #2993 — Created March 21, 2012 and discarded

    Information

    RBTools

    Reviewers

    It's legal for an .hgrc key to have an empty string as a value.  Don't croak if that happens.
    (Manual testing on an .hgrc file that has that property.)
    Description From Last Updated

    It'd be nice to only split once. I can see this being: 1) Split the line 2) Set the key, …

    chipx86chipx86
    chipx86
    1. Small recommendation for simplifying this. Also, would you be able to write a small unit test to cover this?
    2. rbtools/clients/mercurial.py (Diff revision 1)
       
       
       
       
       
       
      Show all issues
      It'd be nice to only split once. I can see this being:
      
      1) Split the line
      2) Set the key, and default value to ''
      3) Set the value from the split if len(parts) == 2
    3. 
        
    CS
    Review request changed
    Status:
    Discarded
    Change Summary:
    I can no longer reproduce this.  I've adeed some logging statements and the empty-string shouldn't be a problematic value:
    ['extensions.kilnauth', '/home/csilvers/khan/devtools/kilnauth/kilnauth.py\n']
    ['extensions.hgext.bookmarks', '\n']
    ['extensions.hggit', '\n']
    
    Because newlines are included, the value should always be at least a newline.  And indeed, when I revert to the old code, I don't get any errors parsing the .hgrc.  I'm not sure how to reproduce the problem I saw.  I'll reopen the bug if I can.