diff options
author | W. Trevor King <wking@drexel.edu> | 2011-04-16 15:19:31 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2011-04-16 15:19:31 -0400 |
commit | af99705c6e97544038209def209941d5a745c115 (patch) | |
tree | 3064c31339b841f9e0a7400e4c68e3d38217d0aa /libbe/command | |
parent | d3aded78a005078ac175b2664eda592c31341761 (diff) | |
download | bugseverywhere-af99705c6e97544038209def209941d5a745c115.tar.gz |
Add --preserve-uuids to `be import-xml`.
Diffstat (limited to 'libbe/command')
-rw-r--r-- | libbe/command/import_xml.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libbe/command/import_xml.py b/libbe/command/import_xml.py index b4da2fd..44205cb 100644 --- a/libbe/command/import_xml.py +++ b/libbe/command/import_xml.py @@ -76,6 +76,8 @@ class Import_XML (libbe.command.Command): help="If any comment's <in-reply-to> refers to a non-existent comment, ignore it (instead of raising an exception)."), libbe.command.Option(name='add-only', short_name='a', help='If any bug or comment listed in the XML file already exists in the bug repository, do not alter the repository version.'), + libbe.command.Option(name='preserve-uuids', short_name='p', + help='Preserve UUIDs for trusted input (potential name collisions).'), libbe.command.Option(name='comment-root', short_name='c', help='Supply a bug or comment ID as the root of any <comment> elements that are direct children of the <be-xml> element. If any such <comment> elements exist, you are required to set this option.', arg=libbe.command.Argument( @@ -131,11 +133,11 @@ class Import_XML (libbe.command.Command): for child in be_xml.getchildren(): if child.tag == 'bug': new = libbe.bug.Bug(bugdir=bugdir) - new.from_xml(child) + new.from_xml(child, preserve_uuids=params['preserve-uuids']) root_bugs.append(new) elif child.tag == 'comment': new = libbe.comment.Comment(croot_bug) - new.from_xml(child) + new.from_xml(child, preserve_uuids=params['preserve-uuids']) root_comments.append(new) elif child.tag == 'version': for gchild in child.getchildren(): |