Mercurial > kallithea
changeset 5155:d8993baa00dc
git: avoid OSError when encountering invalid lock file
This avoids crashing when repo scanning makes dulwich look at its own pip
install directory.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 27 May 2015 23:15:36 +0200 |
parents | f9a581561184 |
children | b3299a079fa6 |
files | kallithea/lib/vcs/backends/git/repository.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/lib/vcs/backends/git/repository.py Sun May 17 21:47:33 2015 +0200 +++ b/kallithea/lib/vcs/backends/git/repository.py Wed May 27 23:15:36 2015 +0200 @@ -12,6 +12,7 @@ import os import re import time +import errno import urllib import urllib2 import logging @@ -690,7 +691,13 @@ runs gits update-server-info command in this repo instance """ from dulwich.server import update_server_info - update_server_info(self._repo) + try: + update_server_info(self._repo) + except OSError, e: + if e.errno != errno.ENOENT: + raise + # Workaround for dulwich crashing on for example its own dulwich/tests/data/repos/simple_merge.git/info/refs.lock + log.error('Ignoring error running update-server-info: %s', e) @LazyProperty def workdir(self):