Fix Error 500 when searching Wiki pages
If a Wiki page turns up a hit in the search results, an error will occur:
```
Completed 500 Internal Server Error in 836ms
NoMethodError - undefined method `slug' for "test.markdown":String:
app/helpers/wiki_helper.rb:10:in `namespace_project_wiki_path'
app/views/search/results/_wiki_blob.html.haml:4:in `_app_views_search_results__wiki_blob_html_haml___2752621660395393333_70299911622700'
actionview (4.1.9) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.9) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.9) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.9) lib/action_view/template.rb:143:in `render'
```
An unhandled String containing the name of the Wiki page would be provided to the URL path generator. This MR handles that case.
Closes#1547
See merge request !592
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
Allow primary email to be set to an email that you've already added.
Fixes gitlab-com/support-forum#106.
When the user sets their primary email to an email that they've already added to their account, this patch makes sure that secondary email record is destroyed, and a new email record is created for the old primary email. This is based on the assumption that in this case no email was meant to be deleted, but the user simply wanted to change which of their emails is primary.
See merge request !591
Make Reply-To config apply to change e-mail confirmation and other notifications sent through Devise
Notifications sent through Devise were using the default From: address, and due to a broken test line nothing was actually being run.
The only way to customize the Devise Reply-To field is to use a custom mailer. Moved the e-mail configuration out of the initializers to accommodate this.
Closes#1556
See merge request !596
Add a page title to every page.

The `page_title` helper pushes the provided string at the end of the title, but because of the order that layouts are rendered in by ActionView, the result is always this:
```
<title from view> |
<title from as specified in the controller or by its layout> |
<title from layouts/_head>
```
For example: `Merge Requests | GitLab.org / Gitlab Community Edition | GitLab`.
All a developer needs to know is to put a `page_title` call describing the page in question at the start of every template.
To get everything where I wanted it to go without too much duplication, I had to make some changes around layouts, sidebars and controllers.
See merge request !593
This groups milestones by title for issue views like it has been done for
the milestone dashboard/project overview. Before milestones with the
same title would show up multiple times in the filter dropdown and one could
only filter per project and milestone. Now the milestone filter is based
on the title of the milestone, i.e. all issues marked with the same
milestone title are shown.
Fix "Revspec not found" errors when viewing diffs in a forked project with submodules
## What does this MR do?
This MR fixes an error that occurs when viewing diffs in a forked project with submodules.
### Are there points in the code the reviewer needs to double check?
Testing this code was tricky. The only way this problem shows up is if the origin project does NOT have the submodule update commit. The introduction of gitlab-test-fork serves that purpose: it contains a submodule update not present in gitlab-test.
### Why was this MR needed?
A user would receive a 500 error when trying to view a merge request with a submodule update. #1413 has details on how to reproduce this issue.
### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?
#1413
See merge request !512