Skip to content

Instantly share code, notes, and snippets.

@chaliy
Created July 18, 2011 20:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chaliy/1090570 to your computer and use it in GitHub Desktop.
Simple script to commit changes to staging branch.
# 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