Skip to content

Commit

Permalink
Merge pull request #207 from ralphbean/feature/optional-annotations
Browse files Browse the repository at this point in the history
Make merging in annotations to the task db optional.
  • Loading branch information
ralphbean committed Feb 20, 2015
2 parents 2a1cec7 + 52468ac commit 9b65f6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bugwarrior/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ def _bool_option(section, option, default):
)

legacy_matching = _bool_option(main_section, 'legacy_matching', 'True')
merge_annotations = _bool_option(main_section, 'merge_annotations', 'True')
merge_tags = _bool_option(main_section, 'merge_tags', 'True')

issue_updates = {
'new': [],
Expand All @@ -345,8 +347,11 @@ def _bool_option(section, option, default):
del issue_dict[field]

# Merge annotations & tags from online into our task object
merge_left('annotations', task, issue_dict, hamming=True)
merge_left('tags', task, issue_dict)
if merge_annotations:
merge_left('annotations', task, issue_dict, hamming=True)

if merge_tags:
merge_left('tags', task, issue_dict)

issue_dict.pop('annotations', None)
issue_dict.pop('tags', None)
Expand Down
4 changes: 4 additions & 0 deletions bugwarrior/docs/common_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Optional options include:
written. By default, logging messages will be written to stderr.
* ``annotation_length``: Import maximally this number of characters
of incoming annotations. Default: 45.
* ``merge_annotations``: If ``False``, bugwarrior won't bother with adding
annotations to your tasks at all. Default: ``True``.
* ``merge_tags``: If ``False``, bugwarrior won't bother with adding
tags to your tasks at all. Default: ``True``.

In addition to the ``[general]`` section, sections may be named
``[flavor.myflavor]`` and may be selected using the ``--flavor`` option to
Expand Down

0 comments on commit 9b65f6c

Please sign in to comment.