Commit Graph

82 Commits

Author SHA1 Message Date
Eric Eastwood b42dc1a52b Linking to edit file directly 2017-04-06 16:36:38 +00:00
Jacopo 7b04b63eeb New directory from interface on existing branch
The user can create a new directory on a different branch than the
source branch when the branch already exists.
2017-03-21 11:51:53 +01:00
Jacopo e0fe2834eb New file from interface on existing branch
Now you can create a new file and select a target_branch != source_branch.
If the file that you want to create already exists on the target branch an error message is shown
A glDropdown is used to select and create a new branch instead of a text field.
2017-03-13 16:36:11 +01:00
Douwe Maan 6cc4cf1e15 Fix cherry-picking or reverting through an MR 2017-03-02 17:41:05 -06:00
Sean McGivern 811e598f60 Enable and autocorrect the CustomErrorClass cop 2017-03-01 15:28:10 +00:00
Douwe Maan f40716f48a No more and/or 2017-02-21 16:31:14 -06:00
dixpac fa2339641f Rename Files::DeleteService to Files::DestroyService
Reason for renaming is to comply with naming convention of services in
codebase.
2017-02-10 18:22:18 +01:00
Douwe Maan 9d7c5e7584 Address feedback 2017-02-06 18:06:46 -06:00
Douwe Maan 6edc8d50dc Add feature specs 2017-02-06 16:12:24 -06:00
Douwe Maan c8b63a28af Improve performance of finding last deployed environment 2017-02-06 16:12:24 -06:00
Douwe Maan 27f2ca9418 Add 'View on [env]' link to blobs and individual files in diffs 2017-02-06 16:12:23 -06:00
Douwe Maan 742cee756b Merge branch 'jej-22869' into 'security'
Fix information disclosure in `Projects::BlobController#update`

It was possible to discover private project names by modifying `from_merge_request`parameter in `Projects::BlobController#update`. This fixes that.

- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added
- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

https://gitlab.com/gitlab-org/gitlab-ce/issues/22869

See merge request !2023
2016-11-28 21:25:18 -03:00
Yar 8782bb96cc Unify anchor link format for MR diff files !7298
Right now, the following naming scheme for diff files is used: diff-1, diff-2, ... and also we have "internal" format which is file-path-HASH, where HASH is sha1 of file path.
Besides, we have HASH_lineA_lineB format to link exact line number in MR diff. It makes sence to unify the way we link diff from outside, while leave "file-path-HASH" format for internal (js) usage.
Changes in this commit  allow to link diff just by HASH, if we don't want specify exact lines, also it changes "file-path-HASH" and "diff-NUMBER" links in code to this unified format.

Inspired by #24010 and !7298
2016-11-15 20:51:21 +03:00
tiagonbotelho 08dc8af733 fixes distinction between renaming a file and updating its content and
refactors update file
2016-09-09 23:05:30 -04:00
Frank West ade0c2c892 Prevents accidental overwrites of commits from UI
Currently when a user performs an update of a file through the UI  and there
has already been a change committed to the file the previous commits will be
overwritten without a check to see if the file has been changed.

This commit uses the last commit sha at the time the user starts editing the
file and compares it with the current sha of the file being edited to ensure
they are the same before committing the file. If the shas do not match we
throw an exception preventing the commit from the commit from occurring.

