Disable internal issue tracker if external tracker in use
### What does this MR do?
This MR disables routes to the internal issue tracker if an external issue tracker (e.g. Redmine) is in use. A 404 page is returned if a user attempts to access any of the issue routes.
### Why was this MR needed?
Enabling the external issue tracker would still keep the internal one active, which would lead to odd behavior where users could create issues but not close them.
### What are the relevant issue numbers?
Closes#2006
See merge request !993
Add ref switching support for graphs
It is now possible to view contributor and commit statistics for
refs beyond the default branch. While the Git ref already was part of
the path it has not been used before.
Additionally, the code in RefsController#switch has been slighliy
refactored since it would have become confusing with additional if-else
branches added.
See merge request !932
It is now possible to view contributor and commit statistics for
refs beyond the default branch.
Additionally, conditions in RefsController#switch have been refactored
in order that a `case` block is used now.
write_ was renamed to create_
modify_ was renamed to update_
So now in update action we have next code
def create
can?(current_user, :create_issue, @issue)
end
def update
can?(current_user, :update_issue, @issue)
end
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* store @participants in variable
* store result of subscribed? call into variable
In total it reduce amount of SQL queries for merge_request with 10
comments/participants twice.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* store @participants in variable
* store result of subscribed? call into variable
In total it reduce amount of SQL queries for issue with 10 comments/participants twice.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
MergeRequest#show performance improvements
This is a first pass on improving the performance of the `MergeRequests#show` page. Notable changes:
- The "Commits" tab is loaded lazily, so the initial page load should be much faster for MRs with many commits.
- Relative timestamps via `timeago` are only initialized once per load instead of `O(n^2)`. This greatly improves frontend rendering times for a large number of commits.
- Refactored `User.find_for_commit` to use a single ARel-generated SQL query instead of the old method which resulted in one query, and could result in up to three.
See merge request !838
* fix problem with editing non-master branch
* before commit make sure branch exists
* dont allow user change file in one branch and commit to another existing branch
* remove a lot of code duplication
* remove outdated statellite errors
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Unescape branch names in compare commit
The upgrade in GitLab v7.9 to Rails v4.1.9 caused all branch names in the compare commit mode to be escaped (e.g. `/` to `%2F`). The compare mode would not always work when comparing against branch names with a forward slash.
Opted to unescape the branch name rather than use a wildcard segment to prevent escaping slashes because it seems like a more sensible URL. The slashes in this case aren't really represented by a tree structure (e.g. /compare/one/two/branch..another/branch/here).
* Closes#1399
* Closes https://github.com/gitlabhq/gitlabhq/issues/9105
See merge request !582