Commit Graph

492 Commits

Author SHA1 Message Date
hjk
b8fe25db25 Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call
ping-pong inbetween, for code-sharing-by-inheritance. Merge
them by making VcsBasePlugin inherit IVersionControl and
merge the derived classes below.

Size of this patch is hard to avoid as all seven systems have to
move simultaneously. Non-necessary potential follow-up cleanup
have been left out on purpose.

Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-31 12:36:23 +00:00
hjk
b093941435 Vcs: Drop VcsBaseOptionsPage hierarchy level
Adapt the remaining users: Cvs,Git,Svn.

Change-Id: Idd730a33e5c64d18002b1a21b5f5c715b7fa5ffb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-27 06:44:55 +00:00
hjk
866f3aeb4a Vcs: Pass settings handles to settings pages more directly
Change-Id: I5fdec80de5678dd544713fc18335cbd805d7b9f4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 11:40:49 +00:00
hjk
1cd936c531 Vcs: Pimpl plugins
Essentially rename all *Plugin into *PluginPrivate, and pull out
the actual IPlugin related pieces into new *Plugin classes.

Shift the construction of the PluginPrivate to initialize(),
following the general pattern.

I tried to keep the patch as mechanical as possible, giving
room to some obvious but less mechanical cleanup needs,
that are intentionally left out of this here.

Change-Id: Iac662bf73338f9f7669064ed67b960246875c23c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-24 09:47:28 +00:00
Christian Kandeler
56cd4ad28f Git: Fix memory leak
Change-Id: If9dbc29f0b58a81319b3490821edf5f7afce90ab
Reviewed-by: hjk <hjk@qt.io>
2020-01-23 11:28:21 +00:00
hjk
823c44de18 Vcs: Move static functions out of VcsPlugin "namespace"
Plan is to split VcsPlugin in the pure IPlugin and a new class
the remaining non-IPlugin bits of VcsPlugin, call it VcsPluginPrivate
and use that d-ptr for VcsPlugin. VcsPlugin-derived classes can
then use VcsPluginPrivate derived private, later pointer members
of the *Privates can be made proper members, moving towards the
otherwise predominant plugin setup pattern.

Change-Id: I62db9269e8ca50633c24b6d1d735d59c8fa8e5a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-23 08:20:36 +00:00
hjk
f5d4b65931 Vcs: Dissolve VcsManager::registerVersionControl
It's a somewhat unusual pattern, spelling it out will help
to move the vcs plugins setup closer to the now-usual pattern.

Change-Id: Ie7b70e52d75e34cd36b6a1d55ca868e3edab44a7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-22 11:32:04 +00:00
Christian Stenger
4fe2d9a43d Git: Fix missing include
Fixes the build on macOS.

Change-Id: I22046de5d2ea27a649742dcc19cf1254747bf318
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-16 07:00:45 +00:00
Andre Hartmann
d2d05c584e Git: Start interactive rebase from log window
Useful if local changes are already pushed to a
remote and therefore Creator refuses interactive
rebase due to missing local commits.

Task-number: QTCREATORBUG-11200
Change-Id: I2e9b9fd35b75fcb232c1358c553fe1092ce97161
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-30 09:28:32 +00:00
Andre Hartmann
da6972e0a9 Git: Update current branch after some operations
... to refresh the branch view upstream status.

No need for a full model update here, only the current
branch is influenced.

Change-Id: I6bd17a841988b36221e5015a5858071d33a7b5e5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-12-27 11:51:45 +00:00
Andre Hartmann
b292c30a13 Core: Make InfoBar::GlobalSuppressionMode an enum class
Change-Id: I859a727196a887f7699a667fbe07e1bfead4cb2b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-12 06:45:06 +00:00
Tasuku Suzuki
578cdf7c5a Git: Archive support
This allows users to create archive files from local repository.

Tools > Git > Local Repository > Archive will create <reponame>-
HEAD.tar.gz

Tools > Git > Actions on Commits... you can choose a commit to archive

Change-Id: I09bbbdefe532237e9065d1ca3c21910a036ea149
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
2019-06-10 18:19:57 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
Orgad Shaneh
f5203796e4 Git: Use ICore::dialogParent as dialog parent
Change-Id: Idc3f2f4d27d3279f76b688fac635e8d38b2705f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-29 14:56:43 +00:00
Andre Hartmann
e65131ac11 Git: add svn dcommit
It's the counterpart to git push when working with
SVN remotes and git-svn.

