Skip to content

Commit

Permalink
* To see a list of modified files in the email body. (Mercurial)
Browse files Browse the repository at this point in the history
  • Loading branch information
cou2jpn committed Nov 30, 2011
1 parent 0eb9186 commit 2d66a58
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
name 'Redmine Diff Email Plugin'
author 'Kah Seng Tay, Sergey Generalov, Lamar, Ivan Evtuhovich, cou2jpn'
description 'This is a plugin for Redmine that sends diff emails on commits.'
version 'c.1.2.0'
version 'c.1.3.0'
end

Dispatcher.to_prepare do
Changeset.send(:include, ChangesetPatch)
Repository.send(:include, RepositoryPatch)
Redmine::Scm::Adapters::SubversionAdapter.send(:include,SubversionAdapterPatch)
Redmine::Scm::Adapters::GitAdapter.send(:include,GitAdapterPatch)
Redmine::Scm::Adapters::MercurialAdapter.send(:include,MercurialAdapterPatch)
end
26 changes: 26 additions & 0 deletions lib/mercurial_adapter_patch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require_dependency 'lib/redmine/scm/adapters/mercurial_adapter'

module MercurialAdapterPatch
def self.included(base)
base.send(:include, InstanceMethods)
end

module InstanceMethods
def changed_files(path=nil, rev="HEAD")
path ||= ''
hg_args = []
hg_args << "status" << "--change" << rev
unless path.blank?
p = scm_iconv(@path_encoding, 'UTF-8', path)
hg_args << CGI.escape(hgtarget(p))
end
changed_files = []
hg *hg_args do |io|
io.each_line do |line|
changed_files << line
end
end
changed_files
end
end
end

0 comments on commit 2d66a58

Please sign in to comment.