342: def ChangeSet.create_target_path(filename)
343: path = File.split(filename)[0]
344:
345: if File.exist? path
346:
347:
348:
349: if not File.directory? path
350: UI.event :warn, "#{path} exists but is not a directory, deleting and recreating as a directory (will backup with ~ ending)"
351:
352: FileUtils::mv(path, path +"~")
353: FileUtils::rm_rf(path)
354:
355: UI.event :create, "creating path: #{path}"
356: FileUtils::mkdir_p(path)
357: end
358: else
359: UI.event :create, "creating path: #{path}"
360: FileUtils::mkdir_p(path)
361: end
362: end