Created
July 18, 2011 20:30
-
-
Save chaliy/1090570 to your computer and use it in GitHub Desktop.
Simple script to commit changes to staging branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage | |
# PushToStaging "Foo bar" | |
# More details http://blog.chaliy.name/post/7772955245/automatic-deploy | |
param( | |
[Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Mandatory=$true, Position=0)] | |
$Message = "" | |
) | |
$curBranch = hg branch | |
$status = hg status | |
if (!($status -eq "")){ | |
Write-Error "Changes should be commited first" | |
} else { | |
# Work with staging branch | |
hg up staging | |
hg merge $curBranch | |
hg ci -m "$Message is ready for staging" | |
hg up $curBranch | |
Write-Host "Do not forget to push!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment