···162162 end
163163164164 def dup_script(script, tree)
165165+ puts "writing update script to #{script.path}"
166166+165167 script.puts "#!/bin/sh -x"
166168 script.puts "if [ \"$TMPCVSDIR\" = \"\" ]; then echo 'set $TMPCVSDIR'; " +
167169 "exit 1; fi"
···193195 csid = nil
194196 @scanner.db.execute("SELECT
195197 files.file, changesets.commitid, changesets.author, changesets.date,
196196- revisions.version
198198+ revisions.version, changesets.branch
197199 FROM revisions
198200 LEFT OUTER JOIN files ON files.id = file_id
199201 LEFT OUTER JOIN changesets ON revisions.changeset_id = changesets.id
200200- WHERE revisions.commitid IS NULL
201201- ORDER BY changesets.date ASC, files.file ASC") do |rev|
202202+ ORDER BY changesets.csorder ASC, files.file ASC") do |rev|
202203 if csid == nil || rev["commitid"] != csid
203203- script.puts "# commit #{rev["commitid"]} at #{Time.at(rev["date"])} " +
204204- "by " + rev["author"]
204204+ script.puts "# #{Time.at(rev["date"])} by " + rev["author"] +
205205+ (rev["branch"].to_s == "" ? "" : " (branch #{rev["branch"]})")
205206 csid = rev["commitid"]
206207 end
207208
+4-3
openbsd-commitid.rb
···9494 # in the commitids-{tree} file
9595 sc.recalculate_commitids(CVSTMP, CVSROOT, tree, GENESIS)
96969797- # and finally, update every revision of every file and write its calculated
9898- # commitid, possibly replacing the random one already there
9999- sc.repo_surgery(CVSTMP, CVSROOT, tree)
9797+ # output a shell script to add/change all of the commitids in a clean repo
9898+ sc.outputter.dup_script(f = File.open("out/add_commitids_to_#{tree}.sh",
9999+ "w+"), tree)
100100+ f.close
100101end