module Hoe::MercurialHelpers

def hg_ignore_files( *pathnames )

## Add the list of +pathnames+ to the .hgignore list.
def hg_ignore_files( *pathnames )
	patterns = pathnames.flatten.collect do |path|
		'^' + Regexp.escape(path) + '$'
	end
	trace "Ignoring %d files." % [ pathnames.length ]
	IGNORE_FILE.open( File::CREAT|File::WRONLY|File::APPEND, 0644 ) do |fh|
		fh.puts( patterns )
	end
end