Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
19f4022b
Commit
19f4022b
authored
Jul 18, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache subproject path
This becomes expensive when using weblate:// links.
parent
9b040574
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
trans/models/subproject.py
trans/models/subproject.py
+10
-3
No files found.
trans/models/subproject.py
View file @
19f4022b
...
...
@@ -236,6 +236,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
self
.
_file_format
=
None
self
.
_template_store
=
None
self
.
_percents
=
None
self
.
_dir_path
=
None
def
has_acl
(
self
,
user
):
'''
...
...
@@ -288,11 +289,17 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
def
get_path
(
self
):
'''
Returns full path to subproject git repository.
Caching is really necessary for linked project, otherwise
we end up fetching linked subproject again and again.
'''
if
self
.
is_repo_link
():
return
self
.
linked_subproject
.
get_path
()
if
self
.
_dir_path
is
None
:
if
self
.
is_repo_link
():
self
.
_dir_path
=
self
.
linked_subproject
.
get_path
()
else
:
self
.
_dir_path
=
os
.
path
.
join
(
self
.
project
.
get_path
(),
self
.
slug
)
return
os
.
path
.
join
(
self
.
project
.
get_path
(),
self
.
slug
)
return
self
.
_dir_path
def
get_git_lock_path
(
self
):
'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment