From b2497a7f41dadedea6cf5bea80f467f5818c6311 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 17 2015 15:12:32 +0000 Subject: Add method to the internal API to remove tag(s) from a ticket --- diff --git a/progit/lib/__init__.py b/progit/lib/__init__.py index a4d7b9c..fb6984b 100644 --- a/progit/lib/__init__.py +++ b/progit/lib/__init__.py @@ -274,6 +274,25 @@ def remove_tags(session, project, tags): return msgs +def remove_tags_issue(session, issue, tags, ticketfolder): + ''' Removes the specified tag(s) of a issue. ''' + + if isinstance(tags, basestring): + tags = [tags] + + msgs = [] + for issue_tag in issue.tags: + if issue_tag.tag in tags: + tag = issue_tag.tag + session.delete(issue_tag) + msgs.append('Removed tag: %s' % tag) + + progit.lib.git.update_git_ticket( + issue, repo=issue.project, ticketfolder=ticketfolder) + + return msgs + + def edit_issue_tags(session, project, old_tag, new_tag): ''' Removes the specified tag of a project. '''