PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/bitbucket_hg.rb

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