PageRenderTime 52ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/bitbucket_hg.rb

https://bitbucket.org/steveqx/redmine_bitbucket
Ruby | 22 lines | 15 code | 5 blank | 2 comment | 1 complexity | 3c0cb8416acfd78464d473100bbc8624 MD5 | raw file
  1. class BitbucketHg < SystemCommand
  2. HG_BIN = Redmine::Configuration['scm_mercurial_command'] || "hg"
  3. def self.scm_class
  4. Repository::Mercurial
  5. end
  6. # Fetches updates from the remote repository
  7. def self.update_repository(local_url)
  8. command = HG_BIN + " --repository '#{local_url}' pull"
  9. exec(command)
  10. end
  11. # Clone repository from Bitbucket
  12. def self.clone_repository(path, local_url)
  13. remote_url = "ssh://hg@bitbucket.org/#{path}"
  14. command = HG_BIN + " clone --noupdate #{remote_url} #{local_url}"
  15. return exec(command)
  16. end
  17. end