Commit Graph

316 Commits

Author SHA1 Message Date
Jarek Kobus
64233a4fae Fix repeting Stage/Unstage actions in unified diff editor
Don't store diff file index, chunk index and diff editor
controller anymore. Pass needed indices by value,
retrieve them when needed as lambda copy.

Change-Id: I3a81f1ab6d131c0b1d9899ac4b061b6e25582f51
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-16 06:48:27 +00:00
Orgad Shaneh
a8ddaafca4 Git: Introduce Recover Deleted Files action
Change-Id: I913c07522a8ca82366fd142597430c02e53faa27
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-09 11:33:21 +00:00
Orgad Shaneh
84b57027c8 Git: Fix progress during rebase
Broke by c4b5048836.

Change-Id: I35b22b6ab5fd8767ef729906b8344a0d6aa1f0cf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-04 07:51:12 +00:00
Laurent Montel
ac6055eeb0 Git: clean forward declaration
Change-Id: Ic8e988d9fa27f9e92fdcfe111220a5c929998afb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-28 07:05:19 +00:00
Andre Hartmann
b0ac6435b3 Git: Add new class GitRemote
Allows to split a remote URL and performs
some validation checks on the elements.

Change-Id: I048373076b1a1553fdd7bed2986a41cc087138b0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-09 22:02:30 +00:00
Eike Ziller
dbb2288f1a Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/shared/qbs

Change-Id: I05c4945d238b7724ca73477fc3b21554564951c0
2017-02-20 15:20:14 +01:00
Robert Loehning
cf091e5c3e Git: Initialize members of StashInfo
Change-Id: I20e644d61163bb91addcfe16a58692cfacb988d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-16 14:59:46 +00:00
Orgad Shaneh
7cfbcb41b9 Git: Persist topic per branch on Push to Gerrit
Change-Id: I5a4056f562bb3264a8bd35d73fb16860eb0984e7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-01-23 11:53:12 +00:00
Orgad Shaneh
5832f52cee VCS: Replace describe slots with lambdas
Change-Id: I05ca25aad8be43fdfa15d3fb5eaaa9bf753ee79f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-28 09:38:12 +00:00
Orgad Shaneh
c844071627 Rename VcsBaseEditorParameterWidget -> VcsBaseEditorConfig
Change-Id: I5626e66ba2b7a760ce55263edce9e716067ea6a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2016-10-24 16:23:59 +00:00
Orgad Shaneh
516161c875 Git: De-noise
* Remove QLatin1{String|Char} where possible
* Use initializer lists for QStringList

Change-Id: I8479f87f4fc909b5d74d854956885564209538e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-22 10:12:59 +00:00
Orgad Shaneh
6567db9c5b Git: Delete unused cloneRepository function
It is now implemented by the wizard, using
GitVersionControl::createInitialCheckoutCommand.

Change-Id: Ie847402cf1bc22444d2142baa57bfac6a136fb8f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-18 07:37:46 +00:00
Tobias Hunger
7c910e8b16 Git: Some more cleanup
* Remove some more QLatin1String/QStringLiteral
* Use algorithms

Change-Id: Iaa1042684c58be5ff0a42b9126b63ec681053fdc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-07-15 14:27:22 +00:00
Tobias Hunger
bdff47afd5 Git: Sprinkle C++11 goodness over the code
Just initializer lists for QStringLists (mostly arguments) and nullptr.

Remove lots of QLatin1* while at it.

Change-Id: I0d8354bcbdb759db65da6153bb356fb4b8ed0e8d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-11 07:49:00 +00:00
Orgad Shaneh
3845c833fc VCS: Return the editor in VcsBaseClient::annotate
Will be used in a follow-up commit for setting base line number
for limited range blame.

Change-Id: Ibae90f3ac982ebe9f53aa282f70c2c703e9eeb9d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-14 07:56:55 +00:00
Orgad Shaneh
61d94c5ccd Git: Fetch completion refs asynchronously
For repositories with many refs the dialog takes a few seconds to open.

Change-Id: I82154ad8a77cc304db941f9d41e36e32aa7043cd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-09 07:40:30 +00:00
Eike Ziller
967177d3d8 SynchronousProcess: Change exit code interpreter to function object
Change-Id: Ic48d4f5810f171c070f0980581fb6e45f6fe6b4a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-04-27 08:48:32 +00:00
hjk
9a4700aae6 Git: some cleanup in gitclient.{h,cpp}
Unneeded declarations, s/static const/const/, #include order, ...

