Mercurial > hg
comparison mercurial/context.py @ 26189:663fbc336e22
ui: change default path fallback mechanism (issue4796)
The previous paths API code always fell back to the default path. This
was wrong because if a requested path doesn't exist, that should error.
Only if no path was requested should we fall back to the default.
As part of implementing the test case for issue 4796, it was discovered
that the "repository does not exist" error message raised by
localrepository.__init__ wasn't being seen because the paths API
validates paths before localrepository.__init__ was being called.
The exception and error message from localrepository.__init__ has
been introduced to getpath(). This necessitated rewriting
expandpath() both to catch the exception and to have proper
default fallback.
This code is more complicated than I'd like. But making all tests pass
was a big chore. As more code moves to getpath(), there will likely be
opportunities to improve things a bit.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 06 Sep 2015 11:28:48 -0700 |
parents | 18541e9510c5 |
children | 3a0bb61371c5 |
comparison
equal
deleted
inserted
replaced
26188:662ea52d5dca | 26189:663fbc336e22 |
---|