Push active bookmark (if any) when running task `workflow:push-staging` or...
...task `workflow:push-upstream`.
# This file contains various tasks usefull for Smalltalk/X jv-branch
# development. Currently it only supports working with Mercurial repositories,
# Honestly, there's not much one can do with CVS, we're using it only for
# packages that have not been converted to Mercurial.
namespace :'workflow' do
# A helper function to :push-upstream and push-staging tasks
def push(remote, user, pass)
project.packages_and_application.each do | pkg |
if not pkg.nested_package? then
repo = Rake::Stx::Configuration::Repository::find(pkg.repository)
if repo.type == :'hg' then
hg = HG::Repository.new(BUILD_DIR / pkg.directory)
opts = {
:user => user,
:pass => pass,
}
if hg.bookmark() then
opts[:bookmarks] = '.'
else
opts[:rev] = '.'
end
hg.push(remote, **opts)
end
end
end
end
desc "Push currently checked out revisions to upstream repositories (to be called after all tests pass on all configurations)"
task :'push-upstream', :user, :pass do | t, args |
push('default', args[:user] || nil, args[:pass] || nil)
end
task :'push-upstream' => :'setup'
desc "Push currently checked out revisions to staging repositories (to be by developer to test her changes)"
task :'push-staging', :user, :pass do | t, args |
push('staging', args[:user] || nil, args[:pass] || nil)
end
task :'push-staging' => :'setup'
end