Commit Graph

2048 Commits

Author SHA1 Message Date
Orgad Shaneh
69f978efca Gerrit: Split GerritServer to its own file
It became much larger than GerritParameters. No reason to keep them
together.

Change-Id: Ib125f124940e95b0e15616d150f6b44fdb428284
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-08 18:57:20 +00:00
Orgad Shaneh
ed5488a490 Gerrit: Improve text in authentication dialog
Change-Id: If5610bad071d6c5d633e28fb16cfe003bdbbd6a0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-03-08 07:26:03 +00:00
Orgad Shaneh
562a3dadd0 Gerrit: Sort entries in qmake project
Change-Id: I6a1a2c9c8891d5af743a6537ca0d3fb6ead53458
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-07 07:28:15 +00:00
Orgad Shaneh
1c3b11ed54 Gerrit: Do not pass username for anonymous access
Change-Id: Idaa04d359ac36d8265d34feb725da54e30392788
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-06 16:04:51 +00:00
Andre Hartmann
4ce5964422 Gerrit: Improve button enabling in AuthenticationDialog
* If the text was obviously pasted from the clipboard,
  check instantly
* Otherwise, check two seconds after the last keystroke

Change-Id: I639e2f5dea596afdbb917cf0cffd0cf574d0032f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-04 21:15:54 +00:00
Andre Hartmann
2f51a42461 Git: Convert BranchNameValidator to QRegularExpression
Change-Id: I496d427b4cba65a2aa9ba9b3de84c92f568414f7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-04 21:03:29 +00:00
Andre Hartmann
910c384766 Git: Forbid adding empty branch names
Change-Id: I4f9d65b8293198f409078e739bf047faed544dd6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-04 21:03:06 +00:00
Orgad Shaneh
8d5e8f6874 Git: Do not reuse RemoteAdditionDialog
There's no reason.

Move it to the cpp file while at it.

Change-Id: I365443fa58db278777ec2f06ea172e9f91992287
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-04 20:44:15 +00:00
Andre Hartmann
861d30cf68 Gerrit: Set focus to password in AuthenticationDialog
... if the user name is already filled.

Change-Id: I4ba72d8a74e583bd280b2fe3715bed81a78c516f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-04 20:40:19 +00:00
Orgad Shaneh
e575a60508 Git: Do not re-use diff controller
When the controller is re-used, the file list is not refreshed.

This doesn't cause a leak, since DiffEditorDocument::setController
deletes the previous controller if already set.

Task-number: QTCREATORBUG-17815
Change-Id: Ic30ef15f9df4fa1cc196dcd175e2df44a88b2f89
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-03 11:48:39 +00:00
Andre Hartmann
9a977a23dd Gerrit: Assure trailing newline when saving .netrc
Change-Id: I919868c0d58f1ac14c1ae15479b11ce15043e042
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-03 05:59:47 +00:00
Andre Hartmann
1c36a6b274 Gerrit: Fix writing .netrc configuration file
The file is expected in the home directory, but was
written in the current working directory.

Change-Id: I4c91f8d706a26331c6b6c878d38ac3556f3ca9b7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-03 05:58:54 +00:00
Orgad Shaneh
45a84ea6b5 Gerrit: Replace bool argument with an enum, and merge url getters
Change-Id: I82035b37de31830f26297944ea0fce8b898201a4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-03 05:43:01 +00:00
Orgad Shaneh
cecaa6fbe7 Gerrit: Initialize pointers in AuthenticationDialog
They are initialized in the ctor, but be on the safe side.

Change-Id: I59ac141ecbaaefe08821f7a43cfcfb09233d54aa
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-02 10:45:58 +00:00
Orgad Shaneh
d32f53e176 Gerrit: De-duplicate regular expression matching
Change-Id: I2bc3b2d5261153231204550634ece45d1038e5d9
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-02 10:45:53 +00:00
Orgad Shaneh
f7a778690d Gerrit: Support REST query for HTTP servers
Change-Id: Icc164b9d84abe4efc34deaa5d19dca167fdb14e1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-02 06:23:49 +00:00
Orgad Shaneh
ffbdfb883a Gerrit: Improve curl detection
Until Git for Windows 2.12.0, curl was shipped twice - a MinGW version
in mingw{32,64}/bin, and MSYS2 version in usr/bin[1].

On 2.12.0, the MSYS2 version was removed, leaving only MinGW.

The plugin only searches for curl in usr/bin, so it is clearly broken
with 2.12.

There is no reason to add mingw*/bin to GitClient::gitBinDirectory()
(and return a list), because there are no other useful tools there. The
other tools that use gitBinDirectory are patch and ssh, which are both
in usr/bin.

[1] https://github.com/git-for-windows/git/issues/1069

Change-Id: I5eb5fa727fa384835792c59fd018fdfa31594927
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 12:09:45 +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
Orgad Shaneh
0995cf22ab Gerrit: Store full user details in server
This is needed for REST, which never returns user name (only account id,
full name and email)

Change-Id: Ia4e3cca15a80a26b26f5f69edfc83a18e4c1fa1b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 13:57:31 +00:00
Orgad Shaneh
bae0f1406e Gerrit: Some more cleanup in the parser
Remove const QStrings for keys. Use string literals instead.

Change-Id: I03c055b4fb53c5cceb5b67c7c9cd8df708130d05
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 13:57:22 +00:00
Orgad Shaneh
1418d6ab1c Gerrit: Factor out user parsing
This has several advantages:
1. It removes duplicate logic.
2. It is now clear where we use username and where full name.
3. Reviewers now appear with full names (broke by
   9f697128c3).

Change-Id: I5729abc9006cec0d0cb615b01c8ace5def60ce27
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 13:57:16 +00:00
Orgad Shaneh
1e89c617f4 Gerrit: Refactor actual output parsing from its setup
Change-Id: I5cf4c75dfbe1620a59cebc756e4e138957cf635e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 13:57:11 +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
Orgad Shaneh
d319e66811 Gerrit: Add curl to settings
Will be used for REST queries.

Change-Id: Iad5c70c8451764da691120b42e45d0991a757149
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 09:58:28 +00:00
Orgad Shaneh
037a96aefd Gerrit: Minor cleanup in GerritModel
Simplify argument list handling

Change-Id: I4d3b676f3de0b0b1ba54edae3cd8a27e9069493a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-23 21:12:19 +00:00
Orgad Shaneh
7a3b216961 Gerrit: Minor de-noise
Change-Id: I5ed6fcd8f74b982a7b17d924234bffe7c1a8019b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-23 21:06:24 +00:00
Orgad Shaneh
151ae22bb9 Git: Fix "additional tools" path with "Git for Windows"
They're in usr/bin now.

Change-Id: I5efe5f7fcaf1f74393624b9bb8dd0ab3f0075d3e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 13:07:08 +00:00
Orgad Shaneh
351f6b8f11 Gerrit: Improve default SSH lookup
* Append exe suffix
* Detect also if not found (for example, when upgrading from msysGit to
  Git for Windows).

Change-Id: I9c47f0f4e54e957e21e224f100c2959dc1884ec2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 13:06:11 +00:00
Orgad Shaneh
f3f5a16f27 Gerrit: Fix initial refresh
when the fallback host matches the remote.

Change-Id: I2c630739db4b698acdcf51f6b663070cfd5ecc4d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 12:15:26 +00:00
Orgad Shaneh
da3f9379c1 Gerrit: Improve server encapsulation
Change-Id: If78fa05e0b328a86e699ba79673999650b05a7ef
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 12:14:57 +00:00
Orgad Shaneh
71c2352e4b Git: Fix parsing of "already merged" files in merge tool
If you have several files that require merging, and you externally resolve
(and git add) some of them, the following message appears:

foo.cpp: file does not need merging
Continue merging other unresolved paths [y/n]?

We don't identify the first line, so the second one is lost too.

