Commits

Yuya Nishihara committed 2333603

fix annotate identifier

  • Participants
  • Parent commits 3c6783a

Comments (0)

Files changed (1)

 # User Yuya Nishihara <yuya@tcha.org>
 # Date 1269353640 -32400
 # Node ID 70565b34286555916f5b865104285fb422e60a1f
-# Parent 3fce50a6624b23492d274d9c66302fae65374b19
+# Parent 24d5ae0a350ded255a65003729ef4c654e61369d
 mercurial: rewrite scm.annotate
 
  * Now fetches nodeid.
 diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb
 +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
-@@ -178,21 +178,17 @@ module Redmine
+@@ -178,21 +178,18 @@ module Redmine
          end
          
          def annotate(path, identifier=nil)
 +          hg 'annotate', '-ncu', '-r', hgrev(identifier), without_leading_slash(path) do |io|
 +            io.each do |line|
 +              next unless line =~ %r{^([^:]+)\s(\d+)\s([0-9a-f]+):(.*)$}
-+              r = Revision.new(:author => $1.strip, :revision => $2, :scmid => $3)
++              r = Revision.new(:author => $1.strip, :revision => $2, :scmid => $3,
++                               :identifier => $3)
 +              blame.add_line($4.rstrip, r)
              end
            end