├── .gitignore ├── images ├── diff.png ├── visualdiff.png ├── screenshot-1.png └── screenshot-2.png ├── version.xml ├── src ├── main │ ├── resources │ │ └── org │ │ │ └── pentaho │ │ │ └── di │ │ │ └── git │ │ │ └── spoon │ │ │ ├── images │ │ │ ├── tag.png │ │ │ ├── added.png │ │ │ ├── branch.png │ │ │ ├── pull.png │ │ │ ├── push.png │ │ │ ├── changed.png │ │ │ ├── removed.png │ │ │ ├── repository.png │ │ │ ├── changed.svg │ │ │ ├── branch.svg │ │ │ ├── repository.svg │ │ │ ├── tag.svg │ │ │ ├── pull.svg │ │ │ ├── push.svg │ │ │ ├── removed.svg │ │ │ └── added.svg │ │ │ ├── xul │ │ │ ├── git_spoon_overlays.xul │ │ │ ├── changed-table.xul │ │ │ ├── git_revision-table.xul │ │ │ └── git_perspective.xul │ │ │ └── messages │ │ │ ├── messages_en_US.properties │ │ │ └── messages_ja_JP.properties │ └── java │ │ └── org │ │ └── pentaho │ │ ├── ui │ │ └── xul │ │ │ └── util │ │ │ └── XulDialogLambdaCallback.java │ │ └── di │ │ ├── ui │ │ └── repository │ │ │ └── pur │ │ │ └── repositoryexplorer │ │ │ └── model │ │ │ ├── UIRepositoryObjectRevisions.java │ │ │ └── UIRepositoryObjectRevision.java │ │ ├── git │ │ └── spoon │ │ │ ├── model │ │ │ ├── UIFile.java │ │ │ ├── GitRepository.java │ │ │ ├── IVCS.java │ │ │ └── VCS.java │ │ │ ├── GitSpoonPlugin.java │ │ │ ├── dialog │ │ │ ├── UsernamePasswordDialog.java │ │ │ ├── CloneRepositoryDialog.java │ │ │ ├── DeleteBranchDialog.java │ │ │ ├── MergeBranchDialog.java │ │ │ └── EditRepositoryDialog.java │ │ │ ├── DrawDiffOnJobEntryExtensionPoint.java │ │ │ ├── DrawDiffOnStepExtensionPoint.java │ │ │ ├── PdiDiff.java │ │ │ ├── GitPerspective.java │ │ │ └── GitSpoonMenuController.java │ │ └── repository │ │ └── pur │ │ └── PurObjectRevision.java ├── assembly │ └── zip.xml └── test │ ├── java │ └── org │ │ └── pentaho │ │ └── di │ │ └── git │ │ └── spoon │ │ ├── model │ │ ├── GitRepositoryTest.java │ │ └── SVNTest.java │ │ ├── GitSpoonMenuControllerTest.java │ │ └── PdiDiffTest.java │ └── resources │ ├── r2.kjb │ └── r1.kjb ├── .travis.yml ├── OSS_Licenses.md ├── pom.xml ├── CHANGELOG.md ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | .classpath 3 | .project 4 | .settings/ 5 | -------------------------------------------------------------------------------- /images/diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/images/diff.png -------------------------------------------------------------------------------- /images/visualdiff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/images/visualdiff.png -------------------------------------------------------------------------------- /images/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/images/screenshot-1.png -------------------------------------------------------------------------------- /images/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/images/screenshot-2.png -------------------------------------------------------------------------------- /version.xml: -------------------------------------------------------------------------------- 1 | 2 | 1.1.2-SNAPSHOT 3 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/tag.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/added.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/branch.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/pull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/pull.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/push.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/push.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/changed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/changed.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/removed.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HiromuHota/pdi-git-plugin/HEAD/src/main/resources/org/pentaho/di/git/spoon/images/repository.png -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/xul/git_spoon_overlays.xul: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/xul/changed-table.xul: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/xul/git_revision-table.xul: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/ui/xul/util/XulDialogLambdaCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.ui.xul.util; 18 | 19 | import org.pentaho.ui.xul.XulComponent; 20 | 21 | public interface XulDialogLambdaCallback extends XulDialogCallback { 22 | @Override 23 | default void onError( XulComponent sender, Throwable t ) { } 24 | } 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | except: 3 | - nightly 4 | language: java 5 | dist: xenial 6 | jdk: openjdk8 7 | cache: 8 | directories: 9 | - "$HOME/.m2" 10 | before_install: 11 | - sudo apt-get install libsvn-java 12 | before_script: 13 | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni 14 | before_deploy: 15 | - git config --local user.name "Hiromu Hota" 16 | - git config --local user.email "hiromu.hota@hal.hitachi.com" 17 | - export TRAVIS_TAG=nightly 18 | - git tag $TRAVIS_TAG --force 19 | - git push -f https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $TRAVIS_TAG 20 | deploy: 21 | provider: releases 22 | api_key: $GITHUB_TOKEN 23 | file_glob: true 24 | file: target/pdi-git-plugin-*-jar-with-dependencies.zip 25 | skip_cleanup: true 26 | on: 27 | branch: master 28 | name: nightly 29 | body: Auto-build of $TRAVIS_BRANCH ($TRAVIS_COMMIT) by Travis CI on $(date +'%F %T %Z'). 30 | prerelease: true 31 | overwrite: true 32 | tag_name: $TRAVIS_TAG 33 | target_commitish: $TRAVIS_COMMIT 34 | -------------------------------------------------------------------------------- /OSS_Licenses.md: -------------------------------------------------------------------------------- 1 | This is the list of OSS that pdi-git-plugin depends upon. 2 | 3 | | Component | Version | Home Page | License In Effect | 4 | |-----------|---------|-----------|-------------------| 5 | | JGit | 5.1.13.202002110435-r | https://eclipse.org/jgit/ | [Eclipse Distribution License - v 1.0](https://www.eclipse.org/org/documents/edl-v10.php) | 6 | | JGit Apache Httpclient Based HTTP Support | 5.1.13.202002110435-r | https://eclipse.org/jgit/ | [Eclipse Distribution License - v 1.0](https://www.eclipse.org/org/documents/edl-v10.php) | 7 | | Apache HttpCore | 4.4.13 | https://hc.apache.org/ | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) | 8 | | Apache HttpClient | 4.5.12 | https://hc.apache.org/ | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) | 9 | | Apache Subversion JavaHL | 1.9.4 | http://subclipse.tigris.org/wiki/JavaHL | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) | 10 | | SVNClientAdapter | 1.9.4-2 | http://subclipse.tigris.org/svnClientAdapter.html | [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) | 11 | -------------------------------------------------------------------------------- /src/assembly/zip.xml: -------------------------------------------------------------------------------- 1 | 5 | jar-with-dependencies 6 | 7 | zip 8 | 9 | false 10 | 11 | 12 | ${basedir} 13 | ${project.name} 14 | 15 | version.xml 16 | OSS_Licenses.md 17 | 18 | 19 | 20 | ${project.build.directory} 21 | ${project.name} 22 | 23 | *.jar 24 | version.xml 25 | 26 | 27 | 28 | 29 | 30 | ${project.name}/lib 31 | false 32 | false 33 | runtime 34 | false 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/model/UIRepositoryObjectRevisions.java: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2010 - 2017 Hitachi Vantara. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.pentaho.di.ui.repository.pur.repositoryexplorer.model; 18 | 19 | import java.util.List; 20 | 21 | import org.pentaho.ui.xul.util.AbstractModelNode; 22 | 23 | public class UIRepositoryObjectRevisions extends AbstractModelNode implements 24 | java.io.Serializable { 25 | 26 | private static final long serialVersionUID = -5243106180726024567L; /* EESOURCE: UPDATE SERIALVERUID */ 27 | 28 | public UIRepositoryObjectRevisions() { 29 | } 30 | 31 | public UIRepositoryObjectRevisions( List revisions ) { 32 | super( revisions ); 33 | } 34 | 35 | @Override 36 | protected void fireCollectionChanged() { 37 | this.changeSupport.firePropertyChange( "children", null, this ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/messages/messages_en_US.properties: -------------------------------------------------------------------------------- 1 | Git.Perspective.perspectiveName=Git 2 | 3 | Dialog.Cancel=Cancel 4 | Dialog.Error=Error 5 | Dialog.Ok=OK 6 | Dialog.Success=Success 7 | 8 | Git.Checkout=Checkout 9 | SVN.Checkout=Switch 10 | Git.Config=Config 11 | Git.Repository=Project 12 | Git.Directory=Directory 13 | Git.Pull=Pull 14 | SVN.Pull=Update 15 | Git.Push=Push 16 | Git.Commit=Commit 17 | Git.CommitMessage=Commit Message 18 | Git.Branch=Branch 19 | Git.Tag=Tag 20 | Git.Create=Create 21 | Git.Delete=Delete 22 | Git.Merge=Merge 23 | SVN.Merge=Merge (Reintegrate) 24 | Git.Author=Author 25 | Git.Remote=Remote 26 | Git.Open=Open 27 | Git.Add=Add 28 | Git.Edit=Edit 29 | Git.Remove=Remove 30 | Git.Clone=Clone 31 | Git.StagedChanges=Staged changes 32 | Git.UnstagedChangesAndUntrackedFiles=Unstaged changes and Untracked files 33 | Git.ChangedFiles=Changed files 34 | Git.Refresh=Refresh 35 | 36 | Git.ContextMenu.AddToIndex=Stage 37 | Git.ContextMenu.RemoveFromIndex=Unstage 38 | Git.ContextMenu.Checkout=Checkout 39 | SVN.ContextMenu.Checkout=Update 40 | Git.ContextMenu.Reset=Reset 41 | Git.ContextMenu.Rollback=Rollback 42 | Git.ContextMenu.Discard=Discard changes 43 | Git.ContextMenu.Open=Open 44 | Git.ContextMenu.VisualDiff=Visual diff 45 | 46 | Git.ToolTip.Branch=Create or delete a branch 47 | Git.ToolTip.Merge=Merge a branch to the current one 48 | 49 | Git.Dialog.Branch.Create.Title=Create a branch 50 | Git.Dialog.Branch.Create.Message=Branch to be created 51 | Git.Dialog.Branch.Delete.Message=Branch to be deleted 52 | Git.Dialog.Branch.Merge.Message=Branch to be merged to the current branch 53 | Git.Dialog.Branch.Merge.MergeStrategy=Merge strategy 54 | Git.Dialog.Tag.Create.Title=Create a tag 55 | Git.Dialog.Tag.Create.Message=Tag to be created 56 | Git.Dialog.Force=Force? 57 | Git.Dialog.UncommittedChanges.Message=There are uncommitted changes 58 | 59 | SVN.InvalidRepository=The directory you selected does not contain a Subversion repository. Try Project / Clone to get a remote repository locally. -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/model/UIRepositoryObjectRevision.java: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2010 - 2017 Hitachi Vantara. All rights reserved. 3 | * Copyright 2017 Hitachi America, Ltd., R&D. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | package org.pentaho.di.ui.repository.pur.repositoryexplorer.model; 19 | 20 | import java.text.SimpleDateFormat; 21 | import java.util.Date; 22 | 23 | import org.pentaho.di.repository.ObjectRevision; 24 | import org.pentaho.ui.xul.XulEventSourceAdapter; 25 | 26 | public class UIRepositoryObjectRevision extends XulEventSourceAdapter implements java.io.Serializable { 27 | 28 | private static final long serialVersionUID = 302159542242909806L; /* EESOURCE: UPDATE SERIALVERUID */ 29 | 30 | protected ObjectRevision obj; 31 | 32 | public UIRepositoryObjectRevision() { 33 | super(); 34 | } 35 | 36 | public UIRepositoryObjectRevision( ObjectRevision obj ) { 37 | super(); 38 | this.obj = obj; 39 | } 40 | 41 | public String getName() { 42 | return obj.getName(); 43 | } 44 | 45 | public String getComment() { 46 | return obj.getComment(); 47 | } 48 | 49 | public Date getCreationDate() { 50 | return obj.getCreationDate(); 51 | } 52 | 53 | public String getFormatCreationDate() { 54 | Date date = getCreationDate(); 55 | String str = null; 56 | if ( date != null ) { 57 | SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); 58 | str = sdf.format( date ); 59 | } 60 | return str; 61 | } 62 | 63 | public String getLogin() { 64 | return obj.getLogin(); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/model/UIFile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.model; 18 | 19 | import org.eclipse.jgit.diff.DiffEntry.ChangeType; 20 | import org.pentaho.ui.xul.XulEventSourceAdapter; 21 | 22 | public class UIFile extends XulEventSourceAdapter { 23 | 24 | private String name; 25 | private ChangeType changeType; 26 | private Boolean isStaged = false; 27 | 28 | @Deprecated 29 | public UIFile( String name, ChangeType changeType ) { 30 | this.name = name; 31 | this.changeType = changeType; 32 | } 33 | 34 | public UIFile( String name, ChangeType changeType, Boolean isStaged ) { 35 | this.name = name; 36 | this.changeType = changeType; 37 | this.isStaged = isStaged; 38 | } 39 | 40 | public String getName() { 41 | return name; 42 | } 43 | 44 | public void setName( String name ) { 45 | this.name = name; 46 | } 47 | 48 | public ChangeType getChangeType() { 49 | return changeType; 50 | } 51 | 52 | public void setChangeType( ChangeType changeType ) { 53 | this.changeType = changeType; 54 | } 55 | 56 | public String getImage() { 57 | final String location = "org/pentaho/di/git/spoon/images/"; 58 | switch ( changeType ) { 59 | case ADD: 60 | case COPY: 61 | return location + "added.svg"; 62 | case MODIFY: 63 | case RENAME: 64 | return location + "changed.svg"; 65 | case DELETE: 66 | return location + "removed.svg"; 67 | default: 68 | return ""; 69 | } 70 | } 71 | 72 | public Boolean getIsStaged() { 73 | return isStaged; 74 | } 75 | 76 | public void setIsStaged( Boolean isStaged ) { 77 | this.isStaged = isStaged; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/GitSpoonPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import java.util.ResourceBundle; 20 | 21 | import org.pentaho.di.ui.spoon.SpoonLifecycleListener; 22 | import org.pentaho.di.ui.spoon.SpoonPerspective; 23 | import org.pentaho.di.ui.spoon.SpoonPlugin; 24 | import org.pentaho.di.ui.spoon.SpoonPluginCategories; 25 | import org.pentaho.di.ui.spoon.SpoonPluginInterface; 26 | import org.pentaho.di.ui.spoon.XulSpoonResourceBundle; 27 | import org.pentaho.ui.xul.XulDomContainer; 28 | import org.pentaho.ui.xul.XulException; 29 | 30 | @SpoonPlugin( id = "GitSpoonPlugin", image = "" ) 31 | @SpoonPluginCategories( { "spoon" } ) 32 | public class GitSpoonPlugin implements SpoonPluginInterface, SpoonLifecycleListener { 33 | 34 | private static final Class PKG = GitSpoonPlugin.class; 35 | private ResourceBundle resourceBundle = new XulSpoonResourceBundle( PKG ); 36 | 37 | private GitPerspective perspective; 38 | 39 | public GitSpoonPlugin() throws XulException { 40 | this.perspective = new GitPerspective(); 41 | } 42 | 43 | @Override 44 | public void onEvent( SpoonLifeCycleEvent evt ) { 45 | // TODO Auto-generated method stub 46 | } 47 | 48 | @Override 49 | public void applyToContainer( String category, XulDomContainer container ) throws XulException { 50 | container.registerClassLoader( getClass().getClassLoader() ); 51 | if ( category.equals( "spoon" ) ) { 52 | container.loadOverlay( "org/pentaho/di/git/spoon/xul/git_spoon_overlays.xul", resourceBundle ); 53 | } 54 | } 55 | 56 | @Override 57 | public SpoonLifecycleListener getLifecycleListener() { 58 | // TODO Auto-generated method stub 59 | return this; 60 | } 61 | 62 | @Override 63 | public SpoonPerspective getPerspective() { 64 | return perspective; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/messages/messages_ja_JP.properties: -------------------------------------------------------------------------------- 1 | Git.Perspective.perspectiveName=Git 2 | 3 | Dialog.Cancel=Cancel 4 | Dialog.Error=\u30A8\u30E9\u30FC 5 | Dialog.Ok=OK 6 | Dialog.Success=\u6210\u529F 7 | 8 | Git.Checkout=\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8 9 | Git.Config=\u8A2D\u5B9A 10 | Git.Repository=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 11 | Git.Directory=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA 12 | Git.Pull=\u30D7\u30EB 13 | SVN.Pull=\u66F4\u65B0 14 | Git.Push=\u30D7\u30C3\u30B7\u30E5 15 | Git.Commit=\u30B3\u30DF\u30C3\u30C8 16 | Git.CommitMessage=\u30B3\u30DF\u30C3\u30C8\u30E1\u30C3\u30BB\u30FC\u30B8 17 | Git.Branch=\u30D6\u30E9\u30F3\u30C1 18 | Git.Tag=\u30BF\u30B0 19 | Git.Create=\u4F5C\u6210 20 | Git.Delete=\u524A\u9664 21 | Git.Merge=\u30DE\u30FC\u30B8 22 | Git.Author=\u4F5C\u8005 23 | Git.Remote=\u30EA\u30E2\u30FC\u30C8 24 | Git.Open=\u958B\u304F 25 | Git.Add=\u8FFD\u52A0 26 | Git.Edit=\u7DE8\u96C6 27 | Git.Remove=\u9664\u53BB 28 | Git.Clone=\u30AF\u30ED\u30FC\u30F3 29 | Git.StagedChanges=\u30B9\u30C6\u30FC\u30B8\u6E08\u307F\u306E\u5909\u66F4 30 | Git.UnstagedChangesAndUntrackedFiles=\u30B9\u30C6\u30FC\u30B8\u6E08\u307F\u3067\u306A\u3044\u5909\u66F4\u3068\u672A\u8FFD\u8DE1\u30D5\u30A1\u30A4\u30EB 31 | Git.ChangedFiles=\u5909\u66F4\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB 32 | Git.Refresh=\u66F4\u65B0 33 | 34 | Git.ContextMenu.AddToIndex=\u30B9\u30C6\u30FC\u30B8 35 | Git.ContextMenu.RemoveFromIndex=\u30A2\u30F3\u30B9\u30C6\u30FC\u30B8 36 | Git.ContextMenu.Checkout=\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8 37 | Git.ContextMenu.Reset=\u30EA\u30BB\u30C3\u30C8 38 | Git.ContextMenu.Discard=\u5909\u66F4\u3092\u7834\u68C4 39 | Git.ContextMenu.Open=\u958B\u304F 40 | Git.ContextMenu.VisualDiff=\u8996\u899A\u7684\u5DEE\u5206 41 | 42 | Git.ToolTip.Branch=\u30D6\u30E9\u30F3\u30C1\u3092\u4F5C\u6210\u53C8\u306F\u524A\u9664 43 | Git.ToolTip.Merge=\u73FE\u30D6\u30E9\u30F3\u30C1\u306B\u30DE\u30FC\u30B8 44 | 45 | Git.Dialog.Branch.Create.Title=\u30D6\u30E9\u30F3\u30C1\u306E\u4F5C\u6210 46 | Git.Dialog.Branch.Create.Message=\u4F5C\u6210\u3059\u308B\u30D6\u30E9\u30F3\u30C1 47 | Git.Dialog.Branch.Delete.Message=\u524A\u9664\u3059\u308B\u30D6\u30E9\u30F3\u30C1 48 | Git.Dialog.Branch.Merge.Message=\u73FE\u30D6\u30E9\u30F3\u30C1\u306B\u30DE\u30FC\u30B8\u3059\u308B\u30D6\u30E9\u30F3\u30C1 49 | Git.Dialog.Branch.Merge.MergeStrategy=\u30DE\u30FC\u30B8\u6226\u7565 50 | Git.Dialog.Force=\u5F37\u5236\uFF1F 51 | Git.Dialog.UncommittedChanges.Message=\u30B3\u30DF\u30C3\u30C8\u3057\u3066\u3044\u306A\u3044\u5909\u66F4\u304C\u3042\u308A\u307E\u3059 -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/dialog/UsernamePasswordDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.dialog; 18 | 19 | import org.eclipse.jface.dialogs.Dialog; 20 | import org.eclipse.swt.SWT; 21 | import org.eclipse.swt.layout.GridData; 22 | import org.eclipse.swt.layout.GridLayout; 23 | import org.eclipse.swt.widgets.Composite; 24 | import org.eclipse.swt.widgets.Control; 25 | import org.eclipse.swt.widgets.Label; 26 | import org.eclipse.swt.widgets.Shell; 27 | import org.eclipse.swt.widgets.Text; 28 | 29 | public class UsernamePasswordDialog extends Dialog { 30 | 31 | private Text usernameText; 32 | private Text passwordText; 33 | private String username; 34 | private String password; 35 | 36 | public UsernamePasswordDialog( Shell parentShell ) { 37 | super( parentShell ); 38 | } 39 | 40 | @Override 41 | protected Control createDialogArea( Composite parent ) { 42 | Composite comp = (Composite) super.createDialogArea( parent ); 43 | 44 | GridLayout layout = (GridLayout) comp.getLayout(); 45 | layout.numColumns = 2; 46 | 47 | Label usernameLabel = new Label( comp, SWT.RIGHT ); 48 | usernameLabel.setText( "Username: " ); 49 | usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER ); 50 | usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 51 | 52 | Label passwordLabel = new Label( comp, SWT.RIGHT ); 53 | passwordLabel.setText( "Password: " ); 54 | passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD ); 55 | passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 56 | 57 | return comp; 58 | } 59 | 60 | @Override 61 | protected void okPressed() { 62 | username = usernameText.getText(); 63 | password = passwordText.getText(); 64 | super.okPressed(); 65 | } 66 | 67 | public String getUsername() { 68 | return username; 69 | } 70 | 71 | public String getPassword() { 72 | return password; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/model/GitRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.model; 18 | 19 | import com.google.common.annotations.VisibleForTesting; 20 | import org.pentaho.di.core.variables.VariableSpace; 21 | import org.pentaho.di.core.variables.Variables; 22 | import org.pentaho.metastore.persist.MetaStoreAttribute; 23 | import org.pentaho.metastore.persist.MetaStoreElementType; 24 | 25 | @MetaStoreElementType( 26 | name = "Git Repository", 27 | description = "This defines a Git repository" ) 28 | public class GitRepository { 29 | 30 | @MetaStoreAttribute( key = "name" ) 31 | private String name; 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public void setName( String name ) { 38 | this.name = name; 39 | } 40 | 41 | @MetaStoreAttribute( key = "description" ) 42 | private String description; 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | 48 | public void setDescription( String description ) { 49 | this.description = description; 50 | } 51 | 52 | @MetaStoreAttribute( key = "directory" ) 53 | private String directory; 54 | 55 | /** 56 | * Get a directory path that can contain variables. 57 | * @return directory path 58 | */ 59 | public String getDirectory() { 60 | return directory; 61 | } 62 | 63 | public void setDirectory( String directory ) { 64 | this.directory = directory; 65 | } 66 | 67 | @MetaStoreAttribute( key = "type" ) 68 | private String type; 69 | 70 | public String getType() { 71 | return type; 72 | } 73 | 74 | public void setType( String type ) { 75 | this.type = type; 76 | } 77 | 78 | /** 79 | * Get a directory path in the current environment. 80 | * Unlike {@link #getDirectory()}, all variables are resolved. 81 | * @return directory path 82 | */ 83 | public String getPhysicalDirectory() { 84 | VariableSpace space = getVariables(); 85 | return space.environmentSubstitute( directory ); 86 | } 87 | 88 | @VisibleForTesting 89 | VariableSpace getVariables() { 90 | VariableSpace space = new Variables(); 91 | space.initializeVariablesFrom( null ); 92 | return space; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/test/java/org/pentaho/di/git/spoon/model/GitRepositoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.model; 18 | 19 | import org.junit.Before; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | import org.mockito.Spy; 23 | import org.mockito.runners.MockitoJUnitRunner; 24 | import org.pentaho.di.core.KettleClientEnvironment; 25 | import org.pentaho.di.core.exception.KettleException; 26 | import org.pentaho.di.core.variables.VariableSpace; 27 | import org.pentaho.di.core.variables.Variables; 28 | import org.pentaho.metastore.api.IMetaStore; 29 | import org.pentaho.metastore.api.exceptions.MetaStoreException; 30 | import org.pentaho.metastore.persist.MetaStoreFactory; 31 | import org.pentaho.metastore.stores.memory.MemoryMetaStore; 32 | 33 | import static org.junit.Assert.assertEquals; 34 | import static org.mockito.Mockito.when; 35 | 36 | @RunWith( MockitoJUnitRunner.class ) 37 | public class GitRepositoryTest { 38 | 39 | public static final String NAMESPACE = "testnamespace"; 40 | public static final String NAME = "test"; 41 | public static final String DESCRIPTION = "test description"; 42 | public static final String DIRECTORY = "/tmp/test"; 43 | 44 | protected IMetaStore metaStore; 45 | 46 | @Spy 47 | protected GitRepository repo; 48 | 49 | @Before 50 | public void setUp() throws KettleException { 51 | KettleClientEnvironment.init(); 52 | metaStore = new MemoryMetaStore(); 53 | 54 | repo.setName( NAME ); 55 | repo.setDescription( DESCRIPTION ); 56 | repo.setDirectory( DIRECTORY ); 57 | } 58 | 59 | @Test 60 | public void testSerialisation() throws MetaStoreException { 61 | MetaStoreFactory repoFactory = new MetaStoreFactory( GitRepository.class, metaStore, NAMESPACE ); 62 | repoFactory.saveElement( repo ); 63 | 64 | GitRepository verify = repoFactory.loadElement( NAME ); 65 | assertEquals( NAME, verify.getName() ); 66 | assertEquals( DESCRIPTION, verify.getDescription() ); 67 | assertEquals( DIRECTORY, verify.getDirectory() ); 68 | } 69 | 70 | @Test 71 | public void testVariableSubstitution() { 72 | VariableSpace space = new Variables(); 73 | space.initializeVariablesFrom( null ); 74 | space.setVariable( "KETTLE_HOME", DIRECTORY ); 75 | when( repo.getVariables() ).thenReturn( space ); 76 | repo.setDirectory( "${KETTLE_HOME}" ); 77 | 78 | assertEquals( DIRECTORY, repo.getPhysicalDirectory() ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/dialog/CloneRepositoryDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.dialog; 18 | 19 | import java.io.File; 20 | import java.net.URISyntaxException; 21 | 22 | import org.eclipse.jgit.transport.URIish; 23 | import org.eclipse.swt.SWT; 24 | import org.eclipse.swt.layout.GridData; 25 | import org.eclipse.swt.layout.GridLayout; 26 | import org.eclipse.swt.widgets.Composite; 27 | import org.eclipse.swt.widgets.Control; 28 | import org.eclipse.swt.widgets.Label; 29 | import org.eclipse.swt.widgets.Shell; 30 | import org.eclipse.swt.widgets.Text; 31 | import org.pentaho.di.git.spoon.model.GitRepository; 32 | 33 | public class CloneRepositoryDialog extends EditRepositoryDialog { 34 | 35 | private Text urlText; 36 | private String url; 37 | private Text cloneAsText; 38 | private String cloneAs; 39 | 40 | public CloneRepositoryDialog( Shell parentShell, GitRepository repo ) { 41 | super( parentShell, repo ); 42 | APPLICATION_NAME = "Clone Repository"; 43 | } 44 | 45 | @Override 46 | protected Control createDialogArea( Composite parent ) { 47 | Composite comp = (Composite) super.createDialogArea( parent ); 48 | 49 | GridLayout layout = (GridLayout) comp.getLayout(); 50 | layout.numColumns = 3; 51 | 52 | Label urlLabel = new Label( comp, SWT.RIGHT ); 53 | urlLabel.setText( "Source URL: " ); 54 | urlLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) ); 55 | urlText = new Text( comp, SWT.SINGLE | SWT.BORDER ); 56 | urlText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) ); 57 | 58 | Label cloneAsLabel = new Label( comp, SWT.RIGHT ); 59 | cloneAsLabel.setText( "Clone As: " ); 60 | cloneAsLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) ); 61 | cloneAsText = new Text( comp, SWT.SINGLE | SWT.BORDER ); 62 | cloneAsText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) ); 63 | 64 | urlText.addModifyListener( event -> { 65 | String url = ( (Text) event.widget ).getText(); 66 | URIish uri; 67 | try { 68 | uri = new URIish( url ); 69 | cloneAsText.setText( uri.getHumanishName() ); 70 | } catch ( URISyntaxException e ) { 71 | // e.printStackTrace(); 72 | } 73 | } ); 74 | 75 | return comp; 76 | } 77 | 78 | @Override 79 | protected void okPressed() { 80 | url = urlText.getText(); 81 | cloneAs = cloneAsText.getText(); 82 | super.okPressed(); 83 | } 84 | 85 | public String getURL() { 86 | return url; 87 | } 88 | 89 | public String getCloneAs() { 90 | return cloneAs; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/repository/pur/PurObjectRevision.java: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2010 - 2017 Hitachi Vantara. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package org.pentaho.di.repository.pur; 18 | 19 | import java.io.Serializable; 20 | import java.util.Date; 21 | 22 | import org.pentaho.di.repository.ObjectRevision; 23 | 24 | import javax.xml.bind.annotation.XmlAccessType; 25 | import javax.xml.bind.annotation.XmlAccessorType; 26 | import javax.xml.bind.annotation.XmlElement; 27 | import javax.xml.bind.annotation.XmlRootElement; 28 | import javax.xml.bind.annotation.XmlType; 29 | 30 | @XmlRootElement( name = "revision" ) 31 | @XmlAccessorType( XmlAccessType.FIELD ) 32 | @XmlType( name = "", propOrder = { "versionId", "creationDate", "login", "comment" } ) 33 | public class PurObjectRevision implements ObjectRevision, java.io.Serializable { 34 | 35 | private static final long serialVersionUID = -7857510728831225268L; /* EESOURCE: UPDATE SERIALVERUID */ 36 | 37 | // ~ Static fields/initializers ====================================================================================== 38 | 39 | // ~ Instance fields ================================================================================================= 40 | 41 | private String comment; 42 | 43 | private Date creationDate; 44 | 45 | private String login; 46 | 47 | @XmlElement( type = String.class ) 48 | private Serializable versionId; 49 | 50 | // ~ Constructors ==================================================================================================== 51 | 52 | public PurObjectRevision() { 53 | super(); 54 | this.versionId = null; 55 | this.login = null; 56 | // defensive copy 57 | this.creationDate = ( creationDate != null ? new Date( creationDate.getTime() ) : null ); 58 | this.comment = null; 59 | } 60 | 61 | public PurObjectRevision( final Serializable versionId, final String login, final Date creationDate, 62 | final String comment ) { 63 | super(); 64 | this.versionId = versionId; 65 | this.login = login; 66 | // defensive copy 67 | this.creationDate = ( creationDate != null ? new Date( creationDate.getTime() ) : null ); 68 | this.comment = comment; 69 | } 70 | 71 | // ~ Methods ========================================================================================================= 72 | 73 | public String getComment() { 74 | return comment; 75 | } 76 | 77 | public Date getCreationDate() { 78 | // defensive copy 79 | return creationDate != null ? new Date( creationDate.getTime() ) : null; 80 | } 81 | 82 | public String getLogin() { 83 | return login; 84 | } 85 | 86 | public String getName() { 87 | return versionId != null ? versionId.toString() : null; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/DrawDiffOnJobEntryExtensionPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import static org.pentaho.di.git.spoon.PdiDiff.*; 20 | 21 | import org.pentaho.di.core.exception.KettleException; 22 | import org.pentaho.di.core.extension.ExtensionPoint; 23 | import org.pentaho.di.core.extension.ExtensionPointInterface; 24 | import org.pentaho.di.core.gui.BasePainter; 25 | import org.pentaho.di.core.gui.GCInterface; 26 | import org.pentaho.di.core.gui.Point; 27 | import org.pentaho.di.core.logging.LogChannelInterface; 28 | import org.pentaho.di.job.JobMeta; 29 | import org.pentaho.di.job.JobPainter; 30 | import org.pentaho.di.ui.core.ConstUI; 31 | import org.pentaho.di.ui.core.PropsUI; 32 | 33 | @ExtensionPoint( 34 | id = "DrawDiffOnJobEntryExtensionPoint", 35 | description = "Draws a marker on top of a job entry if it has some change", 36 | extensionPointId = "JobPainterEnd" ) 37 | public class DrawDiffOnJobEntryExtensionPoint implements ExtensionPointInterface { 38 | 39 | @Override 40 | public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { 41 | if ( !( object instanceof JobPainter ) ) { 42 | return; 43 | } 44 | JobPainter painter = (JobPainter) object; 45 | Point offset = painter.getOffset(); 46 | GCInterface gc = painter.getGc(); 47 | JobMeta jobMeta = painter.getJobMeta(); 48 | jobMeta.getJobCopies().stream().filter( je -> je.getAttribute( ATTR_GIT, ATTR_STATUS ) != null ) 49 | .forEach( je -> { 50 | if ( jobMeta.getJobversion() == null ? false : jobMeta.getJobversion().startsWith( "git" ) ) { 51 | String status = je.getAttribute( ATTR_GIT, ATTR_STATUS ); 52 | Point n = je.getLocation(); 53 | String location = "org/pentaho/di/git/spoon/images/"; 54 | if ( status.equals( REMOVED ) ) { 55 | location += "removed.svg"; 56 | } else if ( status.equals( CHANGED ) ) { 57 | location += "changed.svg"; 58 | } else if ( status.equals( ADDED ) ) { 59 | location += "added.svg"; 60 | } else { // Unchanged 61 | return; 62 | } 63 | int iconsize = ConstUI.ICON_SIZE; 64 | try { 65 | iconsize = PropsUI.getInstance().getIconSize(); 66 | } catch ( Exception e ) { 67 | // Exception when accessed from Carte 68 | } 69 | gc.drawImage( location, getClass().getClassLoader(), ( n.x + iconsize + offset.x ) - ( BasePainter.MINI_ICON_SIZE / 2 ), n.y + offset.y - ( BasePainter.MINI_ICON_SIZE / 2 ) ); 70 | } else { 71 | je.getAttributesMap().remove( ATTR_GIT ); 72 | } 73 | } ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/DrawDiffOnStepExtensionPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import static org.pentaho.di.git.spoon.PdiDiff.*; 20 | 21 | import org.pentaho.di.core.exception.KettleException; 22 | import org.pentaho.di.core.extension.ExtensionPoint; 23 | import org.pentaho.di.core.extension.ExtensionPointInterface; 24 | import org.pentaho.di.core.gui.GCInterface; 25 | import org.pentaho.di.core.gui.Point; 26 | import org.pentaho.di.core.gui.BasePainter; 27 | import org.pentaho.di.core.logging.LogChannelInterface; 28 | import org.pentaho.di.trans.TransMeta; 29 | import org.pentaho.di.trans.TransPainter; 30 | import org.pentaho.di.ui.core.ConstUI; 31 | import org.pentaho.di.ui.core.PropsUI; 32 | 33 | @ExtensionPoint( 34 | id = "DrawDiffOnTransExtensionPoint", 35 | description = "Draws a marker on top of a step if it has some change", 36 | extensionPointId = "TransPainterEnd" ) 37 | public class DrawDiffOnStepExtensionPoint implements ExtensionPointInterface { 38 | 39 | @Override 40 | public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { 41 | if ( !( object instanceof TransPainter ) ) { 42 | return; 43 | } 44 | TransPainter painter = (TransPainter) object; 45 | Point offset = painter.getOffset(); 46 | GCInterface gc = painter.getGc(); 47 | TransMeta transMeta = painter.getTransMeta(); 48 | transMeta.getSteps().stream().filter( step -> step.getAttribute( ATTR_GIT, ATTR_STATUS ) != null ) 49 | .forEach( step -> { 50 | if ( transMeta.getTransversion() == null ? false : transMeta.getTransversion().startsWith( "git" ) ) { 51 | String status = step.getAttribute( ATTR_GIT, ATTR_STATUS ); 52 | Point n = step.getLocation(); 53 | String location = "org/pentaho/di/git/spoon/images/"; 54 | if ( status.equals( REMOVED ) ) { 55 | location += "removed.svg"; 56 | } else if ( status.equals( CHANGED ) ) { 57 | location += "changed.svg"; 58 | } else if ( status.equals( ADDED ) ) { 59 | location += "added.svg"; 60 | } else { // Unchanged 61 | return; 62 | } 63 | int iconsize = ConstUI.ICON_SIZE; 64 | try { 65 | iconsize = PropsUI.getInstance().getIconSize(); 66 | } catch ( Exception e ) { 67 | // Exception when accessed from Carte 68 | } 69 | gc.drawImage( location, getClass().getClassLoader(), ( n.x + iconsize + offset.x ) - ( BasePainter.MINI_ICON_SIZE / 2 ), n.y + offset.y - ( BasePainter.MINI_ICON_SIZE / 2 ) ); 70 | } else { 71 | step.getAttributesMap().remove( ATTR_GIT ); 72 | } 73 | } ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/dialog/DeleteBranchDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.dialog; 18 | 19 | import java.util.List; 20 | 21 | import org.eclipse.jface.dialogs.Dialog; 22 | import org.eclipse.swt.SWT; 23 | import org.eclipse.swt.custom.CCombo; 24 | import org.eclipse.swt.events.SelectionAdapter; 25 | import org.eclipse.swt.events.SelectionEvent; 26 | import org.eclipse.swt.layout.GridData; 27 | import org.eclipse.swt.layout.GridLayout; 28 | import org.eclipse.swt.widgets.Button; 29 | import org.eclipse.swt.widgets.Composite; 30 | import org.eclipse.swt.widgets.Control; 31 | import org.eclipse.swt.widgets.Label; 32 | import org.eclipse.swt.widgets.Shell; 33 | import org.pentaho.di.git.spoon.GitController; 34 | import org.pentaho.di.i18n.BaseMessages; 35 | 36 | public class DeleteBranchDialog extends Dialog { 37 | 38 | private static final Class PKG = GitController.class; 39 | 40 | private CCombo comboBranch; 41 | private String selectedBranch; 42 | private boolean isForce; 43 | private List branches; 44 | 45 | public DeleteBranchDialog( Shell parentShell ) { 46 | super( parentShell ); 47 | } 48 | 49 | @Override 50 | protected Control createDialogArea( Composite parent ) { 51 | Composite comp = (Composite) super.createDialogArea( parent ); 52 | 53 | GridLayout layout = (GridLayout) comp.getLayout(); 54 | layout.numColumns = 2; 55 | 56 | Label branchLabel = new Label( comp, SWT.RIGHT ); 57 | branchLabel.setText( BaseMessages.getString( PKG, "Git.Dialog.Branch.Delete.Message" ) ); 58 | comboBranch = new CCombo( comp, SWT.DROP_DOWN ); 59 | comboBranch.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 60 | comboBranch.addSelectionListener( new SelectionAdapter() { 61 | @Override 62 | public void widgetSelected( SelectionEvent e ) { 63 | selectedBranch = ( (CCombo) e.getSource() ).getText(); 64 | } 65 | } ); 66 | branches.forEach( branch -> comboBranch.add( branch ) ); 67 | 68 | Label forceLabel = new Label( comp, SWT.RIGHT ); 69 | forceLabel.setText( BaseMessages.getString( PKG, "Git.Dialog.Force" ) ); 70 | Button forceButton = new Button( comp, SWT.CHECK ); 71 | forceButton.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 72 | forceButton.addSelectionListener( new SelectionAdapter() { 73 | @Override 74 | public void widgetSelected( SelectionEvent e ) { 75 | isForce = ( (Button) e.getSource() ).getSelection(); 76 | } 77 | } ); 78 | forceButton.setSelection( false ); 79 | 80 | return comp; 81 | } 82 | 83 | public void setBranches( List branches ) { 84 | this.branches = branches; 85 | } 86 | 87 | public String getSelectedBranch() { 88 | return selectedBranch; 89 | } 90 | 91 | public boolean isForce() { 92 | return isForce; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/test/java/org/pentaho/di/git/spoon/GitSpoonMenuControllerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import static org.mockito.Mockito.*; 20 | 21 | import org.eclipse.jface.window.Window; 22 | import org.eclipse.jgit.junit.RepositoryTestCase; 23 | import org.junit.Before; 24 | import org.junit.Rule; 25 | import org.junit.Test; 26 | import org.junit.rules.TemporaryFolder; 27 | import org.junit.runner.RunWith; 28 | import org.mockito.Mock; 29 | import org.mockito.runners.MockitoJUnitRunner; 30 | import org.mockito.Spy; 31 | import org.pentaho.di.git.spoon.dialog.CloneRepositoryDialog; 32 | import org.pentaho.di.git.spoon.dialog.UsernamePasswordDialog; 33 | import org.pentaho.di.git.spoon.model.GitRepository; 34 | import org.pentaho.di.git.spoon.model.UIGit; 35 | 36 | @RunWith( MockitoJUnitRunner.class ) 37 | public class GitSpoonMenuControllerTest extends RepositoryTestCase { 38 | 39 | @Spy 40 | private GitSpoonMenuController controller; 41 | @Mock 42 | private CloneRepositoryDialog cloneRepositoryDialog; 43 | @Mock 44 | private UsernamePasswordDialog usernamePasswordDialog; 45 | @Mock 46 | private GitRepository repo; 47 | @Mock 48 | private GitController gitController; 49 | @Mock 50 | private UIGit git; 51 | 52 | @Rule 53 | public TemporaryFolder dstFolder = new TemporaryFolder(); 54 | 55 | @Before 56 | public void setUp() throws Exception { 57 | super.setUp(); 58 | controller.setGitController( gitController ); 59 | doReturn( cloneRepositoryDialog ).when( controller ).getCloneRepositoryDialog( any( GitRepository.class ) ); 60 | doReturn( usernamePasswordDialog ).when( controller ).getUsernamePasswordDialog(); 61 | doReturn( null ).when( controller ).getShell(); 62 | doReturn( git ).when( controller ).getVCS( any( GitRepository.class ) ); 63 | doNothing().when( controller ).saveRepository( any( GitRepository.class ) ); 64 | doNothing().when( controller ).showMessageBox( anyString(), anyString() ); 65 | } 66 | 67 | @Test 68 | public void testShouldNotCloneOnCancel() throws Exception { 69 | when( cloneRepositoryDialog.open() ).thenReturn( Window.CANCEL ); 70 | 71 | controller.cloneRepo(); 72 | 73 | verify( cloneRepositoryDialog, never() ).getDirectory(); 74 | } 75 | 76 | @Test 77 | public void testCloneShouldSucceed() throws Exception { 78 | when( cloneRepositoryDialog.open() ).thenReturn( Window.OK ); 79 | when( cloneRepositoryDialog.getURL() ).thenReturn( db.getDirectory().getPath() ); 80 | when( cloneRepositoryDialog.getGitRepository() ).thenReturn( repo ); 81 | when( repo.getPhysicalDirectory() ).thenReturn( dstFolder.getRoot().getPath() ); 82 | doReturn( true ).when( git ).cloneRepo( anyString(), anyString() ); 83 | 84 | controller.cloneRepo(); 85 | 86 | verify( controller ).showMessageBox( eq( "Success" ), anyString() ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/test/java/org/pentaho/di/git/spoon/PdiDiffTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import static org.junit.Assert.*; 20 | import static org.pentaho.di.git.spoon.PdiDiff.*; 21 | 22 | import java.io.File; 23 | import java.io.FileInputStream; 24 | import java.io.InputStream; 25 | 26 | import org.junit.Before; 27 | import org.junit.Test; 28 | import org.pentaho.di.core.KettleClientEnvironment; 29 | import org.pentaho.di.core.KettleEnvironment; 30 | import org.pentaho.di.core.exception.KettleException; 31 | import org.pentaho.di.job.JobMeta; 32 | import org.pentaho.di.trans.TransMeta; 33 | 34 | public class PdiDiffTest { 35 | 36 | @Before 37 | public void setUp() throws KettleException { 38 | KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.CARTE ); 39 | KettleEnvironment.init(); 40 | } 41 | 42 | @Test 43 | public void diffTransTest() throws Exception { 44 | File file = new File( "src/test/resources/r1.ktr" ); 45 | InputStream xmlStream = new FileInputStream( file ); 46 | TransMeta transMeta = new TransMeta( xmlStream, null, true, null, null ); 47 | transMeta.sortSteps(); 48 | 49 | File file2 = new File( "src/test/resources/r2.ktr" ); 50 | InputStream xmlStream2 = new FileInputStream( file2 ); 51 | TransMeta transMeta2 = new TransMeta( xmlStream2, null, true, null, null ); 52 | transMeta2.sortSteps(); 53 | 54 | transMeta = compareSteps( transMeta, transMeta2, true ); 55 | transMeta2 = compareSteps( transMeta2, transMeta, false ); 56 | assertEquals( UNCHANGED, transMeta.getStep( 0 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 57 | assertEquals( CHANGED, transMeta.getStep( 1 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 58 | assertEquals( REMOVED, transMeta.getStep( 2 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 59 | assertEquals( ADDED, transMeta2.getStep( 2 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 60 | } 61 | 62 | @Test 63 | public void diffJobEntryTest() throws Exception { 64 | File file = new File( "src/test/resources/r1.kjb" ); 65 | InputStream xmlStream = new FileInputStream( file ); 66 | JobMeta jobMeta = new JobMeta( xmlStream, null, null ); 67 | 68 | File file2 = new File( "src/test/resources/r2.kjb" ); 69 | InputStream xmlStream2 = new FileInputStream( file2 ); 70 | JobMeta jobMeta2 = new JobMeta( xmlStream2, null, null ); 71 | 72 | jobMeta = compareJobEntries( jobMeta, jobMeta2, true ); 73 | jobMeta2 = compareJobEntries( jobMeta2, jobMeta, false ); 74 | assertEquals( CHANGED, jobMeta.getJobEntry( 0 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 75 | assertEquals( UNCHANGED, jobMeta.getJobEntry( 1 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 76 | assertEquals( REMOVED, jobMeta.getJobEntry( 2 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 77 | assertEquals( ADDED, jobMeta2.getJobEntry( 2 ).getAttribute( ATTR_GIT, ATTR_STATUS ) ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/PdiDiff.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon; 18 | 19 | import java.util.Map; 20 | import java.util.Optional; 21 | 22 | import org.pentaho.di.core.exception.KettleException; 23 | import org.pentaho.di.job.JobMeta; 24 | import org.pentaho.di.job.entry.JobEntryCopy; 25 | import org.pentaho.di.trans.TransMeta; 26 | import org.pentaho.di.trans.step.StepMeta; 27 | 28 | public class PdiDiff { 29 | public static String ATTR_GIT = "Git"; 30 | public static String ATTR_STATUS = "Status"; 31 | 32 | public static String UNCHANGED = "UNCHANGED"; 33 | public static String CHANGED = "CHANGED"; 34 | public static String REMOVED = "REMOVED"; 35 | public static String ADDED = "ADDED"; 36 | 37 | public static TransMeta compareSteps( TransMeta transMeta1, TransMeta transMeta2, boolean isForward ) { 38 | transMeta1.getSteps().forEach( step -> { 39 | Optional step2 = transMeta2.getSteps().stream() 40 | .filter( obj -> step.getName().equals( obj.getName() ) ).findFirst(); 41 | String status = null; 42 | if ( step2.isPresent() ) { 43 | Map tmp = null, tmp2 = null; 44 | try { 45 | // AttributeMap("Git") cannot affect the XML comparison 46 | tmp = step.getAttributesMap().remove( ATTR_GIT ); 47 | tmp2 = step2.get().getAttributesMap().remove( ATTR_GIT ); 48 | if ( step.getXML().equals( step2.get().getXML() ) ) { 49 | status = UNCHANGED; 50 | } else { 51 | status = CHANGED; 52 | } 53 | } catch ( KettleException e ) { 54 | e.printStackTrace(); 55 | } finally { 56 | step.setAttributes( ATTR_GIT, tmp ); 57 | step2.get().setAttributes( ATTR_GIT, tmp2 ); 58 | } 59 | } else { 60 | if ( isForward ) { 61 | status = REMOVED; 62 | } else { 63 | status = ADDED; 64 | } 65 | } 66 | step.setAttribute( ATTR_GIT, ATTR_STATUS, status.toString() ); 67 | } ); 68 | return transMeta1; 69 | } 70 | 71 | public static JobMeta compareJobEntries( JobMeta jobMeta1, JobMeta jobMeta2, boolean isForward ) { 72 | jobMeta1.getJobCopies().forEach( je -> { 73 | Optional je2 = jobMeta2.getJobCopies().stream() 74 | .filter( obj -> je.getName().equals( obj.getName() ) ).findFirst(); 75 | String status = null; 76 | if ( je2.isPresent() ) { 77 | Map tmp = null, tmp2 = null; 78 | // AttributeMap("Git") cannot affect the XML comparison 79 | tmp = je.getAttributesMap().remove( ATTR_GIT ); 80 | tmp2 = je2.get().getAttributesMap().remove( ATTR_GIT ); 81 | if ( je.getXML().equals( je2.get().getXML() ) ) { 82 | status = UNCHANGED; 83 | } else { 84 | status = CHANGED; 85 | } 86 | je.setAttributes( ATTR_GIT, tmp ); 87 | je2.get().setAttributes( ATTR_GIT, tmp2 ); 88 | } else { 89 | if ( isForward ) { 90 | status = REMOVED; 91 | } else { 92 | status = ADDED; 93 | } 94 | } 95 | je.setAttribute( ATTR_GIT, ATTR_STATUS, status.toString() ); 96 | } ); 97 | return jobMeta1; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/org/pentaho/di/git/spoon/dialog/MergeBranchDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Hitachi America, Ltd., R&D. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.pentaho.di.git.spoon.dialog; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import org.eclipse.jface.dialogs.Dialog; 23 | import org.eclipse.jgit.merge.MergeStrategy; 24 | import org.eclipse.swt.SWT; 25 | import org.eclipse.swt.custom.CCombo; 26 | import org.eclipse.swt.events.SelectionAdapter; 27 | import org.eclipse.swt.events.SelectionEvent; 28 | import org.eclipse.swt.layout.GridData; 29 | import org.eclipse.swt.layout.GridLayout; 30 | import org.eclipse.swt.widgets.Composite; 31 | import org.eclipse.swt.widgets.Control; 32 | import org.eclipse.swt.widgets.Label; 33 | import org.eclipse.swt.widgets.Shell; 34 | import org.pentaho.di.git.spoon.GitController; 35 | import org.pentaho.di.i18n.BaseMessages; 36 | 37 | public class MergeBranchDialog extends Dialog { 38 | 39 | private static final Class PKG = GitController.class; 40 | private static final List listMergeStrategy = new ArrayList(); 41 | static { 42 | listMergeStrategy.add( MergeStrategy.RECURSIVE.getName() ); 43 | listMergeStrategy.add( MergeStrategy.OURS.getName() ); 44 | listMergeStrategy.add( MergeStrategy.THEIRS.getName() ); 45 | } 46 | 47 | private CCombo comboBranch; 48 | private String selectedBranch; 49 | private List branches; 50 | private CCombo comboMergeStrategy; 51 | private String selectedMergeStrategy; 52 | 53 | public MergeBranchDialog( Shell parentShell ) { 54 | super( parentShell ); 55 | } 56 | 57 | @Override 58 | protected Control createDialogArea( Composite parent ) { 59 | Composite comp = (Composite) super.createDialogArea( parent ); 60 | 61 | GridLayout layout = (GridLayout) comp.getLayout(); 62 | layout.numColumns = 2; 63 | 64 | Label branchLabel = new Label( comp, SWT.RIGHT ); 65 | branchLabel.setText( BaseMessages.getString( PKG, "Git.Dialog.Branch.Merge.Message" ) ); 66 | comboBranch = new CCombo( comp, SWT.DROP_DOWN ); 67 | comboBranch.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 68 | comboBranch.addSelectionListener( new SelectionAdapter() { 69 | @Override 70 | public void widgetSelected( SelectionEvent e ) { 71 | selectedBranch = ( (CCombo) e.getSource() ).getText(); 72 | } 73 | } ); 74 | branches.forEach( branch -> comboBranch.add( branch ) ); 75 | 76 | Label strategyLabel = new Label( comp, SWT.RIGHT ); 77 | strategyLabel.setText( BaseMessages.getString( PKG, "Git.Dialog.Branch.Merge.MergeStrategy" ) ); 78 | comboMergeStrategy = new CCombo( comp, SWT.DROP_DOWN ); 79 | comboMergeStrategy.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) ); 80 | listMergeStrategy.forEach( mergeStrategy -> comboMergeStrategy.add( mergeStrategy ) ); 81 | comboMergeStrategy.select( 0 ); 82 | selectedMergeStrategy = listMergeStrategy.get( 0 ); 83 | comboMergeStrategy.addSelectionListener( new SelectionAdapter() { 84 | @Override 85 | public void widgetSelected( SelectionEvent e ) { 86 | selectedMergeStrategy = ( (CCombo) e.getSource() ).getText(); 87 | } 88 | } ); 89 | 90 | return comp; 91 | } 92 | 93 | public void setBranches( List branches ) { 94 | this.branches = branches; 95 | } 96 | 97 | public String getSelectedBranch() { 98 | return selectedBranch; 99 | } 100 | 101 | public String getSelectedMergeStrategy() { 102 | return selectedMergeStrategy; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/images/changed.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml -------------------------------------------------------------------------------- /src/main/resources/org/pentaho/di/git/spoon/xul/git_perspective.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |