##// END OF EJS Templates
Don't cache dulwich Repos, in pararell multithreaded evniroment dulwich pack file openers...
marcink -
r3043:b61824e6 beta
parent child Browse files
Show More
@@ -54,7 +54,18 b' class GitRepository(BaseRepository):'
54 54 update_after_clone=False, bare=False):
55 55
56 56 self.path = abspath(repo_path)
57 self._repo = self._get_repo(create, src_url, update_after_clone, bare)
57 repo = self._get_repo(create, src_url, update_after_clone, bare)
58 self.bare = repo.bare
59
60 self._config_files = [
61 bare and abspath(self.path, 'config') or abspath(self.path, '.git',
62 'config'),
63 abspath(get_user_home(), '.gitconfig'),
64 ]
65
66 @property
67 def _repo(self):
68 repo = Repo(self.path)
58 69 #temporary set that to now at later we will move it to constructor
59 70 baseui = None
60 71 if baseui is None:
@@ -62,19 +73,15 b' class GitRepository(BaseRepository):'
62 73 baseui = ui()
63 74 # patch the instance of GitRepo with an "FAKE" ui object to add
64 75 # compatibility layer with Mercurial
65 setattr(self._repo, 'ui', baseui)
66
67 try:
68 self.head = self._repo.head()
69 except KeyError:
70 self.head = None
76 setattr(repo, 'ui', baseui)
77 return repo
71 78
72 self._config_files = [
73 bare and abspath(self.path, 'config') or abspath(self.path, '.git',
74 'config'),
75 abspath(get_user_home(), '.gitconfig'),
76 ]
77 self.bare = self._repo.bare
79 @property
80 def head(self):
81 try:
82 return self._repo.head()
83 except KeyError:
84 return None
78 85
79 86 @LazyProperty
80 87 def revisions(self):
General Comments 0
You need to be logged in to leave comments. Login now