Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (17 sloc) 517 Bytes
#!/usr/bin/env ruby
#
# Usage: hg-import MANIFEST_FILE [ARGUMENTS_FOR_HG_IMPORT...]
#
# Imports revisions exported from Mercurial as diff(1) patches,
# which need to be in the same directory as the MANIFEST_FILE.
#
# Written in 2006 by Suraj N. Kurapati <https://github.com/sunaku>
if manifest = ARGV.shift
diffDir = File.dirname(manifest)
File.readlines(manifest).reverse!.each do |r|
r.chomp!
args = %w(hg import).concat(ARGV)
args << File.join(diffDir, "#{r}.diff")
system(*args)
end
end