1. Song Tom
  2. PowerBuilder
  3. Wednesday, 23 January 2019 17:08 PM UTC

As powerbuilder 2017 r3 has integrated GitLab plugin, it is convinent for source control, but how can we manage Git branch as there is long last change parallel with master change, is there any suggestion, so far we have to use tortoisegit clone first, then add source, change and commit,but sometime encounter some confusions, is there best practice?

Tom Jiang @Appeon Accepted Answer Pending Moderation
  1. Thursday, 24 January 2019 05:31 AM UTC
  2. PowerBuilder
  3. # 1

One of the reasons that people choose to use Git is how easy it is to do branching. Unfortunately, PowerBuilder hasn't implemented it yet. But that doesn't stop you from using this feature if you don't mind taking a few extra steps. 

Suppose you are working on the master branch and now need to to work on the dev branch

1. Close PowerBuilder.

2. Stash your changes in master branch using TortoiseGit.

3. Switch/Checkout the dev branch. 

4. You can double click on the pbw file to start PowerBuilder. Make sure you click Refresh to get all objects from the dev into the IDE.

 

5. You can do your development in the IDE and you can also use the Git Commit in the IDE to commit to dev branch.

6. When you are ready to submit your commits in dev, you can use TorotiseGit to push it to the server.

7. You can switch back to the master branch using the same method mentioned above.

8. Use Stash Pop (if you need to apply the last stash) or Stash List > Stash Apply to restore the previous status of your master branch.  

9. Restart you PB and do a Refresh then you can work on the master branch again. 

Comment
  1. ATK Gimmy Susan
  2. Friday, 25 January 2019 08:52 AM UTC
thank you, Tom Jiang

Now it's clear to me
  1. Helpful
  1. Chris Tillman
  2. Sunday, 3 February 2019 09:26 AM UTC
That's a great How-To, Tom, thanks. I think it actually also addresses another use case. When upgrading to R3 build 1880, I was forced to remove the existing installation. After the installation, Powerbuilder no longer knew about my source-controlled folders; opening up the workspace in a git-controlled folder just shows a non-controlled source. The only option under Properties of the workspace is PBNative, and according to another note you provided there are only two ways to make Git show up there. 1) With no workspace selected, use Connect to Source to download whatever is in the master branch on the server, or 2) Right click on the existing workspace and Add to Source Control.



I found that using the Add to Source Control function does not take account of the existing status of source controlled items. Even if they have been modified locally, all the source is represented as being in sync with the server. For anything in-flight, that will lead to a host of problems.



So neither method addresses the use case of hooking up a new installation of Powerbuilder, even just upgrades, with existing source controlled folders. But I found a workaround for this. After closing Powerbuilder, I renamed the source folder I wanted to hook up to a different name, suppose it was named "source" I renamed it "source_backup". Then I created a new folder named "source", and used "Connect to Workspace" to download the current master to it. Then after closing Powerbuilder again, I discarded the "source" folder and renamed "source_backup" to "source". Similar to the accommodation of branches above, Powerbuilder now shows the folder as being source controlled.
  1. Helpful
  1. Tom Jiang @Appeon
  2. Tuesday, 2 July 2019 05:21 AM UTC
Hi Chris, Thanks for sharing this workaround! It is very help!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.