Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-02-29Safe preference reading of sash weights in GitHistoryPageThomas Wolf2-6/+27
Preference values shall be treated as unverified external input and be read in paranoid mode. Preferences can become corrupted; we can't trust them. In no case shall garbled preferences cause the application to fail. Armor reading of sash weights and fall back to the default values if the stored values cannot be read. Bug: 488666 Change-Id: Ib22dbf855c9dde10108b6a90cc9ca7fcd7688966 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-28Test stability: properly wait for refresh jobs in Gitflow testThomas Wolf1-3/+5
SWTbot tests shall never ever just sleep(). That's a sure recipe for an unstable test, and caused the instability in FeatureFinishSquashHandlerTest. Better wait for a defined job family, if available, or even better until a defined event occurs. Here, however, we have neither a family nor an event to wait for. Resort to waiting until things have quieted down. Also use setText() instead of typeText(); the latter may fail if the keyboard layout is unknown to SWTbot (such as my MAC_DE_CH layout). Change-Id: Ib2e4819a7af91450140a140e2b3f797d24ae9396 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-27Always listen to POST_CHANGE events in GitProjectDataThomas Wolf2-5/+3
Offering the option not to listen to POST_CHANGE events makes no sense anymore; GitProjectData always needs to listen to these events in order to detect submodules in subfolders. Also, the only call to attachToWorkspace() passed true anyway. Change-Id: I4be95fe965f491296854f571098261a4ba4933fe Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-27Fix sorting and grouping of staging entries by stateMatthias Sohn4-14/+40
- group all states, states which require attention more frequently come first - also sort staged changes pane - alphabetic sorting is the natural order and doesn't need explanation, hence name the button to toggle sort order "Sort by state" and use a new icon depicting that - rename the comparator to StagingEntryComparator since it's now used for both unstaged and staged changes Bug: 473919 Change-Id: Ia6c165f252bb293d77251e4b5cf9dfb63c1c5d53 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-27[staging view] Fixed sort order: added check for "names first" caseAndrey Loskutov1-10/+31
Bug: 487004 Change-Id: I59b0c32c8c077111ebc2e61026961332933e8b54
2016-02-27Do not autofill clone wizard for arbitrary clipboard inputThomas Wolf5-8/+193
The clone wizard would auto-fill also if the clipboard contained arbitrary, non-git related HTTP(S) URLs. This is a regression that was introduced in commit 39f3c68. Auto-fill the clone wizard for HTTP(S) clipboard content not ending in ".git" only if the host is a known git server. A known git server is one from which the user had already successfully cloned a repository over HTTP(S). As a convenience, we provide a very small set of default hosts (git.eclipse.org, github.com, and bitbucket.org). For HTTP(S) URIs that end in .git, we always pre-fill the wizard. Also consider only clipboard content up to the first whitespace (after having removed a potential "git clone" prefix). Formerly, we stopped at the first blank, not general whitespace, and would thus autofill even with multi-line clipboard content like foobar baz .git (No blank in there, just line endings.) Finally, add a few missing braces and remove a spurious trim() call in RepositorySelectionPage. Change-Id: I04e5912b3a28dc911a54dea8255dd64eca58896e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-26Merge "Update Mars orbit repository to R20160221192158"Matthias Sohn5-14/+14
2016-02-26Merge "RepositoriesViewLabelProvider: mark dirty submodules"Matthias Sohn5-29/+116
2016-02-26Update Mars orbit repository to R20160221192158Matthias Sohn5-14/+14
This version fixes signing of Apache httplclient. Change-Id: Ibc15e4d5db755004e821184957a30589e49d013f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-26Check resource.getProject() for null before dereferencing itAndrey Loskutov9-12/+35
Bug: 488538 Change-Id: I886cf1c772aa372fd4bba330541fc8ffb3556198
2016-02-26RepositoriesViewLabelProvider: mark dirty submodulesThomas Wolf5-29/+116
Prepend the dirty indicator "> " to the text label if the submodule has changes. Requires that the RepositoryCache ensures that all repositories are registered under their normalized git directory file name (normalized meaning not containing . or .. components). The RepositoriesViewContentProvider uses a SubmoduleWalk, and that returns non-normalized paths, while the RepositoryMappings always use normalized ones. That results in two different Repository instances for the same git repository; listening for index diff changes on one won't trigger on the other one, and thus labels in the repositories view wouldn't update. Change-Id: Idf4002debdda94b35b278bff8194cde2ecba739c Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-25Fix recognition of submodules in folders.Thomas Wolf16-130/+548
Most of the basic plumbing for this was already in place, but it looks as if the implementation was never really finished. For instance, GitProjectData is prepared to record RepositoryMapping on container level, not just for projects. The feature was just not used, and many places in EGit make assumptions that imply that a project is fully within one repository. This is a first commit to get rid of this assumption, and to properly deal with submodules that exist only as folders in the Eclipse workspace. Augment the already existing resource change listener in GitProjectData to also handle additions of DOT_GIT resources. In that way it'll pick up submodules as they appear in the Eclipse resource tree. RepositoryMapping.getMapping(IResource) must consider mappings entered for folders below the project level. One mustn't jump directly to project level; that will skip any submodules that might have been applicable. StagingView: no need anymore to use a submodule walk. The RepositoryMapping for any resource will point to the correct repository, even if it's a submodule. Not using a submodule walk also avoids problem with the walk returning non-normalized git directory paths that may contain ".." segments, while our RepositoryCache uses normalized paths. This may yield two versions of the same repo in the cache, and listening for index diff changes on one wouldn't trigger on the other. GitResourceDeltaVisitor: must descend into folders even if the repository doesn't match on project level. Otherwise submodules are not updated. For scheduling rule calculation, it is not sufficient to search for projects in the repository's working directory. One also needs to include projects containing the repository working directory. Deprecated: * RepositoryMapping.getSubmoduleRepository(IResource) Also changed some uses of RepositoryMapping.getMapping(IProject) to RepositoryMapping.getMapping(IResource). I'd like to have deprecated the project variant, but this needs more careful analysis of the remaining places its used. Properly adding submodule mappings and considering them fixes at least bug 446344, comment 11. Also related is bug 401556, though that was reported for the behavior in the Repositories view, which isn't fixed by this commit yet. However, a selection in the project explorer for a folder belonging to a submodule showed the same erroneous behavior. Added new tests. Bug: 446344 Bug: 401556 Change-Id: I4caa06113b5280114a7816f2c3932711b2fedf08 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-23Make RepositoryMapping use java.nio.file.PathThomas Wolf2-34/+71
org.eclipse.resources.Path.fromOSString normalizes paths. However, the FileRepositoryBuilder returns paths like /some/path/container/../.git/modules/... . If that get's normalized, we end up with /some/path/.git/modules/... , which defeats the subsequent attempt to relativize the string to ../.git/modules/... . Using java.nio.file.Path, we can avoid this premature normalization, and moreover we can create relative paths in way more cases. Change-Id: I19da4aed3a4a8476f6cb4b1466fa5ab75b095f66 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-23Fixed egit-4.6 target platform namesAndrey Loskutov2-2/+2
Change-Id: Ibac9fc4c4515310adc34f57d561a3eb676873b5d Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2016-02-23Remove unnecessary cast to RepositoryMappingMatthias Sohn1-2/+1
The collection mappings is a Collection<RepositoryMapping> so directly assign items in this collection to a variable of type RepositoryMapping and avoid an unnecessary unchecked cast. Change-Id: Idd9a1a58e69fe8a5aa00ec12f66be59d67aef06c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-22Allow filtering of Gitflow feature branches in checkout and track dialogMax Hohenegger7-184/+305
Working with a larger number of feature branches can be tedious, if there is no way of organizing them. A quick way of finding, known, well-named branches, can be a simple text filter. - replaced lists with filtered trees - extended UI test Change-Id: Ifc82c1fece1ed45b6ce929dcd39ecb913ce4615f Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-21Test stability investigation: GitSubscriberMergeContextTestThomas Wolf2-0/+52
I can't get that test to fail locally; neither on native OS X nor on a Linux (Ubuntu 15.04) VM. Yet it fails frequently on Hudson. I don't see anything wrong with the test either. Let's include a lot of debug output in an attempt to figure out what's going on. I suggest we do actually merge this, so that we have the extra info the next time it fails. Hopefully that'll give some hints. I couldn't find a thread dump method anywhere, so I wrote my own. Change-Id: Icdd054c5b7f878771046706f615746e3f47e9b4f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-21Test stability: GitRepositoriesView testsThomas Wolf1-3/+30
Test failure in [1] claimed that no refresh job was scheduled. The RepositoriesView schedules a refresh on its own in response to an index diff change. If a refresh job is already scheduled and not running yet, the re-schedule in view.refresh() has no effect. See JobManager.schedule(). As a result, the JobListener is never notified about a scheduled job. Moreover, if the job is already running, re-scheduling will make it run again, but the JobListener will return already when the currently running job finishes. Therefore, we just need to wait for refresh jobs after having called view.refresh(). That will make the test wait in any case. Timeout can be implemented via a custom progress monitor. [1] https://hudson.eclipse.org/egit/job/egit.gerrit/8154/testReport/junit/org.eclipse.egit.ui.view.repositories/GitRepositoriesViewBranchHandlingTest/testCheckoutRemote/ Change-Id: I2ecd20b4caaf70e00a903366f46da0075afa6a3f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-20Gerrit Configuration... is misleading when switching branchesFrank Jakop4-42/+96
Treat "Commit and Push" as Gerrit push for the currently checked out branch when the repository has a gerrit configuration. Bug: 460500 Change-Id: I6eddab11e58a383cd7a9ebe11226f344e97aa324 Signed-off-by: Frank Jakop <frank.jakop@arxes-tolina.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-19Handle relative paths in RepositoryMapping creatorThomas Wolf2-5/+21
file.getAbsolutePath() with a relative path here resolves against the current working directory of the Eclipse instance. The path is, however, relative to the IContainer being mapped! This causes many of the various occurrences of errors in the log about gone repository mappings, especially those where the absolute path is nowhere near any expected directory. Bug: 456799 Bug: 476011 Change-Id: I9eebf4cb81b7584936f823885db8a5d9340035fd Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-19ResourceStateFactory: avoid converting IResource to IPathThomas Wolf3-67/+73
ResourceMapping.getMapping(IResource) is more efficient than the IPath variant, so let's not unconditionally convert IResource to IPath; this throws away useful information. Bug: 486857 Change-Id: I493df3326877efc618d949e9e631d63ffdc53bf1 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-19Improve performance of SelectionUtils.getRepository()Thomas Wolf1-13/+84
Instead of converting selected elements to an IPath location always and then using RepositoryMapping.getRepository(IPath), try to keep as much info as needed and as possible: if the selection contains IResources, keep them and use the more efficient RepositoryMapping.getRepository(IResource). In my tests on a test workspace with 46 open projects and the git toolbar and global menu enabled, this results in a speedup of the SelectionUtils.getRepository(IStructuredSelection) operation by a factor of about 10 in many cases. This could be optimized a little bit more if we could, instead of using IResources, collect only their containing IProjects and then use RepositoryMapping.getProject(), but I'm currently unsure whether that would actually be correct. See the review comments at https://git.eclipse.org/r/#/c/65510/ . Bug: 486857 Change-Id: Ied35b304c8496c501dbf8109e1c8d5403b962efb Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-18Add Neon target platformMatthias Sohn3-0/+166
Change-Id: Iccdbe4f75aecf5370c3c9bc19956c61478b57d3f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-18Add com.google.gson 2.2.4 to target platformsMatthias Sohn7-5/+19
Gson is used by jgit's lfs bundles. Change-Id: I6063c7b3cf657b8e8ec258f0202a525e79556ecf Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-18Sort target platform definitionsMatthias Sohn7-104/+104
Change-Id: Ib740317cd0aaa2e81702b67e5eeed30bacb461dc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-17Test stability: SynchronizeViewGitChangeSetModelTestThomas Wolf1-3/+5
The test was looking for a tree node with label "GeneralProject". As the screenshot from unstable build 8131[1] clearly shows, the node is labeled "> GeneralProject". Looks like there's some asynchronous decoration going on, and depending on whether the test tried to get the node before or after the decorator ran it would succeed or fail. Remedy by using TestUtil.getNode(), which only requires a substring match, instead of SWTBotTreeItem.getNode(), which requires an exact match. Also relax the assertion on the "<working tree>" node (same as in the following test method). There may be more similar problem spots lurking in here. [1] https://hudson.eclipse.org/egit/job/egit.gerrit/8131/artifact/org.eclipse.egit.ui.test/target/screenshots/shouldRefreshSyncResultAfterWorkspaceChange%28org.eclipse.egit.ui.view.synchronize.SynchronizeViewGitChangeSetModelTest%29.jpeg Change-Id: If0051411196ac0148f2a6289d1dfba1e3d69f61d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-17Added Gitflow convenience command for checking out develop branchMax Hohenegger3-0/+75
Switching back and forth between feature branches, and the develop branch is a frequently used operation for Gitflow users. Hence, there should be a quick way of doing so. Change-Id: I761a2bf4db9ddd3bd32f99541eb512d5f53eefcb Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2016-02-17Improve logging for ExecutionExceptions in GitflowMax Hohenegger2-3/+3
The ExecutionException from automatic error reporting 56ab7c5ee4b08656ed65f2b6 did not reveal much of what actually happened. Wrapping the caught exception should provide a second stack trace, if an error is reported. Change-Id: I58f669864e99abf6c2502f2f9c9c4793fcbccc46 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2016-02-17Avoid extra pop-up dialog in PullWizard when getting remote refsThomas Wolf3-17/+38
Instead, use the wizard container's progress monitor. Bug: 485124 Change-Id: Ic02ee8d26643904976785e42ee9a4b10bc447f26 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-17Fill FetchFromGerrit wizard for more clipboard contentsThomas Wolf2-9/+260
Try to extract a change number from more kinds of clipboard text: URLs, if they look like a Gerrit URL, as well as * simple integers, possibly surrounded by slashes * up to three integers separated by slashes * any of the above followed by /something,like for instance a Gerrit diff screen URL Should handle full and partial Gerrit URL selections, as well as "naked" change numbers. If a change number is detected, content assist is triggered automatically. New tests for change number detection are included. Bug: 486253 Change-Id: I35ea30947343ccaf09b2a6cf4104ad5f35cdda4b Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-17Silently skip EFS resourcesThomas Wolf4-14/+8
Exclude projects located on an EFS from EGit's auto-sharing. Also, it makes no sense to log an error in RepositoryFinder when getLocation() == null. That doesn't necessarily mean the resource didn't exist; it could be provided through an EFS. This is true for projects as well other resources (the RepositoryFinder might consider linked resources, and those might be linked through an EFS.) EGit, like other team providers, cannot really deal with EFSs. Bug: 487912 Change-Id: Ie5a5763c26707f8096fe255f339abe3fce464f10 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-15Fix NPE in Activator$RepositoryChangeScanner.run when shutting down EclipseDani Megert1-0/+4
Bug: 487643 Change-Id: I8a609acfde8b72b11baf5b6fd5b3c032a75e72d8 Signed-off-by: Dani Megert <Daniel_Megert@ch.ibm.com>
2016-02-13Fix image resource leak in SwitchToMenuThomas Wolf4-49/+38
Somehow dispose() never got called, and thus the images created in the constructor never got disposed of. Let's allocate these three images globally; re-creating them every time this menu is invoked doesn't look right anyway. Give the plugin a global LocalResourceManager and make sure the images are obtained from there. Also pre-create a composite image descriptor for the checked-out branch image. Bug: 486594 Change-Id: Ie0d1bd02268a963bbc4f32e5591739dfd4396202 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-13Ensure "Push HEAD..." action is enabled also when HEAD is detachedMatthias Sohn4-7/+57
Fixing a regression introduced by https://git.eclipse.org/r/#/c/63972/ Push should be enabled if HEAD directly or indirectly refers to a commit. Bug: 487078 Change-Id: I13a28252472957ac172fa91fe89406e736f6a34a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-13Wizard to configure pull operationMickael Istria14-4/+997
This is accessible on project's context menu, as "Pull..." just below "Pull". The wizard enables the user to specify the remote or add a new one, and also to specify the remote reference. There is content assist for published remote references, but the user may also pull from non-published remote refs, such as pull requests on Github or patch sets in Gerrit. Bug: 485124 Change-Id: I88122d3fedf10de35a0c1c233b7dd9920bb8c0c7 Signed-off-by: Mickael Istria <mistria@redhat.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-11Fix "Git > Date Format" preference page message bugsMarkus Keller2-11/+5
Fix bad labels. Fix "Date preview" for the "User-defined format". Fix missing preview when opening page with non user-defined format. Bug: 487678 Change-Id: I8adc77e5fe5ca3d90ce913e3b8b08dcf53fd6923 Signed-off-by: Markus Keller <markus_keller@ch.ibm.com>
2016-02-11Make AddToIndex/RemoveFromIndex work for multiple repositories againThomas Wolf6-78/+230
Commit 4e89050 inadvertently introduced the restriction that all resources in the selection be in one repository. However, AddToIndex, RemoveFromIndex, and Ignore previously also worked if projects from different repositories were selected. Remove the restriction on a single repository from the ResourceStatePropertyTester, and simplify the isEnabled() of AddToIndex and RemoveFromIndex action handlers a bit. The ResourceStatePropertyTester is currently used only for these commands in the Team context menu. If is ever to be used with some command for which all resources really must be from one repository, it can be combined with the "resourcesSingleRepository" property test. Performance should not suffer as all repository or index diff operations in the property tester operate on caches. Add new tests to test the "Add To Index" and "Remove From Index" actions for single and multiple repository selections. Change-Id: I71b1ece61cceeb08ee775e7afae33beee2b57b9f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-11Fix logic for detecting whether there are unstaged changesThomas Wolf7-86/+40
Didn't account for conflicts. Add a new hasUnstagedChanges() to IResourceState to have the calculation in (preferrably) one place. (Ok, StagingEntry must re-implement it.) Add assertions in the existing tests in DecoratableResourceAdapterTest for the new operation. Bug: 486983 Change-Id: Iffc29c16f247199945775d37dc719713d087ac64 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-10Move SWTBot screenshots to target/screenshotsThomas Wolf1-1/+1
Hudson jobs should be adjusted: archive */target/screenshots/*.jpg as artifacts to avoid they get removed/overwritten by subsequent builds. Once this is merged, the old srceenshots directories can be removed on Hudson. Running UI tests interactively will still produce shreenshots in the current location at ${project.basedir}/screenshots. Maven will use the new location, and will clear out old screenshots first. Change-Id: I0eaad421438f0b837cfcea9b9049449ce8586c39 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-08Fixed enablement of Gitflow command for creating release from commitMax Hohenegger4-6/+66
Enable the "Start release from...", available in the History views Gitflow submenu, only if the currently selected commit is on the develop branch. http://nvie.com/posts/a-successful-git-branching-model/#release-branches Change-Id: I6f0213b2b57f11b9833be979cbf0b3ca98c93f11 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2016-02-04Use default preferences for preferred MergeStrategyLaurent Delaigue3-2/+27
The default scope was not correctly taken into account. Bug: 485385 Change-Id: If38c2c4402ae6b1d03e1dc471b3be3885432b995 Signed-off-by: Laurent Delaigue <laurent.delaigue@obeo.fr>
2016-02-03Ensure that all source bundles contain about.htmlMatthias Sohn3-2/+5
This is a release train requirement. Change-Id: I4d1fc9f227b70f0605b6f71231fd1ee49a11d5fc Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-02-01Merge "Fixed Gitflow test launch config"Matthias Sohn1-1/+1
2016-01-31[tycho] Make tycho use JDT prefsThomas Wolf1-0/+6
Compilation in maven/tycho should use the same settings as in the IDE. Suppress the warnings, though. Change-Id: I51744f949c7b27a20b8eadb355bc31783d8d9984 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-01-31Use latest SWTBot to get more meaningful screenshotsThomas Wolf3-3/+10
Target platform (mars/egit-4.5): use a snapshot build for SWTBot to get the fix for bug 372209 (take screenshots before @After runs); needs SWTBot 2.4.0.201601261652 or later. Change-Id: Ie875441e6fc736af0c73ca04ce4307958b5bc9cd Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-01-31Merge "Fixed typo in JavaDoc"Matthias Sohn1-1/+1
2016-01-28Merge "Removed unnecessary duplicate Gitflow initialization from test"Matthias Sohn1-1/+0
2016-01-26Merge "Make the gitflow UI tests independent of the keyboard layout"Thomas Wolf3-8/+6
2016-01-26Make the gitflow UI tests independent of the keyboard layoutThomas Wolf3-8/+6
Use setText() instead of typeText(); otherwise these tests fail unless the keyboard layout happens to be en-us (or mac-en-us). Bug: 475804 Change-Id: I891dd82174f43f12a93cae03fad1a68dfc3ae0dd Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-01-26Fixed Gitflow test launch configMax Hohenegger1-1/+1
- added missing org.eclipse.core.filebuffers Change-Id: I8ba8a8d420746f6ceaa564c312e85d7a23b295dc Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>

Back to the top