diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | app/assets/stylesheets/print.scss | 4 | ||||
-rw-r--r-- | app/models/repository.rb | 39 | ||||
-rw-r--r-- | doc/update/patch_versions.md | 2 |
4 files changed, 44 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG index 176a3c833b7..1fe9ad59008 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ v 7.10.0 (unreleased) - Fix cross references when usernames, milestones, or project names contain underscores (Stan Hu) - enable line wrapping per default and remove the checkbox to toggle it (Hannes Rosenögger) - extend the commit calendar to show the actual commits made on a date (Hannes Rosenögger) + - Fix a link in the patch update guide - Add a service to support external wikis (Hannes Rosenögger) - List new commits for newly pushed branch in activity view. - Add changelog, license and contribution guide links to project sidebar. @@ -15,6 +16,8 @@ v 7.10.0 (unreleased) - Improve error message when save profile has error. - Passing the name of pushed ref to CI service (requires GitLab CI 7.9+) - Add location field to user profile + - Fix print view for markdown files and wiki pages + - Improve GitLab performance when working with git repositories - Add tag message and last commit to tag hook (Kamil Trzciński) v 7.9.0 (unreleased) diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index 42dbf4d6ef3..1be0551ad3b 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -11,3 +11,7 @@ header, nav, nav.main-nav, nav.navbar-collapse, nav.navbar-collapse.collapse {di .wiki h1 {font-size: 30px;} .wiki h2 {font-size: 22px;} .wiki h3 {font-size: 18px; font-weight: bold; } + +.sidebar-wrapper { display: none; } +.nav { display: none; } +.btn { display: none; } diff --git a/app/models/repository.rb b/app/models/repository.rb index c6eaa485b8a..082ad7a0c6a 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -62,24 +62,28 @@ class Repository def add_branch(branch_name, ref) cache.expire(:branch_names) + @branches = nil gitlab_shell.add_branch(path_with_namespace, branch_name, ref) end def add_tag(tag_name, ref, message = nil) cache.expire(:tag_names) + @tags = nil gitlab_shell.add_tag(path_with_namespace, tag_name, ref, message) end def rm_branch(branch_name) cache.expire(:branch_names) + @branches = nil gitlab_shell.rm_branch(path_with_namespace, branch_name) end def rm_tag(tag_name) cache.expire(:tag_names) + @tags = nil gitlab_shell.rm_tag(path_with_namespace, tag_name) end @@ -180,8 +184,17 @@ class Repository end end + def lookup_cache + @lookup_cache ||= {} + end + def method_missing(m, *args, &block) - raw_repository.send(m, *args, &block) + if m == :lookup && !block_given? + lookup_cache[m] ||= {} + lookup_cache[m][args.join(":")] ||= raw_repository.send(m, *args, &block) + else + raw_repository.send(m, *args, &block) + end end def respond_to?(method) @@ -235,12 +248,20 @@ class Repository end def head_commit - commit(self.root_ref) + @head_commit ||= commit(self.root_ref) + end + + def head_tree + @head_tree ||= Tree.new(self, head_commit.sha, nil) end def tree(sha = :head, path = nil) if sha == :head - sha = head_commit.sha + if path.nil? + return head_tree + else + sha = head_commit.sha + end end Tree.new(self, sha, path) @@ -368,6 +389,18 @@ class Repository end end + def branches + @branches ||= raw_repository.branches + end + + def tags + @tags ||= raw_repository.tags + end + + def root_ref + @root_ref ||= raw_repository.root_ref + end + private def cache diff --git a/doc/update/patch_versions.md b/doc/update/patch_versions.md index ad302492556..e29ee2a7b3d 100644 --- a/doc/update/patch_versions.md +++ b/doc/update/patch_versions.md @@ -1,5 +1,5 @@ # Universal update guide for patch versions -*Make sure you view this [upgrade guide from the `master` branch](../../../master/doc/update/patch_versions.md) for the most up to date instructions.* +*Make sure you view this [upgrade guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/patch_versions.md) from the `master` branch for the most up to date instructions.* For example from 6.2.0 to 6.2.1, also see the [semantic versioning specification](http://semver.org/). |