rake/hg.rb in sysexits-1.0.0 vs rake/hg.rb in sysexits-1.0.1

- old
+ new

@@ -83,11 +83,11 @@ return paths end ### Return the list of files which are of status 'unknown' def get_unknown_files - list = read_command_output( 'hg', 'status', '-un', '--no-color' ) + list = read_command_output( 'hg', 'status', '-un', '--color', 'never' ) list = list.split( /\n/ ) trace "New files: %p" % [ list ] return list end @@ -213,17 +213,24 @@ desc "Pull and update from the default repo" task :pull do paths = get_repo_paths() if origin_url = paths['default'] ask_for_confirmation( "Pull and update from '#{origin_url}'?", false ) do - run 'hg', 'pull', '-u' + Rake::Task['hg:pull_without_confirmation'].invoke end else trace "Skipping pull: No 'default' path." end end + + desc "Pull and update without confirmation" + task :pull_without_confirmation do + run 'hg', 'pull', '-u' + end + + desc "Check the current code in if tests pass" task :checkin => ['hg:pull', 'hg:newfiles', 'test', COMMIT_MSG_FILE] do targets = get_target_args() $stderr.puts '---', File.read( COMMIT_MSG_FILE ), '---' ask_for_confirmation( "Continue with checkin?" ) do @@ -240,14 +247,19 @@ desc "Push to the default origin repo (if there is one)" task :push do paths = get_repo_paths() if origin_url = paths['default'] ask_for_confirmation( "Push to '#{origin_url}'?", false ) do - run 'hg', 'push' + Rake::Task['hg:push_without_confirmation'].invoke end else trace "Skipping push: No 'default' path." end + end + + desc "Push to the default repo without confirmation" + task :push_without_confirmation do + run 'hg', 'push' end end if HG_DOTDIR.exist?