Commit Graph

44 Commits

Author SHA1 Message Date
Douwe Maan c008a1a967 Make Compare#diffs diff_options a regular argument 2016-08-03 09:32:01 -07:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00
Phil Hughes a9d5b07769 Apply diff view cookie on compare
Closes #19573
2016-07-15 13:42:18 -05:00
Sean McGivern ff55398aaf DRY up diff_for_path actions
1. Move render method to a concern, not a helper.
2. Let DiffHelper#diff_options automatically add the path option.
3. Move more instance var definitions to before filters.
2016-07-08 13:53:51 +01:00
Sean McGivern 6a46926f88 Remove unused argument to CompareService#execute 2016-07-08 13:53:17 +01:00
Sean McGivern b6b26692ea Collapse large diffs by default
When rendering a list of diff files, skip those where the diff is over
10 KB and provide an endpoint to render individually instead.
2016-07-08 10:56:55 +01:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Douwe Maan 9a3ed265e9 Use `@diff_notes_disabled` instead of `@comments_allowed` 2016-05-13 17:31:58 -05:00
Douwe Maan 99d3e21f19 Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Douglas Barbosa Alexandre 1353cff5fe Replaces "Create merge request" link with one to the MR when one exists 2016-02-10 10:32:25 -02:00
Douwe Maan 5cce1278ad Correctly determine MR diff base when MR has merge conflicts 2016-01-27 17:23:59 +01:00
Douwe Maan 577f2fb47a Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
Rubén Dávila 6b9c730e91 More refactoring from last code review. #3945
* Use commit objects instead of IDs when generating diffs
* Use proper references when generating MR's source and target
* Update broken specs
2016-01-14 16:47:55 -05:00
Rubén Dávila 21b602c60a Change strategy to highlight diffs. #3945
Now we apply syntax highlighting to the whole old and new files.
This basically help us to highlight adequately multiline content.
2016-01-07 22:37:01 -05:00
Robert Speicher df6bb57921 Merge branch 'compare-first-commit' into 'master'
Correctly set comparison first commit when range includes a merge commit

Fixes #3207.

See merge request !1814
2015-11-17 18:51:40 +00:00
Douwe Maan 24cf6865d3 Correctly set comparison first commit when range includes a merge commit 2015-11-17 13:10:01 +01:00
Minsik Yoon 3d0efa8e0a Add ignore white space option in merge request diff
fix this issue(https://gitlab.com/gitlab-org/gitlab-ce/issues/1393).

Add ignore whitespace optoin to Commits Compare view
2015-11-13 16:53:53 +09:00
Douwe Maan 8710739e4e Correctly find last known blob for file deleted in MR. 2015-10-20 14:24:02 +02:00
Stan Hu de8497ca56 Fix Error 500 when comparing non-existing branches
Closes #2593
2015-09-18 12:02:01 -07:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 9f10943c1a
Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets 26f5d6047d Refactor compare and fetch logic 2015-07-15 17:28:09 +02:00
Douwe Maan 8f75ab21d0 Link Commits tab to current branch from Compare page. 2015-05-09 22:25:52 +02:00
Stan Hu ee92dd1683 Unescape branch names in compare commit
Closes #1399
Closes https://github.com/gitlabhq/gitlabhq/issues/9105
2015-04-30 12:44:46 -07:00
Jeroen van Baarsen 5a4ebfb47a Fixed the Rails/ActionFilter cop
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-04-20 15:39:37 +02:00
Vinnie Okada 2a9eed6620 Merge branch 'master' into rails-4.1.9
Conflicts:
	app/views/projects/commits/_commit.html.haml
	app/views/projects/issues/_issue.html.haml
	app/views/projects/issues/_issue_context.html.haml
	app/views/projects/merge_requests/_merge_request.html.haml
	app/views/projects/merge_requests/show/_context.html.haml
2015-02-21 12:55:28 -07:00
Douwe Maan 00408f37e3 Move 'require_non_empty_project' filter to front so 'assign_ref_vars' doesn't 404. 2015-02-20 17:20:03 +01:00
Vinnie Okada 76aad9b76e Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
2015-02-14 11:09:23 -07:00
Valery Sizov 6f34d40436 remove auth duplication 2014-11-05 11:04:08 +02:00
Ciro Santilli 4d0d5e79ba Factor authorize_push! and authorize_code_access!
with existing method_missing. Pattern already used extensively,
so let's be consistent and use it everywhere.
2014-10-13 21:31:49 +02:00
Dmitriy Zaporozhets 549655765a
Fix variable order on compare page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-29 12:42:01 +03:00
Dmitriy Zaporozhets 378a3f5ca1
Use CompareService for compare page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-29 12:33:51 +03:00
Dmitriy Zaporozhets be5b6db883
Refactor diff suppress logic and diff views
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-15 18:28:21 +03:00
Dmitriy Zaporozhets 0bcabdaf83
Use gitlab_git 5.4.0 without BROKEN_DIFF constant
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-12 12:54:49 +02:00
Dmitriy Zaporozhets a1a01254b9
Prevent 500 error on Compare page if diff read timout happens
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-05 16:21:41 +02:00
Dmitriy Zaporozhets 8f88cbf06b
Use MergeRequestDiff::COMMITS_SAFE_SIZE for Compare diff limit.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-05 16:09:13 +02:00
Dmitriy Zaporozhets 9c629a1ebc Update gitlab_git to version 2.2.0. Fixes invalid diff in Compare 2013-09-16 13:33:34 +03:00
Boyan Tabakov 01ff084a4d Improved large commit handling.
Previously, only number of changed files mattered. Now, number of lines to render in the diff are also taken into account.

A hard limit is set, above which diffs are not rendered and users are not allowed to override that. This prevents high server
resource usage with huge commits.

Related to #1745, #2259

In addition, handle large commits for MergeRequests and Compare controllers.

Also fixes a bug where diffs are loaded twice, if user goes directly to merge_requests/:id/diffs URL.
2013-09-07 14:44:03 +03:00
Dmitriy Zaporozhets 2ed7cbfba4 Move projects controllers/views in Projects module 2013-06-23 19:47:22 +03:00