mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fix traceback in salt.fileserver.hgfs.init()
Older versions of hglib did not raise an exception when no refs were found. This commit catches the exception, fixing a traceback that prevents new remotes from ever being fetched for the first time.
This commit is contained in:
parent
3c51b3116c
commit
c83e558728
@ -253,7 +253,14 @@ def init():
|
||||
)
|
||||
continue
|
||||
|
||||
refs = repo.config(names='paths')
|
||||
try:
|
||||
refs = repo.config(names='paths')
|
||||
except hglib.error.CommandError:
|
||||
refs = None
|
||||
|
||||
# Do NOT put this if statement inside the except block above. Earlier
|
||||
# versions of hglib did not raise an exception, so we need to do it
|
||||
# this way to support both older and newer hglib.
|
||||
if not refs:
|
||||
# Write an hgrc defining the remote URI
|
||||
hgconfpath = os.path.join(rp_, '.hg', 'hgrc')
|
||||
|
Loading…
Reference in New Issue
Block a user