# HG changeset patch # User Peter Sanchez # Date 1448933912 28800 # Mon Nov 30 17:38:32 2015 -0800 # Node ID 78f7ec6d8c9b7852c4c2d8d98c5c3da9c1f3d977 # Parent b33e677041de2f00860a400364c13e4734879f1a # Parent 66ee495f0d842ab4b1173b7ffe90995c1094d896 Merging in remote updates diff --git a/README b/README --- a/README +++ b/README @@ -20,7 +20,7 @@ 1. Installing the plugin 1. Install the json gem on the machine where Redmine is running. 2. Follow the plugin installation procedure at http://www.redmine.org/wiki/redmine/Plugins. - 3. This directory MUST BE NAMED: redmine_bitbucket_hook - For example, to clone it to your plugins directory, do: hg clone http://bitbucket.org/nolith/redmine-bitbucket redmine_bitbucket_hook + 3. This directory MUST BE NAMED: redmine_bitbucket_hook - For example, to clone it to your plugins directory, do: hg clone https://bitbucket.org/petersanchez/redmine-bitbucket redmine_bitbucket_hook 4. Restart your Redmine. 5. If you already have a local Mercurial repository set up and working from Redmine go to step 3, otherwise continue at step 2. diff --git a/app/controllers/bitbucket_hook_controller.rb b/app/controllers/bitbucket_hook_controller.rb --- a/app/controllers/bitbucket_hook_controller.rb +++ b/app/controllers/bitbucket_hook_controller.rb @@ -13,7 +13,7 @@ project = Project.find_by_identifier(identifier) raise ActiveRecord::RecordNotFound, "No project found with identifier '#{identifier}'" if project.nil? - + repository = project.repository raise TypeError, "Project '#{identifier}' has no repository" if repository.nil? raise TypeError, "Repository for project '#{identifier}' is not a BitBucket repository" unless repository.is_a?(Repository::Mercurial) || repository.is_a?(Repository::Git) @@ -22,7 +22,7 @@ if repository.is_a?(Repository::Git) update_git_repository(repository) else - command = "cd \"#{repository.url}\" && hg pull" + command = "hg --repository \"#{repository.url}\" pull" exec(command) end @@ -33,7 +33,7 @@ end private - + def exec(command) logger.info { "BitbucketHook: Executing command: '#{command}'" } output = Kernel.system("#{command}")