Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-04-08Prepare 4.3.1-SNAPSHOT buildsMatthias Sohn2-18/+18
Change-Id: Ide5a9401f66b246cab18e66d3a2046f7c22cabb6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-07EGit v4.3.0.201604071810-rv4.3.0.201604071810-rMatthias Sohn2-2/+2
Change-Id: If4a677af68862a663b1fc0cdc56b867f9c7193b8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-07EGit v4.3.0.201604071045-rMatthias Sohn2-2/+2
Change-Id: I26ca17f5ce5c83bea828ee642fdfcdf4708c25d7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-03When running "Commit" action open staging view instead of commit dialogMatthias Sohn5-0/+35
Add a preference to allow switching back to the old behavior of the commit action to open the commit dialog. By default it now opens the staging view. After opening the staging view auto-select and set focus on unstaged files if there are any, otherwise set focus on the commit message. The commit dialog is still used by CleanupUncomittedChangesDialog. Bug: 490121 Change-Id: I604f31268f83ab11c3f3a869edf3c7121f0e6478 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-04-02Move EclipseAuthenticator and EclipseProxySelector to egit.coreMatthias Sohn1-1/+2
These classes don't have any UI dependencies hence move them down to the org.eclipse.egit.core bundle. Change-Id: I2da6c99bc32f155ad7b9bec21aac0fb0942a595b Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-03-22Test stability: fix FeatureFinishSquashTestThomas Wolf1-19/+5
The test didn't wait for the shell to open in AbstractFeatureFinishHandlerTest.finishFeature(). Unfortunately, that shell didn't have a title, and was thus a bit inconvenient to wait for. * Give that shell (a TitleAreaDialog) a title. TitleAreaDialog.setTitle() does not set the shell's title! * Simplify the code: use the async clickContextMenu instead of the sync variant wrapped in an asyncExec. Change-Id: I5e26490682821888b4f62da8a323cbc1aeeaded4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-03-21Remove session properties when disconnecting a projectThomas Wolf1-0/+20
Disconnecting a project left the session properties for the RepositoryMappings still attached to the resource info in the Eclipse resource tree. This prevents timely garbage collection of no longer used repository instances because the mappings contain hard references to repositories. Moreover, potentially stale properties might become active again when the project is re-connected. Change-Id: I845c708d3d98ba285c8db94edd2ed14deebd29fb Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-03-20Fix refresh after re-connecting a project with submodules insideThomas Wolf1-5/+5
Follow-up to commit a8bcee9. When a previously connected, then disconnected project is re-connected, there is no resource change event. Thus the GitProjectData doesn't pick up inner repositories, and doesn't re-set the RepositoryMappings for folders inside the project that contain submodule or nested repository working trees. Because of another bug that I plan to fix soon (disconnecting a project does not remove the RepositoryMapping session properties), this problem is currently only visible if one quits and restarts Eclipse after having disconnected. (Otherwise, the previous session properties are still set, and everything appears fine.) Thus we need to make sure when a project is shared that we get at least a resource delta including all .git files and folders in the hierarchy. Ensure that by touching all such inner resources. Also, the SharingWizard must not suppress the refresh. Bug: 489696 Change-Id: I1bce767f54bffced241d2a0ad3c7ae8230152199 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-03-15Refresh decorations after re-connecting a projectThomas Wolf4-19/+47
Re-connecting a previously connected, then disconnected project did not refresh the decorations in the project explorer. RepositoryChangeListener was unused, and likewise GitProjectData.addRepositoryChangeListener(). Therefore, all calls to RepositoryMapping.fireRepositoryChanged() had absolutely no effect. Thus I have removed all these calls and the method. Interesting bit of EGit history: the very first version (even before EGit became an Eclipse project) of GitProjectData contained what is now known as the RepositoryCache (the one in EGit). The RepositoryChangeListener indeed was notified on changes in a repository. In that original commit, there was exactly one such listener: in the git decorator. Through various refactorings, RepositoryCache was extracted from GitProjectData, and then IndexDiffChangedListener appeared. RepositoryChangeListener became unused; GitLightweightDecorator was changed to listen on index diff changes in commit f332331. Nowadays, this RepositoryChangeListener is notified not on repository changes, but whenever a new RepositoryMapping is added to the Eclipse resource tree. And that is exactly what is needed to fix bug 489696: when a previously connected, now disconnected project is re-connected, there will be no resource change events (the project is known in Eclipse's resource tree already, and adding new RepositoryMappings as session properties doesn't trigger a resource delta). There also will be no repository or index diff related events (provided the repository is still known to EGit, for instance because it is in the Repositories view, or because there are other projects from that repository.) So the GitLightweightDecorator will not refresh decorations. Using a RepositoryChangeListener (again, after 5 years) the GitLightweightDecorator can correctly refresh the project explorer in this case. Since this listener is no longer invoked when a repository changes, but when a new RepositoryMapping appears, I have renamed and re-purposed the interface to RepositoryMappingChangeListener. Bug: 489696 Change-Id: I2b59cea1f1500cbdde554fff28b676456c8462d8 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-03-14Support copy/move of workspace if Git repository is under workspaceMatthias Sohn1-2/+4
If git repositories are located under the workspace path moving or copying the workspace broke the repository path information in .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs since all repository paths were stored as absolute paths and paths of repositories located under the moved or copied workspace weren't matching this persisted paths anymore. Fix this by storing the repository path relative to the workspace root if a repository path is located under the workspace root. For repositories not located under the workspace root still store the absolute path since otherwise their path would break if the workspace is moved or copied. Store this in a new preference and still maintain the old preference with list of absolute repository paths in order to ensure compatibility with older EGit versions. Bug: 358285 Change-Id: Ib73b76eb1d63587a767fec59c076fbe51c75e2f1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-03-13RepositoryCache: do not prematurely remove submodulesThomas Wolf5-15/+232
Basically we have no way of knowing when we no longer reference a repository. In our code alone, there may be RepositoryMappings and RepositoryNodes directly referencing a Repository, but some views may also have direct references to Repository instances. We therefore cannot explicitly remove repositories from the RepositoryCache, since we have no efficient and 100% reliable way to determine whether a Repository is still in use somewhere. Therefore the RepositoryCache relies on weak reference semantics. Before https://git.eclipse.org/r/#/c/62066/ , this whole mechanism was broken anyway because the IndexDiffCache had no way to remove an IndexDiffCacheEntry instance, and those instances had hard references to the Repository. So once there was an IndexDiffCacheEntry for a repository, that Repository instance would be kept forever. https://git.eclipse.org/r/#/c/62066/ itself was a wrong approach because it neglected that some repositories might never be "configured" repositories visible in the Repositories view. Such repositories would be removed from the RepositoryCache while still in use. Submodules and nested repositories are affected by this, but so can top-level repositories. The approach taken in this change here fixes this. First, we go back to relying solely on the weak reference semantics of the RepositoryCache. Note that doing so does not give any guarantee about when exactly a no longer used and only weakly reachable Repository instance will actually be removed from the cache. Then we at least make sure that we don't keep any hard references around. That's more difficult than it may seem: * Replaced all hard references to Repository in IndexDiffCacheEntry. We now only use the repository's git directory, and use that to get the repository from the RepositoryCache, if it still is there. * The oldIndex DirCache in an IndexDiffCacheEntry also had a hard reference to the Repository. Use a DirCache.read() variant that doesn't set that link -- it's used only for writing a DirCache, which we don't do. Note that this is a bit fragile as it relies on an implementation detail of JGit, but for now I see no other way. * Even worse, some Eclipse internals do keep around hard references to some "last selection"s. Those may contain no longer used RepositoryNodes from the repository view, which still reference the Repository instance through a hard reference. We have no real way to reliably ensure that these Eclipse internals forget those nodes. Therefore we have to ensure in RemoveCommand that we actually do null out these Repository references once we're sure we have removed the node from our view. (The two places I found where Eclipse holds on to such defunct nodes are WorkbenchSourceProvider.lastShowInSelection, set when the "Shown In..." context menu was last filled, and the CommonViewer, which also remembers the last selection.) * Our own RepositorySourceProvider had a private field referencing the last selected Repository. The RepositorySourceProvider is a singleton that is instantiated very early and then kept around forever. That was resolved by using a weak reference for the repository. * The EclipseContext also managed to (indirectly) hold on to a hard reference to a Repository instance through the context variable we provided. That was solved by not passing the Repository directly as the context variable defined by RepositorySourceProvider but again only the git directory. * RebaseInteractivePlan has a static global cache of plans and each plan had a hard reference to a repository. A plan is computed when the view is opened, even if never executed. That accumulated hard references to repositories. Solved by using a weak reference. * The Eclipse resource tree's DataTreeLookup has a static cache of instances that are re-used but not cleared after use. Those may keep references to our RepositoryMapping session properties for some time after the IResource to with the property was attached has gone. The test explicitly accounts for this. In the full test run in maven, more problems showed up in a heap dump taken just before we test for no cached repositories in GitRepositoriesViewRepoDeletionTest: numerous FileRepository instances from earlier tests were still referenced. * The EclipseContext retains some handler activations of ActionHamdlers of anonymous Action subclasses of SpellcheckableMessageArea, which reference the area through this$0, which itself keeps a reference to the CommitDialog through this$0, which means we keep the CommitMessageComponent, which has a hard reference to the Repository. Solved by using static subclasses that reference only the SourceViewer. * The Eclipse NavigationHistory keeps around references to some CommitEditorInputs, which also have a hard reference to a repository. * The synchronize view references a repository through its GitSynchronizeData. Resolved in test by keeping the synchronize view closed. * The FileRepository from testCompareWithPreviousWithMerge was still referenced from the job from CompareWithPreviousActionHandler even though no such job was running anymore. Referenced in the ProgressMonitorFocusJobDialog, which was still kept around through its fontChangeListener (an inner non-static class in the ultimate ancestor class Window), which apparently somehow was still registered.. Unclear why or what happened there. Not resolved. * Same thing with testRevertFailure; referenced from RevertCommitOperation from the job in RevertHandler from ProgressMonitorFocusJobDialog. Unresolved. * Anonymous actions in SwitchToMenu still reference a long gone repository from test method selectionWithProj1. Unclear why and unresolved. * Some repositories from earlier tests were still referenced through long defunct RepositoryNode instances. Unresolved. * RepositoryPropertySourceProvider has a hard reference to its lastObject, and the RepositoryPropertySource has hard references to the configs, which may have hard references to the Repository. Resolved in test by closing the property sheet; unresolved in general. Because we can't explicitly remove items from the RepositoryCache, we also cannot explicitly remove IndexDiffCache entries. The only thing we can do is to ensure we remove IndexDiffCacheEntries when we detect that a repository in the cache no longer exists (has been garbage collected, or its git directory no longer exists.) Additionally, the resource change listener of an IndexDiffCacheEntry unregisters itself when it finds its repository has gone. I cannot really claim that this still fixes bug 483664 because there is absolutely no way to ensure that repositories vanish from the RepositoryCache in a timely manner. But it's a best-effort attempt to at least try, and at the same time not to evict repositories from the cache prematurely. The test explicitly invokes System.gc() in an attempt to make the JVM actually reclaim weakly reachable objects. This is not guaranteed, but appears to work in practice: the test thus only shows that the obvious places where we kept hard references are indeed resolved, and the repository does indeed vanish eventually. But see the "unresolved" items above: there's no guarantee that some view or action handler or Eclipse internal class doesn't somehow still manages to keep a hard reference and thus prevent reclamation. Finally, testing for an empty RepositoryCache must ensure that the RepositoryChangeScanner does not interfere; otherwise that may temporarily hold hard references to repositories. Solved using a scheduling rule. Change-Id: I3f437caccd58d6c9fb4187f66d9f53e7834a5224 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-03-02Test stability: GitRepositoriesViewRepoDeletionTestThomas Wolf1-6/+3
Must click the menu synchronously. Change-Id: I5dda8ddd48387670c36e12bd6057ac415cef2cc2 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-02-29Decorate IFolders that are submodule working directory rootsThomas Wolf1-0/+18
Introduce a new configurable submodule text decoration used for folders that are submodule working directory roots. (Or working directory roots of nested repositories.) The default shows the a dirty indicator, the branch, branch state, and the head commit's short message. The repository name is omitted since it'll always be identical to the folder name. Added a new variable for the short message of the head commit. Change-Id: I75460fd59f2e6c9bd06e82a1966e3d06f97ab709 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-25Fix recognition of submodules in folders.Thomas Wolf2-0/+314
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-22Allow filtering of Gitflow feature branches in checkout and track dialogMax Hohenegger1-1/+7
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: 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-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-17Fill FetchFromGerrit wizard for more clipboard contentsThomas Wolf1-0/+140
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-13Ensure "Push HEAD..." action is enabled also when HEAD is detachedMatthias Sohn3-4/+49
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 Istria1-0/+104
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-11Make AddToIndex/RemoveFromIndex work for multiple repositories againThomas Wolf2-21/+207
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 Wolf1-0/+11
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-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-23[test log] Unify pom.xml for tests and configure JVMThomas Wolf1-28/+0
- Move the mac and not-mac profiles into the global pom. - Move the coretest.vmargs (empty) and uitest.vmargs (with defaults) there. - Remove the profiles for selecting the target platform. Target platform can be configured directly, e.g.: $ mvn clean install -Dtarget-platform=egit-4.4 - Configure max heap size (1GB) and max perm gen size (150MB). Max values observed by monitoring JVM during Maven build were ~400MB (heap) and ~100MB (permgen). Change-Id: Ia210bad67889cdad9dbf269216a1554af249a9ed Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-21Prepare 4.3.0-SNAPSHOT buildsMatthias Sohn2-18/+18
Change-Id: I706e98e52ed35db93c830b82eccac6db83ee20df Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2016-01-20Properly clean up caches when a configured repository is removedThomas Wolf1-2/+48
When a repository is removed, it was never removed from the IndexDiffCache, which in fact has no operation to remove anything. Only the preference in ResourceUtil is updated. This of course in turn means there's a hard reference in IndexDiffCache to the repo, and it thus also remains in the RepositoryCache indefinitely (unless it is really deleted, not just removed from the view). Clean this up: 1. IndexDiffCache listens on changes to the preference storing the configured repositories and removes any stale cache entries upon changes. 2. Individual cache entries really clear all listeners, and cancel their jobs when disposed. 3. The RepositoryCache also listens on that preference and also removes stale entries proactively. Bug: 483664 Change-Id: I8c20d4e8821e6c5d9fa7e62191a79275bef58bce Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-01-07[test stability] trying to stabilize recently failed unstable testsAndrey Loskutov1-2/+5
Change-Id: Ibf8298ebd16ec55a7320aeef5303b6006432f8ca Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-12-30Add tests for Gitflow command enablementMax Hohenegger4-11/+137
- package explorer on project selection Change-Id: I96eda381a8d909b48e538c09d4e1c535ba71b81b Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-11-30Extract non-decoration things into new IResourceStateThomas Wolf1-8/+8
Separates UI-related things like branch names (actually labels) from the state of the file in the repository and enables use of this state elsewhere without incurring overhead for name calculations. Bug: 355809 Change-Id: If283be82612b15d14c773eea628777eb79f263ae Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-10-26Do not wrap commit message footer linesThomas Wolf2-0/+59
Wrapping commit message footer lines may break the expected format of those lines. Bug: 478659 Change-Id: I0169c4cc278318a702bbed2c6e5d7ff99038406f Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-10-21Minor improvement in test for repository deletionThomas Wolf1-1/+6
Besides verifying that the shared project has gone from Eclipse when the repository is deleted also verify that the project is gone on disk, and (since that project was the only one there) even the whole working directory is gone. Instead of just checking for the working tree, do check for each one explicitly so that in case of a failure it's clearer what exactly failed. Change-Id: I8676c0c173ff923ccd799ff9d490c7f8152bbd17 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-10-17Don't delete projects on disk unless the user said soThomas Wolf1-0/+41
If the user chooses not to delete the working tree when deleting a repository the projects from that repository must not be deleted but only removed from the workspace if the "Remove projects from workspace" option is checked. Bug: 479964 Change-Id: I4435d049703f207224b0847a20742d240483abdf Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-09-28Prepare 4.2.0-SNAPSHOT buildsMatthias Sohn2-18/+18
Change-Id: Ib8648c6885c90f0c812fb06cf79defdd9368e301 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28Prepare 4.1.1-SNAPSHOT buildsMatthias Sohn2-18/+18
Change-Id: Ic04e32bea8bdc7c351cc6ddddb2e33012f952829 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-28EGit v4.1.0.201509280440-rv4.1.0.201509280440-rMatthias Sohn2-2/+2
Change-Id: Icfa40a868fe197aaf761e0323af0fffbe9107a90 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-23Allow saving feature finish options as defaultMax Hohenegger5-0/+45
- added checkbox to feature finish dialog - save defaults to preference store - re-store options from preference store - extended UI tests Bug: 478056 Change-Id: I232c338dab209dd0829f3fdb683b64441e22b7b0 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2015-09-22Refactored feature finish UI tests to reduce redundancyMax Hohenegger4-169/+123
Change-Id: I4f70f569736d171eddfc11088bb210939eede659 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2015-09-21Added support for keeping branch after Gitflow feature finishMax Hohenegger3-3/+121
- added new option to API - added checkbox to feature finish dialog - added tests and UI tests Bug: 477786 Change-Id: I4e58529378c976c83b7564e817db6f7be00d0cec Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2015-09-21Use save action to add missing @Override annotations on saveMatthias Sohn1-3/+9
Change-Id: I3c55808a0279ac10a23be40739306259091037d8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-20Obey hyperlink preferences in SpellcheckableMessageAreaThomas Wolf1-2/+19
and in CommitMessageViewer in git history. 1. Only open hyperlinks on direct click in read-only views; in editable views, this is too confusing and too often opens the hyperlink when the user just wants to set the caret. 2. Make the viewer react on changes in the general hyperlinking preferences. Both for the master switch and for individual contributed hyperlink detectors. 3. Ignore disabled hyperlink detectors in syntax coloring (by not storing them once and for all times in HyperlinkTokenScanner but getting them freshly from the viewer configuration for each run). 4. Always keep the special git history navigation links enabled in the CommitMessageViewer (KnownHyperlinksDetector). The JFace hyperlinking infrastructure actually only supports hyperlink detectors that either open on a specified modifier key combination, or on the default combination, which is the one the viewer sets, which is normally the one from the global preferences. If a viewer thus sets SWT.NONE to support direct hyperlinking, the global preferences will not take effect for hyperlink detectors that specify "default", which leads to a rather inconsistent interface, because hyperlinks are then only active when no key is pressed, but become inactive when the modifiers from the global preferences are pressed. We work around this by actually duplicating hyperlink detectors when the viewer specifies SWT.NONE. This ensures that hyperlinks can be opened (in read-only views) either by direct click or also when the modifier given by the global configuration is pressed. Bug: 411809 Change-Id: Icfcfe62b127370be36bced8b1430b764d31b75a6 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-17Add missing @Override annotations to all EGit bundlesLars Vogel29-0/+78
Bug: 477689 Change-Id: I490e6558db5133a60caf00af2b996feae0e2e832 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-16Configure version of tycho-surefire-plugin in parent pom.xmlMatthias Sohn1-1/+0
This ensures we use the same version in all modules. Change-Id: I4521e8cf52a23465923efb0b3a2dadcb011611ee Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-13Check for objects adaptable to IResource in ShowBlameActionHandlerThomas Wolf3-60/+361
Includes a new test. Some refactoring in LocalRepositoryTestCase to avoid having to duplicate test repo creation, and to reduce code duplication. Bug: 401156 Change-Id: Ib78d62f11d3a5a52c672bb192e8baba189c49829 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-09-10Rewrite CommitMessageViewer to use JFaceThomas Wolf1-9/+7
The goal is to get the commit message viewer in the git history view to use the same (configurable) hyperlink colors and other hyperlink infrastructure as the SpellcheckableMessageArea. This is complicated by two things: * custom hyperlinks to commits with custom opening, and * no clear model-view separation; getting the data from git, formatting, and coloring were all lumped together. Therefore, improve the model-view separation: * Get rid of hand-crafted SWT text range coloring. CommitInfoBuilder is restricted to getting the data from the repo, formatting, and returning semantic information (hyperlinks, header and footer ranges). It doesn't do syntax-coloring anymore. * CommitMessageViewer uses a partitioning on its document to split it logically into header, body, and footer. It also gets a custom hyperlink detector to deal with the custom commit hyperlinks. * GitHistoryPage uses a presentation reconciler with damager/repairers that know how to syntax-color each partition (and hyperlinks). * Made the HyperlinkTokenScanner a bit more flexible to rebuild the italicizing of Signed-off-by footer lines. Fixed a bug along the way (if "fill paragraphs" was on, it would put footer lines onto one line). Visually, there are no changes except the colors of hyperlinks, which now follow SpellcheckableMessageArea and are configurable. Bug: 340623 Change-Id: Ie1b5907110ba716d262e4b5773fed7e3a5150d0d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-10Fixed: Specifying non-existing master does not abort initializationMax Hohenegger1-20/+116
- abort init operation if master is missing - added validator for missing master branch - ask user to create master branch - ask user to create initial commit if repository is empty - added control decorations to hint at source of problem - adjusted tests Bug: 475788 Change-Id: Ief9b1a361a3dce83358e7b84034bb6a477ec92e4 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>
2015-09-07Simplify hyperlink syntax coloring in SpellcheckableMessageAreaThomas Wolf1-3/+9
Turns out we don't need to use a special TextAttribute, and neither do we need a special damager/repairer. Works nicely out of the box. Change-Id: Id2f0d36f3c2018c047ad1f4cf65e148c960f236d Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-09-07Use standard link colors in SpellcheckableMessageAreaThomas Wolf1-4/+5
There are at least three different color definitions for hyperlinks in Eclipse: JFacePreferences, EditorsUI, and a system hyperlink color. Use standard colors instead of hard-coded blue (0,0,255). Syntax-color hyperlinks using the JFace HYPERLINK color, and make the hyperlink presenter use the configured hyperlink color for editors. Both of these can be customized by the user through (already existing) preferences and thus can be adapted to the currently used theme. (Harmonizing the discrepancy between the JFace and the EditorsUI colors is bugs 199256/135224.) Change-Id: Id0d058018ee8f6fa2279371c3f5786a3dc24b690 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2015-09-02Fix hyperlink display in SpellcheckableMessageAreaThomas Wolf2-1/+124
This is first and foremost a syntax coloring problem, and should be handled as such. This change implements that: * Adds a token scanner that recognizes hyperlinks using the configured hyperlink detectors. * Adds a presentation reconciler with a damager/repairer that uses this token scanner. * Gets rid of the overridden hideHyperlinks() method -- if we do proper syntax coloring, this can wreck havoc when the text is edited (the super implementation does some StyleRange cleanup; if that is omitted, a stale and possibly out-of-bounds range remains). * Uses SWT.UNDERLINE_LINK to style hyperlink partitions. * Adds a few unit tests for the tokenizing. * Adds org.objenesis to required bundles in org.eclipse.egit.ui.test to enable mocking. In my manual UI tests, this syntax-colors hyperlinks nicely in the staging view, spell-checking works, auto-wrap works, whitespace display works, the "hand" pointer appears only over hyperlinks, and bug 471355 is solved. It also has no adverse effects on the commit viewer or the git history view. Bug: 471355 Change-Id: I623ead62d9600028973353cf63183638a1e06a3e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2015-08-24Initializing a Gitflow repository should allow changing branch namesMax Hohenegger1-4/+59
- added new dialog that opens when initializing the repository - changed API for "git flow init" to accept a config PoJo - deprecated redundant API - added UI test Bug: 475293 Change-Id: If7e314d749b0fcd3e77eb82576336c1aa20d4d14 Signed-off-by: Max Hohenegger <eclipse@hohenegger.eu>

Back to the top