Commit Graph

102 Commits

Author SHA1 Message Date
Sean McGivern a0979c05fd Show correct size when MR diff overflows
The problem is that we often go via a diff object constructed from the diffs
stored in the DB. Those diffs, by definition, don't overflow, so we don't have
access to the 'correct' `real_size` - that is stored on the MR diff object
iself.
2017-04-25 16:54:10 +01:00
Douwe Maan 543dcdacc2 Statisfy Robertcop and Seancop 2017-04-11 10:51:48 -05:00
Douwe Maan 4f8c36c03c Add specs 2017-04-10 15:17:52 -05:00
Douwe Maan f112f81d3d Fix find_by_diff_refs 2017-04-08 14:37:46 -05:00
Douwe Maan 50eae640db Fix specs and make tweaks 2017-04-08 14:37:46 -05:00
Douwe Maan b202b42cfe Link to outdated diff in older MR version from outdated diff discussion 2017-04-08 14:37:46 -05:00
James Lopez 22d7ae8002 Fix issues importing forked projects 2017-04-04 16:34:19 +00:00
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan 206953a430 Prefer leading style for Style/DotPosition 2017-02-23 09:32:22 -06:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Douwe Maan 3dadf306dd Enable Style/DotPosition 2017-02-23 09:31:56 -06:00
Lin Jen-Shin 4587c78afa Merge remote-tracking branch 'upstream/master' into fix-git-hooks-when-creating-file
* upstream/master: (1122 commits)
  Update CHANGELOG.md for 8.16.2
  Display project ID in project settings (!8572)
  fixed points from comments to improve code quality
  Update CHANGELOG.md for 8.14.8
  Statisfy eslint
  Add CHANGELOG entry
  Fix access to the wiki code via HTTP when repository feature disabled
  Display fullscreen button on small screens (!5302)
  Prevent removing fields from dropdowns on input elements
  fix for all themes
  Return struct instead of multiple values
  Fix race conditions for AuthorizedProjectsWorker
  Add User#nested_groups and User#nested_projects methods
  Fix spec failure due to timestamp ordering issue in mySQL
  Fixed error with filter keyboard tests
  `can?` already includes the `feature_available?` check
  Test there is no Merge Request button when MRs are disabled
  Ensure the correct Merge Request button is found
  Add 409 conflict tests
  Add CHANGELOG
  ...
2017-01-26 17:21:38 +08:00
Sean McGivern e324ccc20c Merge branch 'issue_25017' into 'master'
Show 'too many changes' message for merge request

Closes #25017

See merge request !8444
2017-01-17 15:56:10 +00:00
Felipe Artur ca0cf5a3cd Show 'too many changes' message for merge request 2017-01-12 13:41:29 -02:00
Lin Jen-Shin dea589d635 Prefer leading dots over trailing dots 2017-01-06 04:41:17 +08:00
Robert Speicher a00578ce5c Absorb gitlab_git 2017-01-04 19:09:28 -05:00
Lin Jen-Shin 8384d0d8d5 Introduce Repository#with_tmp_ref which we need
commits from the other repository. We'll cleanup
the tmp ref after we're done with our business.
2016-12-08 17:57:52 +08:00
Adam Niedzielski cb6f8cdfc2 Replace references to MergeRequestDiff#commits with st_commits
when we care only about the number of commits

We do not have to instantiate all objects in this case.
2016-12-01 12:17:30 +01:00
Adam Niedzielski e22514fd4c Hide empty merge request diffs when comparing versions 2016-11-21 13:26:26 +01:00
Lin Jen-Shin 78de8816f5 Also keep commits from source_project around, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6658#note_17190236
2016-10-25 00:08:30 +08:00
Dmitriy Zaporozhets b48c4b2662 Refactor straight compare diff code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-12 16:32:57 +03:00
Dmitriy Zaporozhets cdcc11d48f Improve tests for merge request diff model
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-12 16:32:57 +03:00
Dmitriy Zaporozhets ac4db38094 Use straight diff approach when compare merge request versions
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-12 16:32:57 +03:00
Stan Hu d4fab17d7c Fix Error 500 when viewing old merge requests with bad diff data
Customers running old versions of GitLab may have MergeRequestDiffs with
the text ["--broken diff"] due to text generated by gitlab_git 1.0.3.
To avoid the Error 500, verify that each element is a type that gitlab_git
will accept before attempting to create a DiffCollection.

