Skip to main content
aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-05-29Update license to EPL-2.0Matthias Sohn37-76/+150
Bug: 530393 Change-Id: Iea3b247253a97c28043187df0e35daecf518011e Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-05-05Respect gitattributes in the compare editorThomas Wolf1-0/+182
Apply smudge/clean filters. Store the filters to be applied when we create the internal GitBlobStorage and apply them when the stream is opened. Unfortunately this requires quite a few interface changes to pass through CheckoutMetadata. Adds tests for the new behavior, including index edits. Bug: 520693 Change-Id: If7696501f3e1b8f6d99518915b7292e268d656bd Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2018-04-24Silence unusual equals() argument type warningsMichael Keppler6-22/+22
Since Oxygen the compiler can show a warning for non fitting equals argument types. This change silences the warnings by masking out the runtime type. Change-Id: I0c6900cbfbdb133765e4fa6801c73e3f3fe01531 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
2017-12-05Specialized labels for Push dialog buttonsMickael Istria1-2/+2
Bug: 522118 Change-Id: Ib7cd6c44f4e0b863f2111104ed99e99e67908b9d Signed-off-by: Mickael Istria <mistria@redhat.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2017-07-13Toolbar button to switch repositories in git viewsThomas Wolf1-0/+233
Enable the user to quickly switch the staging view, the reflog view, the rebase interactive view, or the history view from one repository to another via a toolbar button with a drop-down menu listing all currently configured git repositories. Switching in one view makes all other EGit views that are linked to the current selection also switch. The current repository of a view, if any, is marked by a check mark in the menu. Use the "repository" image for the new button. Change the icon for "no filter" in history view to avoid a clash: instead of the repository icon, use a struck-out filter icon. Make sure all Git views provide selections that do adapt to Repository. This was already the case for the repositories view, the history view, and partly the staging view. For the reflog view, add an adaptable DTO wrapper around ReflogEntry for the tree. In staging view, add a MultiViewerSelectionProvider modeled after the JDT's SelectionProviderMediator that can provide the selection from whichever viewer has the focus. In the rebase interactive view, make PlanElement adapt to Repository, and fix some other minor bugs: don't clear when the linked selection is empty, don't show "No Repository Selected" briefly when a bare repo is selected, react on the initial selection in createControl() instead of remembering the selection when the view was created. (If the view is hidden, the selection may have changed by the time it is activated and its control is created.) Make the repositories view react on selection changes not only for IResource or File but also for Repository. Add special-purpose selection providers (RepositorySelectionProvider) to the staging view, the reflog view, the history view, and the rebase interactive view that provide a selection that identifies the current repository in those views if it is otherwise empty. Use a RepositoryNode for this to avoid multiple entries in the history view's navigation history. Since all views' selection listener mechanisms do handle a selection that adapts to Repository, this makes all EGit views nicely switch in sync when the "current" repository is changed in one of them. Includes initial UI tests. However, for some unknown reason I cannot get the test for the new button and the selection handling to work, so it is ignored. Somehow the selection in the other views does not get updated when run as a SWTBot test. Testing this is tricky anyway because most of our views load asynchronously one way or another. To be able to detect that for the staging view, I have made it use a WorkbenchJob instead of a plain Display.asyncExec(). Alas, that didn't help for that test. Bug: 518607 Change-Id: I976df6e3bf0363c27b877d995344487bb622f037 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-07-07Improve hard-wrapping in commit messagesThomas Wolf1-0/+41
Preserve the current behavior as much as possible, but relax the rules about wrapping long words. This prevents moving long URLs (or other long "words") to new lines when doing so doesn't improve the formatting. In particular, it'll keep URLs used in references[1] on the line with the reference index. [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=519012#c0&dummy=0&dummy=0&dummy=0 Bug: 519012 Change-Id: Ic13662d6c3eed93957d9486a88fe1c92a1157019 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-06-30FetchGerritChangePage: auto-supply highest patch set numberThomas Wolf1-1/+18
If the change field contains only a change number but no patch set number, automatically fill in the highest patch set number obtained from Gerrit once we have the results of the ls-remote. If the field is the focus control and its contents have changed since we started the content assist, the user might be typing: don't interfere and do not auto-update the field. Bug: 518492 Change-Id: I5fa348aed4b6881c87749bbed6789f97d3e4e1d9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-06-28FetchGerritChangePage: also try to determine the patch set numberThomas Wolf1-29/+60
If we can determine a patch set number, try to build and insert a valid change ref in the Change field instead of just the change number. If the user knows it's valid, he doesn't have to wait for the background ls-remote to finish and can continue right away. If the Gerrit server does not actually have a change for the ref, the fetch will then fail, of course. Bug: 518492 Change-Id: Iddf58173a4272e5d8ef642827372c630184c5370 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-06-25Add ICommitMessageProvider2 for caret positioning in commit messagesStefan Rademacher2-150/+495
The caret in the CommitMessageComponent is placed according to the value of getDesiredCaretPosition() of the first implementation of ICommitMessageProvider2 that provides caret position. In case there are multiple implementations available that provide a defined caret position the second and subsequent positions are ignored. Commit messages are not trimmed anymore to ensure consistency between a provided message and the provided caret position. Includes unit and UI tests. CQ: 13790 Bug: 516867 Change-Id: I1b0ffd33ef37196d53077d09774672c2b033835f Signed-off-by: Stefan Rademacher <stefan.rademacher@tk.de> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-06-13More fitting Decoration Support for ResourceMappings in generalMartin Fleck6-72/+1193
The decoration support for ResourceMappings and WorkingSets is split up to provide a more fitting decoration for ResourceMappings which are not WorkingSets. Includes tests. Bug: 498546 Signed-off-by: Martin Fleck <mfleck@eclipsesource.com> Also-by: Stefan Dirix <sdirix@eclipsesource.com> Change-Id: I6e6306d7f00a3a26ef86178f5261a00e1804db64
2017-05-16Support multiple ICommitMessageProvider implementationsStefan Rademacher1-0/+150
In case that multiple implementations of ICommitMessageProvider are available in Eclipse, the commit messages of all providers are concatenated and provided in the CommitMessageComponent. Bug: 376388 Change-Id: I38f37116956b65fe9433ef77d1728caa4e69c6af Signed-off-by: Peter Bäckman <peter.backman@tieto.com> Signed-off-by: Stefan Rademacher <stefan.rademacher@tk.de> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-05-05Make HyperlinkTokenScanner more robustThomas Wolf1-3/+49
Catch RuntimeExceptions raised by contributed IHyperlinkDetectors. Bug: 515730 Change-Id: I2456d285de9c1cdedac1f34c27b33f24f99e0429 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-03-16Open Git instances in try-with-resource in testsDavid Pursehouse3-6/+10
Change-Id: I881cab412475d692f02e2d5bf76677c08fb3ac54 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2016-10-20Handle rebase modes 'preserve' and 'interactive' in EGitThomas Wolf3-22/+24
EGit and JGit treated branch.<name>.rebase as a boolean config value, which is wrong: git actually also allows 'preserve' and 'interactive'. Since commit aadbb158 in JGit, JGit does recognize these extra values. Adapt the EGit UI (wizards & dialogs for branch creation, branch configuration, pulling and pushing a branch) to provide a UI to let the user select any valid BranchRebaseMode value. Introduce a new BranchRebaseModeCombo for this. Adapt UI tests. Honor the setting in all relevant operations in EGit. Note that JGit currently ignores the "interactive" setting in a PullCommand and performs a normal rebase instead. Bug: 499482 Change-Id: I0a3b639bbb9e5dd5d93134587410ba72c0549cc7 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-07-15Test stability: force display of result dialog of background jobsThomas Wolf1-1/+6
Change-Id: Ia930bf0c9b391f6fd41869693166ed211ce1c2e1 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-06-12Test stability: try to fix three frequently failing testsThomas Wolf1-1/+6
* Wait for shells to close after having clicked finish button * Wait for add to/remove from index jobs * Open global git config preference page differently, and move opening the page into the test methods to get at least screenshots in case it fails. Change-Id: Iea78d6053fc5b554ce1b25eacfd29bdb0b473007 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-05-22Replace uses of deprecated Repository.getRef()Thomas Wolf2-2/+2
Use Repository.findRef() or Repository.exactRef(), as appropriate. No functional change. Change-Id: Ie481c7fa5ac69d4778cf9f70ac2b019bee6e53c9 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2016-05-03Test stability: avoid asynchronous SWTBotTreeItem.expand()Thomas Wolf1-1/+2
Sometimes tests do not find children of expanded tree nodes. The root cause appears to be that expand() expands the node in an asyncExec.[1] Add a utility operation that after expanding waits until the desired node exists, and replace all calls to expand() that do expect children by that. [1] https://wiki.eclipse.org/Linux_Tools_Project/SWTBot_Workarounds#Tree_Item_Expansion_Failure Change-Id: I23ea6a7bc519692c0e9dbe480bb2eb8dfb96adc1 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-15Refresh decorations after re-connecting a projectThomas Wolf1-11/+6
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-13RepositoryCache: do not prematurely remove submodulesThomas Wolf1-0/+46
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-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-25Fix recognition of submodules in folders.Thomas Wolf1-0/+288
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-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 Sohn2-4/+28
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-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>
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-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 Vogel3-0/+8
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-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-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 Wolf1-0/+122
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-07-04Test stability: added more assertions to testNoActionOnLinkedResourcesAndrey Loskutov1-5/+25
LinkedResourcesTest.testNoActionOnLinkedResources fails randomly, but the root cause is not clear. Added more assertions so that we can get an idea where the problem could be. Change-Id: I4e5d0a3af5cf134c164802e67c7b7fb00db715ca Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-07-01Test fixes: BranchAndResetActionTest, LinkedResourcesTestAndrey Loskutov1-8/+16
Next round of test stability fixes... Change-Id: Ia9d93652b2a855245c922dbf921f9ee44f0a00d3 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2015-04-20Format check must honor soft-wrapped commit messagesChristian Georgi1-22/+20
Bug: 464952 Change-Id: I24beb28bded3cbc983370c60c380ff8bab54582c Signed-off-by: Christian Georgi <christian.georgi@sap.com>
2015-04-20Check for empty second line in commit messageChristian Georgi1-0/+67
Staging view and commit dialog now show a warning 'Second line should be empty'. Also add test for this new check. Bug: 464952 Change-Id: I04a9320601d24bf3c8825bf57c967496d94a8acc Signed-off-by: Christian Georgi <christian.georgi@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-12-21Use appropriate constructor to create bare repositoryAndrey Loskutov1-1/+1
This patch fixes 32 unstable test failures. Bug: 455812 Change-Id: I8fc6f3a7ba12831850d747ab5ff9bf6e8324e15a Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
2014-10-08Clean up after testingLaurent Goubet1-0/+10
Change-Id: I62ebcc660d4e93eb88d9cd1a62859c993dfbbb79
2014-09-30Fix "Stashes" menu not being shown in Team menuRobin Stocker1-0/+91
This was broken by a later change. This change fixes it and adds a UI test for stashing some changes and applying them using the menu and the stash editor. Bug: 445321 Change-Id: I8251280c4fcc92acbf519b978c43c19fd086c797 Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-09Fix getSelectedResources not using all ResourceTraversalsRobin Stocker1-0/+44
It only used the resources of the first traversal before. E.g. a working set has multiple traversals. I don't know if this bug was affecting anything else. Change-Id: I19df313931d1d94fe291cbc0bc9dee73f50381db Signed-off-by: Robin Stocker <robin@nibor.org>
2014-08-02Merge "Push Branch: Don't suggest branch name of local upstream branch"Robin Rosenberg2-2/+41
2014-08-01Add Team context menu for working setsRobin Stocker1-11/+17
The menu now shows repository actions in case all projects of a working set are connected to the same Git repository. This is enabled by adding a property tester that does the logic in code instead of XML. To adjust the enabled checks of some actions, some selection-related methods were moved out into its own util class. This also made some other duplicated logic for getting the repository obsolete. Bug: 311299 Change-Id: I9cbec20e9be14cdf6f41bbd79ace3d1a5a4097bd Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-08-01Push Branch: Don't suggest branch name of local upstream branchRobin Stocker2-2/+41
In case the upstream branch is local, it makes more sense to suggest the name of the branch itself. Bug: 440347 Change-Id: Id8b3351898e1d435170692d7799964f6451be697 Signed-off-by: Robin Stocker <robin@nibor.org>
2014-07-08Improve simple push dialogMickael Istria1-6/+7
This dialog now shows which commit, from which branch is about to be pushed. It fits both use cases of pushing HEAD from resource, or pushing a single branch. Bug: 436669 Change-Id: Ibd8d75d6cece181657210fba73c9f2be90ea077b Signed-off-by: Mickael Istria <mistria@redhat.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-05-11Don't decorate empty directories with "untracked" icon (?)Tomasz Zarna1-5/+37
Bug: 433348 Change-Id: I3e4b7122c623e4b44508bcd67bfb77c1ad4b192f Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
2014-05-11Shorten list of TestDecoratableResource constructor parametersTomasz Zarna1-72/+68
Change-Id: Ic7b688b5885d52aa1e82497e393345cb171fd27d Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
2014-05-09Luna RC1: Prevent compile error in CommonUtils.RESOURCE_NAME_COMPARATORMatthias Sohn1-0/+21
org.eclipse.egit.ui.internal.CommonUtils.RESOURCE_NAME_COMPARATOR would show a compile error as soon as bug 434325 is fixed. Target milestone for this fix is Luna RC1 hence changed our code so that this doesn't hit us. Bug: 434334 Change-Id: I671ec5414b7d4d5f504fec245f0887e6855fe8aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2014-04-27Suggest local branch name properly when remote contains a '/'Robin Rosenberg1-34/+0
Bug: 411002 Bug: 400414 JGit-Change-Id: I2515a6ed05f9104c387ce4e43b24dae942ae2473 Change-Id: I8736c51b3f522474af19bc8ea4fc49c2ab207fb7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>

Back to the top