Skip to content
Browse files

Allow listing of authors

  • Loading branch information...
1 parent 6e40cd3 commit 76cbfc22b89c7f1dfa7e683d2849b0a2ff4eb8af @nominolo nominolo committed May 9, 2008
Showing with 18 additions and 0 deletions.
  1. +18 −0 darcs-to-git
View
18 darcs-to-git
@@ -11,6 +11,7 @@
require 'ostruct'
require 'rexml/document'
require 'optparse'
+require 'yaml'
# Explicitly setting a time zone would cause darcs to only output in
# that timezone hence we couldn't get the actual patch TZ
@@ -249,6 +250,19 @@ class DarcsPatch
def git_changed_files() git_ls_files(%w(? R C)) end
end
+def extract_authors(patches)
+ unique_authors = {}
+ patches.each do |p|
+ unique_authors[p.author] =
+ "#{p.author_name}" + (p.author_email.empty? ? "" : " <#{p.author_email}>")
+ end
+ puts "# You can use the following output as a starting point for an author_map"
+ puts "# Just fill in the proper text after the colon; put email addresses in"
+ puts "# angle brackets. You can remove any lines that look OK to you."
+ # TODO: Can we make the output sorted?
+ puts YAML::dump( unique_authors )
+end
+
def darcs_version
output_of(*%w(darcs -v)).scan(/(\d+)\.(\d+)\.(\d+)/).flatten.map {|v| v.to_i}
end
@@ -268,6 +282,10 @@ end
patches = DarcsPatch.read_from_repo(SRCREPO)
+if OPTIONS[:list_authors] then
+ extract_authors(patches)
+ exit(0)
+end
patches_to_pull = []
while patch = patches.pop

0 comments on commit 76cbfc2

Please sign in to comment.
Something went wrong with that request. Please try again.