Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two command line options --open and --component-name #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def close(self):
parser.add_option('-m', '--milestones', action="store_true", default=False,
help='Migrate trac milestones to github milestones')

parser.add_option('--open', dest='only_open', action='store_true', default=False,
help="Only migrate open tickets")
parser.add_option('--component-name', dest='component_name', action='store_true', default=False,
help="Prepend the summary with the component name")

(options, args) = parser.parse_args()
try:
[trac_db_path, trac_url, trac_component, github_username, github_password, github_repo] = args
Expand Down Expand Up @@ -132,7 +137,15 @@ def close(self):

tickets = trac.sql('SELECT id, priority, type, summary, description, owner, reporter, milestone, time, status FROM ticket WHERE component="%s" ORDER BY id' % trac_component) # LIMIT 5
for tid, priority, ticket_type, summary, description, owner, reporter, milestone, timestamp, status in tickets:
summary += " (ros-pkg ticket #%d)" % tid

# If requested only syncronize open issues, so skip closed tickets
if options.only_open and status == 'closed':
continue

if options.component_name:
summary = trac_component+ ": " + summary

summary += " (ros ticket #%d)" % tid
labels = []
if ticket_type == "defect":
ticket_type = "bug";
Expand Down