Change-Id: I54c579910656c07be7e6b3236551257443fe8fb9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 12:13:58 +00:00
Orgad Shaneh
86f32f5b9c Gerrit: Ignore default port when comparing servers
The user can have the default port set in .ssh/config

Change-Id: I2b59b224c15ed32326e7daa2e33dbb9fe398a137
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 12:13:00 +00:00
Orgad Shaneh
4d402664c6 Gerrit: Place newer changes first
Change-Id: I14c5fad3061cac9656ddba49a6a8d6e3bdb934f3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-23 07:35:19 +00:00
Orgad Shaneh
2cf2aca136 Git: Remove last "slots"
Change-Id: Id628004ccb7e00b44bb5639072a081ed6ca8c852
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-23 06:28:08 +00:00
Orgad Shaneh
9f697128c3 Gerrit: Remove now unused member
+ fix bold unreviewed changes logic.

Missed in f7bd558883

Change-Id: I7463b476e9591e8a0d22dfa8c63eea51fea0d4f4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-23 06:28:00 +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
Montel Laurent
f3c8a2db1e Use isEmpty() vs "count() == 0"
Change-Id: I9b3103fbc4e881693039c1a5e81f0d2b97803978
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-02-22 10:27:14 +00:00
Montel Laurent
aa8c4aad16 Add spacer between widget and dialogbox button
So layout is ok when we resize this dialogbox

Change-Id: I1b6bec39547808795ae9e516f6a4aaa20d892b35
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-21 08:58:49 +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
f7bd558883 Gerrit: Simplify query context
Run only a single query per context.

Change-Id: Icf86e06ab60f8d74ab1de092c6c7e41570423d2e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-15 10:04:35 +00:00
Orgad Shaneh
336adaa604 GerritDialog: Support multiple remotes
Still SSH only for now...

Change-Id: I9b007253bcf6c65d4d44a3ad5792ea1e886707d0
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-15 09:55:37 +00:00
Eike Ziller
e724934393 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	doc/src/qtquick/creator-tutorial-create-qq-project.qdocinc
	doc/src/qtquick/qtquick-creating.qdoc
	doc/src/qtquick/qtquick-uiforms-tutorial.qdoc
	share/qtcreator/welcomescreen/qtcreator_tutorials.xml
	src/plugins/git/gitgrep.cpp
	src/shared/qbs

Change-Id: I6f4d168d888d9547c3af0819f79cc9ebb4186ca0
2017-02-14 15:32:04 +01:00
Orgad Shaneh
4253588b96 Gerrit: Replace 0 with nullptr
Change-Id: I5e644c36ddd8a018dc2c8a3170e3d556d0ebefee
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-13 21:24:22 +00:00
Orgad Shaneh
0fbe2a125b Gerrit: Use short user name for marking owned changes
Gerrit provides this data. There's no reason to wait for the query's
result to determine who I am.

Change-Id: Icd0f08fd08cf428dfbadf88224ae21bd4dbc207f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-13 21:24:14 +00:00
Orgad Shaneh
ba058f3a29 GerritDialog: Use member initialization
Change-Id: Ic7e4987f1eb14280293d4af4da10dfc4b3efbbf3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-13 07:18:18 +00:00
Andre Hartmann
95e6dfe8e0 Git: BranchDialog: Disable buttons when selection disappears
Steps to reproduce the old and wrong behavior:
1. Open branch dialog
2. Select a branch
3. Select checkout
4. Branch is checked out, but no longer selected
5. Buttons like "Log" stay enabled, but don't serve
   any purpose

Change-Id: I3974b7cb87553d1ff57fd5578b908f02c949a509
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-09 11:26:39 +00:00
Andre Hartmann
fd8ee7f044 Git: BranchDialog: constify local variable
Change-Id: I3c7d1fe63471127cd2d4b344d2341ccf6c3c93c0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-09 05:24:41 +00:00
Orgad Shaneh
148e793dec Git: Prepend -e to the pattern on grep
This fixes searching for patterns that start with dash.

Change-Id: I824f64151842008a034757de6a00fd8a6cc46d72
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-02-07 19:57:58 +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