I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

hooks-support.patch

Takashi Okamoto, 17 Sep 2011 10:42

Download (6.58 KB)

View differences:

config/scm.yml
5 5
    path: /var/lib/svn
6 6
    svnadmin: /usr/bin/svnadmin
7 7
    url: svn
8
 #  hooks: /etc/svn/hooks
9

  
8 10
  git:
9 11
    path: /var/lib/git
10 12
    git: /usr/bin/git
......
12 14
    url: http://git.myhost.com
13 15
    update_server_info: true
14 16
    git_ext: true
17
 #  hooks: /etc/git/hooks
18

  
15 19
  mercurial:
16 20
    path: /var/lib/mercurial
17 21
    hg: /usr/bin/hg
22
 #  hooks: /etc/mercurial/hgrc
18 23

  
19 24
development:
lib/scm_project_patch.rb
54 54
                            end
55 55
                            if system(*args)
56 56
                                @repository.created_with_scm = true
57
                                if svnconf['hooks']
58
                                    copyhooks = ['/bin/cp','-anr']                                
59
                                    copyhooks += Dir.glob(svnconf['hooks']+'/*')
60
                                    copyhooks << "#{path}/hooks/"
61
                                    if !system(*copyhooks)
62
                                        RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
63
                                    end
64
                                end       
57 65
                            else
58 66
                                RAILS_DEFAULT_LOGGER.error "Repository creation failed"
59 67
                            end
......
85 93
                                        system(gitconf['git'], 'update-server-info')
86 94
                                    end
87 95
                                end
96
                                if gitconf['hooks']
97
                                    copyhooks = ['/bin/cp','-anr']                                
98
                                    copyhooks += Dir.glob(gitconf['hooks']+'/*')
99
                                    copyhooks << "#{path}/hooks/"
100
                                    if !system(*copyhooks)
101
                                        RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
102
                                    end
103
                                end
88 104
                            else
89 105
                                RAILS_DEFAULT_LOGGER.error "Repository creation failed"
90 106
                            end
......
109 125
                            args << path
110 126
                            if system(*args)
111 127
                                @repository.created_with_scm = true
128
                                RAILS_DEFAULT_LOGGER.warn hgconf['hooks']                                                            
129
                                if hgconf['hooks']
130
                                    copyhooks = ['/bin/cp','-anr']                                
131
                                    copyhooks << hgconf['hooks']
132
                                    copyhooks << "#{path}/.hg/hgrc"
133
                                    if !system(*copyhooks)
134
                                        RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
135
                                    end
136
                                end       
112 137
                            else
113 138
                                RAILS_DEFAULT_LOGGER.error "Repository creation failed"
114 139
                            end
lib/scm_repositories_controller_patch.rb
98 98
                                    end
99 99
                                    if system(*args)
100 100
                                        @repository.created_with_scm = true
101
                                        if svnconf['hooks']
102
                                            copyhooks = ['/bin/cp','-anr']                                
103
                                            copyhooks += Dir.glob(svnconf['hooks']+'/*')
104
                                            copyhooks << "#{path}/hooks/"
105
                                            if !system(*copyhooks)
106
                                                RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
107
                                            end
108
                                        end       
101 109
                                    else
102 110
                                        RAILS_DEFAULT_LOGGER.error "Repository creation failed"
103 111
                                    end
......
136 144
                                                system(gitconf['git'], 'update-server-info')
137 145
                                            end
138 146
                                        end
147
                                        if gitconf['hooks']
148
                                            copyhooks = ['/bin/cp','-anr']                                
149
                                            copyhooks += Dir.glob(gitconf['hooks']+'/*')
150
                                            copyhooks << "#{path}/hooks/"
151
                                            if !system(*copyhooks)
152
                                                RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
153
                                            end
154
                                        end
139 155
                                    else
140 156
                                        RAILS_DEFAULT_LOGGER.error "Repository creation failed"
141 157
                                    end
......
169 185
                                    args << repath
170 186
                                    if system(*args)
171 187
                                        @repository.created_with_scm = true
188
                                        if hgconf['hooks']
189
                                            copyhooks = ['/bin/cp','-anr']                                
190
                                            copyhooks << hgconf['hooks']
191
                                            copyhooks << "#{path}/.hg/hgrc"
192
                                            if !system(*copyhooks)
193
                                                RAILS_DEFAULT_LOGGER.warn "Hooks copy failed"
194
                                            end
195
                                        end  
172 196
                                    else
173 197
                                        RAILS_DEFAULT_LOGGER.error "Repository creation failed"
174 198
                                    end
Terms of use | Privacy policy