Change-Id: I02257ea921fdcdedec294b28e8756ed88fb764b3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-25 14:19:30 +00:00
Orgad Shaneh
15b176e30c VCS: Improve dialog on submit prompt
The dialog appears when closing the commit dialog without committing,
or when "prompt to submit" setting is enabled.

Fixes: QTCREATORBUG-18799
Change-Id: I8eb20becbcee7281b9f673a35ec698c6f8e04a40
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 18:35:44 +00:00
Orgad Shaneh
644110f6e0 Git: Block [*_]HEAD for branch name
Can have false positives, but I think it's better than tracking all of
git's internal names.

See https://stackoverflow.com/a/17596689/764870

Change-Id: Ifa3d942c4f791e5f8542e0cc174b934f2a95cbcd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-11-12 09:48:52 +00:00
Orgad Shaneh
762fb5c353 Git: Make checkout asynchronous
It can be slow when many files are replaced.

Change-Id: I308698ef36973374f4526107fbda0d9ad907e707
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-10 08:30:16 +00:00
Andre Hartmann
3177e53804 Git: Add support for github remotes
Github and gitlab uses a different syntax when cloning with ssh:

 git@github.com:qt-creator/qt-creator.git

Support this pattern for remote validatation also.

Change-Id: Ic67f2238b9cdd526e76715c86846542cdb73f503
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:44:01 +00:00
Andre Hartmann
96f982a016 Git: Check remote port for isValid in GitRemote
Change-Id: Iab922abcde0ac055417467f3c63a31dffa721986
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:43:39 +00:00
Andre Hartmann
0dfb2938ed Git: Add tests for GitRemote
Change-Id: Ia5e0c482afa7847f5ae8dae1b15d1dabfc908e32
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-07 15:01:10 +00:00
Andre Hartmann
546956a302 Git: Allow creating a new repository from branch view
... when clicking "Add Branch" in a project that is not
under git version control.

The "Add Branch" serves no purpose here, so re-use it
to call this (already existing) function.

Done-with: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Change-Id: Ib23d2cbeec0598e0b6f00cbde265793cc25e6142
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 05:37:09 +00:00
Andre Hartmann
017f4d7c4d Git: Add shortcut to "manage remotes" to branch view
Change-Id: I36d9196a41869176f8ad602f1ba406402fc5b77c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 05:36:53 +00:00
Orgad Shaneh
202d40f256 Git: Modernize
* Use auto
* Use override
* Use some member initializers

Change-Id: I3ca000d1c8e4d02331d58b85e68e4d771c636b29
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 19:47:07 +00:00
Orgad Shaneh
296ae92853 Git: Change pull to run asynchronously
Fixes: QTCREATORBUG-13279
Change-Id: Idee6e64e5eebe729e7c1d0e0135a1d8b464187b7
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-09-19 17:02:24 +00:00
Andre Hartmann
62072903b0 Git: Remove unneded qualification to Core
Change-Id: Ide8e7010410fe8184d9ef4dd37ddbf77ff5f1edf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-15 17:55:05 +00:00
Andre Hartmann
fc36a0b5bd Git: Switch to edit mode when branch view is requested
The branch view is shown in the right side bar, which is
not visible in debug mode, for example.

Task-number: QTCREATORBUG-21088
Change-Id: If8fcab7a0b21d82534935bc555b79d1571d37633
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-15 17:54:52 +00:00
Andre Hartmann
e543ef5eb1 Git: Replace branch dialog with branches side panel
This allows all kind of typical Git workflow (rebasing,
merging, cherry-picking) without having the branches dialog
on top of all windows.

Task-number: QTCREATORBUG-19618
Change-Id: Iab078d79a589ff60fa8385c98ec2a23b352c084c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-12 18:24:52 +00:00
Orgad Shaneh
767137157e VCS: Consolidate submit editor actions setup
Change-Id: I36754779b6a9aa35de705b368daf8c2a1de058c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:26:14 +00:00
Orgad Shaneh
a39516aef1 Git: Update file model after unsuccessful commit
The commit operation itself [un]stages files before actually committing.
The model has to be refreshed after that.

