Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to make Custom Action not waiting for script ends

Oliver Zhou August 15, 2012

Hi Author,

I have a custom action that call Tortiesehg Patch Reject File Editor since SourceTree currently doesn't provide this feature.

I wrote a script like this:

#!/bin/bash

source ~/.bash_profile
echo $PYTHONPATH
echo $PATH

thg rejects $1

SourceTree will hang until I close the patch reject file editor window, that's not really what I expect.

Is it possible to provide an option that let SourceTree not wait for the script ending?

1 answer

1 accepted

0 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2012

Two ways:

  1. Enable the 'Open in a Separate Window' option on the Custom Action. This makes the command execute in a separate window which is not modal on the repository so you don't have to wait
  2. Add '&' to the end of your thg command so that the process is not blocking on the script
Oliver Zhou August 15, 2012

I tried them both, but unfortunently doesn't work for me.

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2012

Please define "doesn't work".

Oliver Zhou August 15, 2012

It just has no change, SourceTree still hang

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2012

'Hang'? No Custom Action I've ever seen causes this. Are you sure thg just doesn't like being called like this?

Oliver Zhou August 26, 2012

Finally I figure out the solution. It's not a problem of SourceTree

Use --nofork option for thg so that it will not run a background job for THG GUI.

thg --nofork rejects $1

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events