#! /usr/bin/env ruby # p ARGV # p Dir['*/.hg'].map { |path| File.absolute_path File.dirname path } parent_dir = Dir.pwd Dir['*/.hg'].map { |path| File.absolute_path File.dirname path }.each do |path| Dir.chdir path puts path system "hg #{ARGV.join ' '}" puts '' end Dir.chdir parent_dir