Skip to content
Snippets Groups Projects
  • Mitchell Kember's avatar
    879029f03324
    rust-config: add username parsing · 879029f03324
    Mitchell Kember authored
    This adds Config::username which returns HGUSER, ui.username, or EMAIL in that
    order, similar to ui.username() in Python.
    
    I considered following the pattern of EDITOR, VISUAL, PAGER, etc. and using
    add_for_environment_variable, but it's not possible to get the same precendence
    as in Python that way (in particular HGUSER coming after the repo .hg/hgrc), at
    least not without significant changes.
    
    This will be used for 'rhg annotate -r wdir() -u' to annotate the username on
    lines that were changed in the working directory.
    879029f03324
    History
    rust-config: add username parsing
    Mitchell Kember authored
    This adds Config::username which returns HGUSER, ui.username, or EMAIL in that
    order, similar to ui.username() in Python.
    
    I considered following the pattern of EDITOR, VISUAL, PAGER, etc. and using
    add_for_environment_variable, but it's not possible to get the same precendence
    as in Python that way (in particular HGUSER coming after the repo .hg/hgrc), at
    least not without significant changes.
    
    This will be used for 'rhg annotate -r wdir() -u' to annotate the username on
    lines that were changed in the working directory.