lib/vclog/adapters/svn.rb in vclog-1.8.0 vs lib/vclog/adapters/svn.rb in vclog-1.8.1

- old
+ new

@@ -19,11 +19,11 @@ "VCLog requires xmlsimple for SVN support" end super(root) end - # + # Extract changes. def extract_changes log = [] xml = `svn log --xml`.strip @@ -39,17 +39,17 @@ next if msg.empty? next if msg == "*** empty log message ***" date = Time.parse(date) - log << [rev, date, who, msg] + log << Change.new(:id=>rev, :date=>date, :who=>who, :msg=>msg) end log end - # + # Extract tags. def extract_tags list = [] tagdir = tag_directory if tagdir @@ -76,11 +76,11 @@ commit = commits['logentry'].first msg = [commit["msg"]].flatten.compact.join('').strip date = [commit["date"]].flatten.compact.join('').strip - list << [name, rev, date, who, msg] + list << Tag.new(:name=>name, :id=>rev, :date=>date, :who=>who, :msg=>msg) end list end # This isn't perfect, but is there really anyway for it to be? @@ -125,13 +125,12 @@ # def uuid info['Repository UUID'] end - # + # TODO: Need to effect svn tag date. How? def tag(ref, label, date, message) - mfile = Tempfile.new("message") - mfile.open{ |f| f << message } + file = tempfile("message", message) Dir.chdir(root) do cmd = %[svn copy -r #{ref} -F "#{mfile.path}" . #{tag_directory}/#{label}] puts cmd if $DEBUG `#{cmd}` unless $DRYRUN