Fixes #5857
2016-08-15 02:34:55 +00:00
Tim Masliuchenko b6d545df51 Add unfold links for Side-by-Side view 2016-08-04 09:09:59 +03:00
tiagonbotelho dd3addad48 renames :file_name to :file_path 2016-07-13 11:19:14 +01:00
tiagonbotelho 98c0eb4615 test for nil params :file_name 2016-07-12 15:55:16 +01:00
tiagonbotelho 893f3f2856 refactors update action to change commit_params with the correct path 2016-07-12 15:55:16 +01:00
tiagonbotelho cf96c7596a changes the usasge of path to file_path on blob_controller for compatibillity with the create action 2016-07-12 15:55:16 +01:00
tiagonbotelho 4deab9a540 fixes merge request edit bug where it would generate a cloned file and not remove the previous one 2016-07-12 15:54:17 +01:00
tiagonbotelho b0ce99f5b0 implements the form for renaming the new filename on the file edit page 2016-07-12 15:48:43 +01:00
tiagonbotelho fba72e1e0c creates the update_file method in repository.rb and applies changes accordingly 2016-07-12 15:48:24 +01:00
tiagonbotelho 09194eebff successfully adds the new version with the updated name on the projects repo 2016-07-12 15:46:14 +01:00
tiagonbotelho d9561118e8 implements the form for renaming the new filename on the file edit page 2016-07-12 15:46:14 +01:00
tiagonbotelho f85834bc96 remove prints and useless comments 2016-07-12 15:46:14 +01:00
tiagonbotelho 10954f93e9 successfully adds the new version with the updated name on the projects repo 2016-07-12 15:45:59 +01:00
tiagonbotelho 50613fc6d3 implements the form for renaming the new filename on the file edit page 2016-07-12 15:44:57 +01:00
tiagonbotelho fc747dc346 fixes merge request edit bug where it would generate a cloned file and not remove the previous one 2016-07-12 15:42:19 +01:00
tiagonbotelho 1d5d5b1a42 refactors blob_controller 2016-07-12 15:33:39 +01:00
tiagonbotelho 9951854648 creates the update_file method in repository.rb and applies changes accordingly 2016-07-12 15:24:17 +01:00
tiagonbotelho bb627b6fc2 implements the form for renaming the new filename on the file edit page 2016-07-12 15:23:35 +01:00
tiagonbotelho ea50760b02 remove prints and useless comments 2016-07-12 15:23:02 +01:00
tiagonbotelho ac30c60ad9 successfully adds the new version with the updated name on the projects repo 2016-07-12 15:22:54 +01:00
tiagonbotelho b34310ae9e implements the form for renaming the new filename on the file edit page 2016-07-12 15:22:17 +01:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Ruben Davila 7627cc1989 Validate presence of essential params for diff rendering
This will avoid application errors generated by the assumption of the
presence of these params.
2016-06-24 16:20:53 -05:00
Robert Speicher 8c454b3624 Add a `Blob` model that wraps `Gitlab::Git::Blob`
This allows us to take advantage of Rails' `to_partial_path` to render
the correct partial based on the Blob type, rather than cluttering the
view with conditionals.

It also allows (and will allow in the future) better encapsulation for
Blob-related logic which makes sense for our Rails app but might not
make as much sense for the core `gitlab_git` library, such as detecting
if the blob is an SVG.
2016-02-18 22:45:30 -05:00
Jacob Vosmaer 51574d779c Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into lazy-blobs 2016-02-01 13:51:05 +01:00
Jacob Vosmaer 64c8ee47c9 WIP lazy blobs 2016-02-01 10:41:52 +01:00
Douwe Maan 150b4f66e6 Make sure non-highlighted diffs are still escaped 2016-01-22 01:47:17 +01:00
Douwe Maan 8dfad143d4 Add inline diff markers in highlighted diffs. 2016-01-14 22:28:07 +01:00
Rubén Dávila c476395b4d Reuse existent vars with ref and path. #3945 2016-01-12 11:14:41 -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
Rubén Dávila 3fbcf52ec8 Apply syntax highlighting when expanding diff plus some refactor. #3945 2015-12-31 01:05:52 -05:00
Douwe Maan d9c82d679f Automatically fork a project when not allowed to edit a file. 2015-12-18 10:03:34 +01:00
Douwe Maan df6750d3d6 Default target branch to patch-n when editing file in protected branch 2015-12-08 16:42:10 +01:00
Douwe Maan f3cfd20952 DRY up code 2015-11-18 17:17:38 +01:00
Douwe Maan e945ec0280 Add "Start a new merge request" option to every commit form 2015-11-17 18:53:56 +01:00
Douwe Maan 0b540a0fad Merge branch 'master' into dirceu/gitlab-ce-new-merge-request-from-file-edit 2015-11-17 17:01:28 +01:00