Closes #20776
2016-10-10 13:05:09 -07:00
Lin Jen-Shin 4ed23a3a57 So that st_commits could never be nil 2016-09-22 17:28:36 +08:00
Lin Jen-Shin 6987ec29b0 For empty merge_request_diff st_commits would be nil
Closes #22438
2016-09-22 17:01:01 +08:00
Lin Jen-Shin e0f596c99d Show all pipelines from all merge_request_diffs:
This way we could also show pipelines from commits which
were discarded due to a force push.
2016-09-19 23:51:27 +08:00
Dmitriy Zaporozhets 6f7a3ee694 Refactor merge request version compare feature
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-09-07 10:24:48 +03:00
Dmitriy Zaporozhets a943ccf10e
Change the way merge request diff compare works
* remove ref fetch (we do it during creation anyway)
* remove safe_head_commit_sha for diff compare (do not depend on the source branch)

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-25 11:58:17 +03:00
Dmitriy Zaporozhets d64c15c5c3
Add code improvements to merge request version feature
* Add MergeRequestDiff#latest?
* Remove unnecessary variable assignment

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-25 10:59:30 +03:00
Dmitriy Zaporozhets e067e699c3
Make sure merge request is fetched before collecting base sha in merge request diff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-19 12:35:16 +03:00
Dmitriy Zaporozhets 49d63dc131
Fix and refactor merge request diff_refs method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 18:11:18 +03:00
Dmitriy Zaporozhets 643a368fa4
Make merge request diff works with new FileCollection logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 17:57:19 +03:00
Dmitriy Zaporozhets 5e95c0b8d2
Merge branch 'master' into dz-merge-request-version
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 17:27:22 +03:00
Dmitriy Zaporozhets 94a7198ade
Fix merge request diff create and head_commit_sha compatibility
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 16:25:29 +03:00
Dmitriy Zaporozhets 29ac60d7fb
Change the way old merge request diff handled
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15 15:20:36 +03:00
Dmitriy Zaporozhets 28e33df46b
Load merge request versions without loading whole diff from database
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-09 15:16:50 +03:00
Gabriel Mazetto c9aa19881c Enable Style/SpaceAroundEqualsInParameterDefault cop 2016-08-06 04:03:01 +02:00
Paco Guzman 631f59d4e7 change the API on the merge_request_diff model from diffs -> raw_diffs 2016-08-03 23:32:12 +02:00
Paco Guzman 8716ff7f63 Speedup DiffNote#active? on discussions, preloading noteables and avoid touching git repository to return diff_refs when possible
- Preloading noteable we share the same noteable instance when more than one 
discussion refers to the same noteable.
- Any other call to that object that is cached in that object will be for any 
discussion.
- In those cases where merge_request_diff has all the sha stored to build a diff_refs get that 
diff_refs using directly those sha instead accessing to the git repository to first get the 
commits and later the sha.
2016-08-02 16:04:15 +02:00
Dmitriy Zaporozhets 6515ec09bb
Chnage the way how merge request diff is initialized and saved
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 15:38:03 +03:00
Dmitriy Zaporozhets 3c1dca0301 Add more tests to merge_request_diff and improve initialize
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 0e974b52d8 Refactor MergeRequestDiff initialize method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 8e031ce3b2 Remove requirement for base_commit_sha to allow creation of merge requests for orphaned branches
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 5cad2d2902 Add improvements to merge request versions
* show commits count in the merge request version dropdown
* initialize base/start commit sha for old merge request diffs from repo

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 964742f600 Ensure merge request is created with valid diff object
* Add merge_request_diff validation to merge_request model
* Improve initialize of merge_request_diff object
* Rename some merge_request_diff methods for clarity

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 988836bc80 Refactor MergeRequestDiff model
Since MergeRequestDiff is not about branches and current state of merge
request diff anymore I removed most of branch related method and added
validation for head/start/base commit sha. From this point
MergeRequestDiff is about saving diff between branches only once at moment of
creation. Once created MergeRequestDiff should not be changes. Because
of that we should not rely on changes in source/target branches when
read from MergeRequestDiff

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets 09fa013928 Refactor merge request diff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00
Dmitriy Zaporozhets b8fef7eb59 Add ability to render different merge request versions
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-02 13:31:19 +03:00