Fix rbt patch when applying patches from users with private profiles.

Review Request #10314 — Created Nov. 8, 2018 and submitted

david
RBTools
release-1.0.x
6e6f9f6...
rbtools

If a user has marked their profile private, their full name and e-mail
address will be stripped from the API payloads. This would cause
rbt patch -c/-C to fail with an AttributeError when attempting to
create the commit.

This change fixes it so we create the commit as the running user.

Applied a patch from a user who had marked their profile private.

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
chipx86
  1. 
      
  2. This works but I feel there's room for improvement (maybe going forward, rather than right now).

    Mainly:

    1. There's duplicate logic here, that's going to eventually become inconsistent as it gets duplicated further. It'd be really nice to have some centralized logic (maybe a utility method that can be called to figure all this out).
    2. It'd be nice to also warn when we can't commit as the user, so it's not a surprise when they're not credited as the author in the commit. A centralized method can help with this.
    1. I think I'd rather do that later. Right now there's no good place to put this, and the actual duplication is quite small. I will add logging.

  3. rbtools/clients/git.py (Diff revision 1)
     
     
     

    This can be one statement.

  4. rbtools/clients/mercurial.py (Diff revision 1)
     
     
     

    This can be one statement.

  5. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-1.0.x (e8738b5)
Loading...