url_util: introduce a `try_path` function
That function… try a build a path, returning None on failure. This helps us to simplify various part of the existing code.
Differential Revision: https://phab.mercurial-scm.org/D10437
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: ForIndentation
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
IncludeCategories:
- Regex: '^<'
Priority: 1
- Regex: '^"'
Priority: 2