# HG changeset patch # User Sean Russell # Date 1265584360 18000 # Sun Feb 07 18:12:40 2010 -0500 # Node ID fa4a269ec82b346071fb303086262fe29c1cabf8 # Parent be9041d2a354d04fd0068140d9412933ca9695cf Fixed another sync issue, when milestone is empty diff --git a/.ditz/issue-49e1a542fa71ec55f13e14510eb718fd12076ac2.yaml b/.ditz/issue-49e1a542fa71ec55f13e14510eb718fd12076ac2.yaml new file mode 100644 --- /dev/null +++ b/.ditz/issue-49e1a542fa71ec55f13e14510eb718fd12076ac2.yaml @@ -0,0 +1,19 @@ +--- !ditz.rubyforge.org,2008-03-06/issue +title: Sync release state +desc: "" +type: :bugfix +component: ditz-trac +release: "2010.3" +reporter: Sean Russell +status: :unstarted +disposition: +creation_time: 2010-01-31 16:19:21.027426 Z +references: [] + +id: 49e1a542fa71ec55f13e14510eb718fd12076ac2 +log_events: +- - 2010-01-31 16:19:21.028082 Z + - Sean Russell + - created + - "" +trac_id: diff --git a/.ditz/issue-5d57b70131fb27ce72800ba271ec674b6612927b.yaml b/.ditz/issue-5d57b70131fb27ce72800ba271ec674b6612927b.yaml new file mode 100644 --- /dev/null +++ b/.ditz/issue-5d57b70131fb27ce72800ba271ec674b6612927b.yaml @@ -0,0 +1,19 @@ +--- !ditz.rubyforge.org,2008-03-06/issue +title: Milestone states aren't being synced +desc: "" +type: :bugfix +component: ditz-trac +release: +reporter: Sean Russell +status: :unstarted +disposition: +creation_time: 2010-02-07 23:04:03.690342 Z +references: [] + +id: 5d57b70131fb27ce72800ba271ec674b6612927b +log_events: +- - 2010-02-07 23:04:03.690972 Z + - Sean Russell + - created + - "" +trac_id: diff --git a/trac-sync.rb b/trac-sync.rb --- a/trac-sync.rb +++ b/trac-sync.rb @@ -85,6 +85,7 @@ "enhancement" => :feature, "task" => :task } DTYPE_TTYPE = TTYPE_DTYPE.invert + DTYPE_TTYPE[:bug] = "defect" # trac_resolution -> ditz_disposition RES_DISPO = { "fixed" => :fixed, "wontfix" => :wontfix, @@ -166,10 +167,11 @@ maybe_create_milestones maybe_create_components issues.each do |t,i| # t will always be nil + raise "No DTYPE for #{i.type}" if DTYPE_TTYPE[ i.type ].nil? attrs = { #"created_at" => i.creation_time, "type" => DTYPE_TTYPE[ i.type ], - #"reporter" => i.reporter || "", + "reporter" => i.reporter || "", "milestone" => i.release || "", "component" => i.component || "", "status" => DSTATUS_TSTATUS[ i.status ] || "", @@ -254,6 +256,7 @@ attrs["summary"] = issue.title if issue.title != ticket.summary attrs["description"] = issue.desc if issue.desc != ticket.description attrs["milestone"] = issue.release if issue.release != ticket.milestone + attrs["milestone"] = "" unless attrs["milestone"] if DSTATUS_TSTATUS[issue.status] != ticket.status attrs["status"] = DSTATUS_TSTATUS[issue.status] end @@ -524,7 +527,7 @@ class Operator - operation :trac, "Sync with a Trac repository", :maybe_debug, :maybe_verbose, :maybe_version do + operation :trac, "Sync with a Trac repository", :maybe_debug, :maybe_verbose do opt :debug, "Run in debug mode, for very verbose output", :short => 'd', :default => false opt :verbose, "Run in verbose mode", :short => 'v', :default => false end