Method: Externals::Ext#freeze

Defined in:
lib/externals/ext.rb

#freeze(args, options) ⇒ Object



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/externals/ext.rb', line 380

def freeze args, options
  project = subproject_by_name_or_path(args[0])

  raise "No such project named #{args[0]}" unless project

  revision = args[1] || project.current_revision

  section = configuration[project.path]

  if section[:branch]
    branch = project.current_branch
    if branch
      section[:branch] = branch
    else
      section.rm_setting :branch
    end
  end
  section[:revision] = revision
  configuration.write '.externals'
  reload_configuration

  subproject_by_name_or_path(args[0]).up
end