Change-Id: Ie7970f1a0ec1989d79bac56e9bad87852dd036ea
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-15 08:35:40 +00:00
Orgad Shaneh
4cf86a4f85 Git: Inline a signal connection
Change-Id: I973ad0dad22df95fccfaa0ed5190bed696233e8c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 10:20:53 +00:00
Orgad Shaneh
e868357107 VCS: Reslot describe functions
They're used by VcsEditorFactory

Change-Id: I9211f406b389649bf8ff9fe7f24522026b1711d4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-12 12:32:06 +00:00
Tobias Hunger
b4195d5174 Git: Modernize
* pragma once
* member initialization
* s/struct/class/
* Introduce a static GitPlugin::client() method and use it

Change-Id: Ifdcac86dd16f3cdba11d564d03e9a15f00a6afdb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-10 15:01:57 +00:00
Orgad Shaneh
d4816850f0 Git: Return QByteArray in synchronousShow
Will be used by Grep

Change-Id: I9346707eef2fe55085b0edf090e117fe45afe8bf
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-08 14:49:06 +00:00
Orgad Shaneh
1b9b1541d3 Git: Un-slot private slots
Change-Id: If88d7e1b501daf6f0dfc696cb20e5f1eb4aa83fe
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-04 11:29:05 +00:00
Eike Ziller
a6f5548331 Git/Clean: Fix issues with submodules
- If the git config contained old entries for submodules that were
  removed (they are not cleaned from the config automatically),
  it would add submodules with empty "dir", which lead to infinite
  recursion

- When recursing into submodules, we need to prepend the paths from the
  git output with the relative path from the main repository

Change-Id: I0bc6a1973f4cdeb1c3f09c05cd7736c25471f72e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-25 12:20:31 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
7b3aa16dc6 Git: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I60dcd378419b92f96dc681921701c9231ef8ee57
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-23 14:48:09 +00:00
Tobias Hunger
dda9380052 Git: Simplify createRepositoryAction usages
Change-Id: I53047333e2591b9e2aca7931a1e809f99baf6f31
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-23 13:42:10 +00:00
Orgad Shaneh
1fd8760789 Git: Do not use file name when retrieving parent commit
Right-clicking a commit on blame shows the parent commit relevant for this file.

In case the file was renamed, fetching the parent can fail (since the file with
this name did not exist before the requested commit).

Using the direct parent is good enough, and should work for all cases.

What the user is really interested in is "how did the file look before this
commit", and the exact "previous" commit is not really interesting.

Change-Id: I7d74efce5f2b065f62e978ba5f14d3010a5f2c7f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-11 13:24:06 +00:00
Thiago Macieira
d6da30d77a Fix the getting of the Git author name when user.name isn't set
The config variable is not required, as Git will get the user's name
from other system settings, like the gecos field in /etc/passwd. So
adapt Qt Creator to use the same mechanism that Git does.

Change-Id: I255870833a024a36adf6ffff13ecb43cc0c45bbf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-07-01 16:02:25 +00:00
Tobias Hunger
5a2b5036ab Git: Get rid of findExistingVCSEditor
VcsBaseClientImpl::createVcsEditor does do the same check.

Change-Id: I89c8d954e8d104261d8ee51a098b97110b4538f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:35 +00:00
Tobias Hunger
be3e0438c6 Git: Rename asyncCommand to vcsExecAbortable
This name makes it more clear what the method does.

Refactor to use VcsBaseClientImpl::vcsExec.

Change-Id: I4cf742c2b172d2589bd7d6740461e4a4c8d470ed
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:24 +00:00
Tobias Hunger
d45dea6cf8 Git: Move executeGit into VcsBaseClientImpl
and rename it to vcsExec. Accept a QVariant to set as cookie on the
command instead of a int for the linenumber.

Change-Id: I8240b53e775ac3883f92bdbf7b111abeeeb39426
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-15 12:24:20 +00:00
Tobias Hunger
5954506d19 Vcs: Move vcsSynchronousExec into VcsBaseClientImpl
Use it in favor of git's synchronousGit method.

Change-Id: I1fc8031cb6d258073b64163aeeeaeac84443fb8c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-14 11:22:00 +00:00
Tobias Hunger
dcdcf54048 Vcs: Move vcsFullySynchronousExec into VcsBaseClientImpl
Use that in the gitplugin in favor of fullySynchronousGit.

Change-Id: Ifd981f3fc5e87e16ad52caf32c204f81acffe586
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-14 11:21:21 +00:00
Tobias Hunger
a55fb4a378 Vcs: Move annotate and annotateRevisionRequested into VcsBaseClientImpl
... and use that in the Git client.