Change-Id: I4b765005640b62812687d4f003d94af3717c379e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-19 09:37:14 +00:00
Orgad Shaneh
23b8e6d531 Git: Minor cleanup in commit processing
Change-Id: I99214441059a097b8aeb197638fc58e407a7d27b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-19 09:37:06 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Eike Ziller
f1e02c0826 Fix that menus didn't show ampersands in files names
And instead interpreted the ampersand + following character as an
accelerator key.

Task-number: QTCREATORBUG-17817
Change-Id: I327239499ce56e75fd12f2df5be60d4b04913acd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-26 12:02:15 +00:00
Nikita Baryshnikov
e3918b563f Git: show commit given as command line parameter in diff editor
ex: qtcreator -client -git-show d3eb585db9 from qt-creator source dir.

Change-Id: Ice62f062d431d2ab74e3d6832dfc8b0b555dfa19
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-03-16 09:45:45 +00:00
hjk
713b8636ea Vcs/Text search: Remove a few addAutoReleaseObject uses
Using a QObject parent suffices here.

Change-Id: I4dc5448511d55bf14fbd8f810e91336a49e94094
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-02-06 11:58:15 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +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
Tobias Hunger
21ab4c427c VCS: Offer to save-all before commit
Task-number: QTCREATORBUG-3857
Change-Id: I3ff3d90803eec4134b9da4af5567753ad7bffafb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-12 10:04:20 +00:00
Eike Ziller
c01ddc4660 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsproject.h

Change-Id: I6b9cdf704be95ade02488c8b19582b6621282fb8
2017-07-28 15:24:14 +02:00
Orgad Shaneh
b123018287 Git: Fix blame with selection that ends on the last line
This also removes an additional line when the cursor is on a line start.

Change-Id: Iaec6f60b8e33d98c3a3ed0555ee4ff01991ad7fb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-27 10:33:10 +00:00
Tobias Hunger
19c9194b11 VcsManager: Register IVersionControls with VcsManager
Get some more objects out of the pool.

Change-Id: Id93021b712307c4777dc39b9d15aa18a46318885
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-07-10 08:44:47 +00:00
Orgad Shaneh
2307e4d2cc Git: Prevent * in branch/remote names
Change-Id: I8934352359710e1890a04310c22086f80dd4a7cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-05-29 07:19:20 +00:00
Orgad Shaneh
1af52db32e Git: Replace lambdas with std::bind
Reduces release build from by ~5K (255->250), and slightly shorter.

Change-Id: I326297b08374fe34cdd2dd05db3b978ae7775e06
Reviewed-by: hjk <hjk@qt.io>
2017-04-04 19:02:24 +00:00
Andre Hartmann
57144e28da Git: Factor out pattern for invalid branch names
Re-use it in the follow-up commit for remote names also.

Change-Id: Ib88792a1abdc2fa8ac23c99aa7d4861728e36eec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 08:55:08 +00:00
Eike Ziller
1f8b2dc361 Advanced search: Add exclusion patterns
All files with full file path matching one of the exclusion patterns are
ignored in the search.
Searching with "git grep" now requires git >= 1.9

Change-Id: Ied5d11499bc1ff21247e50f8e146e8e5011dd2c1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-28 10:48:23 +00:00
Eike Ziller
d64e17ad55 Move mimetype definitions to plugin specs
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
  registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
  handle a mime type if it was enabled

Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 13:54:59 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Orgad Shaneh
f77af5e336 Gerrit: Remove repo selection from the dialog
Behave like the Branches dialog, which is updated by the current open file.

Change-Id: Id106b3e4fa777bcbf08b826f4e7d52845dde57a6
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-06 17:00:26 +00:00
Orgad Shaneh
e366e135b7 Git: Eradicate Q_FOREACH loops
Change-Id: I29b6071ea244d1b3ae0701d36c90b1e93cf21fbb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2017-02-06 09:37:44 +00:00
Orgad Shaneh
28b61a9f9c Git: Avoid repeating calls to currentState() in updateActions
Change-Id: I9352b7d9ad064e6dc4eb694a9175c8f32b5b25c8
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-05 07:45:00 +00:00