##// 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 update_after_clone=False, bare=False):
54 update_after_clone=False, bare=False):
55
55
56 self.path = abspath(repo_path)
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 #temporary set that to now at later we will move it to constructor
69 #temporary set that to now at later we will move it to constructor
59 baseui = None
70 baseui = None
60 if baseui is None:
71 if baseui is None:
@@ -62,19 +73,15 b' class GitRepository(BaseRepository):'
62 baseui = ui()
73 baseui = ui()
63 # patch the instance of GitRepo with an "FAKE" ui object to add
74 # patch the instance of GitRepo with an "FAKE" ui object to add
64 # compatibility layer with Mercurial
75 # compatibility layer with Mercurial
65 setattr(self._repo, 'ui', baseui)
76 setattr(repo, 'ui', baseui)
66
77 return repo
67 try:
68 self.head = self._repo.head()
69 except KeyError:
70 self.head = None
71
78
72 self._config_files = [
79 @property
73 bare and abspath(self.path, 'config') or abspath(self.path, '.git',
80 def head(self):
74 'config'),
81 try:
75 abspath(get_user_home(), '.gitconfig'),
82 return self._repo.head()
76 ]
83 except KeyError:
77 self.bare = self._repo.bare
84 return None
78
85
79 @LazyProperty
86 @LazyProperty
80 def revisions(self):
87 def revisions(self):
General Comments 0
You need to be logged in to leave comments. Login now