Change-Id: Ie70ec0d5908776d11eb69613d45f565d4f0ce32b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-13 10:40:58 +00:00
Tobias Hunger
e7616f8769 Vcs: Move createVcsEditor into VcsBaseClientImpl
... and use that in Git as well.

Change-Id: I81c85fcf5a7da7e9f756f117ea6c38c15294a401
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-13 09:08:35 +00:00
Orgad Shaneh
4eb2224f47 Git: Add override
Change-Id: Iae0779c1efa8b3b46cf504f7bda00d614a4a157e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2015-04-12 20:03:04 +00:00
Tobias Hunger
0f5fdbe0f2 Git: WS fix
Change-Id: I0b4d37ae8ccd5f5edd8f049d31519be7d2131036
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-10 14:14:47 +00:00
Tobias Hunger
07d6757ca8 Vcs: Move createCommand and enqueueJob into VcsBaseClientImpl
Change-Id: I86a4ddfd6c53a3be61c56579d8eaf5d49258a8f1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-10 09:49:47 +00:00
Tobias Hunger
2ccae82b5c Vcs: Move vcsBinary and vcsTimeout into VcsBaseClientImpl
Change-Id: Ib14432c85f42606a0437f3848b9dfa2fe63fb2f3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-09 07:25:17 +00:00
Tobias Hunger
90ce38da39 Vcs: Move handling of settings from VcsBaseClient to VcsBaseClientImpl
... and update users of that functionality accordingly.

Unexpected plus: Now every supported VCS actually saves their setting
when requested.

Change-Id: I02db7b2ce14e5f52d26409b2a01aea290c2a294a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-04-08 09:30:44 +00:00
Tobias Hunger
514dc73e60 Vcs: Introduce VcsBaseClientImpl
Introduce VcsBaseClientImpl class that is a base for both GitClient
and VcsBaseClient.

The idea is to slowly move code from VcsBaseClient into VcsBaseClientImpl
and reuse that in GitClient. Ideally GitClient would become a full
VcsBaseClient at some point, but let's see how far we can get with this
conversion process:-)

Change-Id: I2e63ba0dcf8a61128d5abf7c1453625e1b9f4e7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-26 14:22:12 +00:00
Tobias Hunger
66b94f490f Git: Make createVcsEditor take the same arguments as in VcsBaseClient
Make createVcsEditor in GitClient have the same signature as
createVcsEditor in VcsBaseClient.

Change-Id: I652175cbbf90b5bccd007fe8f028e364fe61a9aa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-26 14:21:57 +00:00
Tobias Hunger
3718dfce98 Git: Add enqueueJob method to GitClient
That makes it more similar to the VcsBaseClient.

Change-Id: Iabdd177d0734a6c1001c9bc5c5a0e2375ec169bc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-26 14:21:29 +00:00
Tobias Hunger
5c8af1a490 Git: Make GitClient and VcsBaseClient more similar
Use the same signature for the createCommand method in both.

Change-Id: I948a9fd1af2850730736731c53ee8d1b0b9b30bc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-26 14:21:02 +00:00
Tobias Hunger
f44161bb9a Vcs: Add vcsBinary and vcsTimeout methods to VcsBaseClient
Change-Id: I966a76ee4c1e5c45ac7332613e90cf511afc584c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-26 14:20:54 +00:00
Tobias Hunger
cb5886139e Git: Remove readConfigBytes
Integrate that into readConfigValue and use that instead.

Change-Id: I47f860a49f1528ff1aa5f4dc645497034ab87d5b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-25 13:42:30 +00:00
Tobias Hunger
b2b8b867d6 DiffEditor: Refactor the user-facing parts
* Move all data handling into DiffEditorDocument
* Move much of the logic of how to update views into the
  DiffEditor.
* Introduce a base class for the different views on the diff
  to implement.
* Remove DiffEditorGuiController
* Make DiffEditorController smaller and merge the DiffEditorReloader
  into the class
* Simplify communication between the classes involved
* Make much of the implementation private to the plugin

Change-Id: I7ccb9df6061923bcb34cf3090d6d8331895e83c7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
2015-03-10 10:25:52 +00:00
Tobias Hunger
bdbe119dbe Git: Remove unnecessary destructor
Change-Id: Ib4041924e1544d1ec2c5837c62c23554c6be0e91
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-03 10:20:32 +00:00
Orgad Shaneh
7471187404 Gerrit: List remote branches also for non-fetched remotes
Task-number: QTCREATORBUG-13718
Change-Id: I0259d06f4f06b68af459d747176dc46b14a55008
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-02-16 15:29:25 +00:00