GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of jwiegley/git-issues
Description: A distributed issue tracking system based on Git repositories, written in Python
Homepage: http://www.newartisans.com/software.html
Clone URL: git://github.com/ktf/git-issues.git
Adds a --filter-tags option to only show issues with a given tag attached.
ktf (author)
Fri Sep 12 14:55:10 -0700 2008
commit  d352c9e842ce32ffab6621c290a367c35a4ec0e3
tree    6c4ac07cdad45be0ca4f773cc61ede2e640f1a2f
parent  1bec1fbc710d28b6d4bc5f16e7a6fdb25565f055
...
948
949
950
 
 
 
 
 
 
951
952
953
...
1041
1042
1043
 
1044
1045
1046
...
1048
1049
1050
 
 
 
 
 
 
1051
1052
1053
...
948
949
950
951
952
953
954
955
956
957
958
959
...
1047
1048
1049
1050
1051
1052
1053
...
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
0
@@ -948,6 +948,12 @@ parser.add_option("--filter-status",
0
                   help = """does not print a bug if it is in one of
0
 the stati specified (column separated) by this option.""".replace("\n",""))
0
 
0
+parser.add_option("--filter-tags",
0
+ dest="filterTags",
0
+ default="",
0
+ help = """Prints only the issues with one of the following
0
+tags (column separated) associated to it.""")
0
+
0
 parser.add_option("--screen-width",
0
                   dest="screenWidth",
0
                   default=terminal_width(),
0
@@ -1041,6 +1047,7 @@ if __name__ == '__main__':
0
 
0
         index = 1
0
         filteredStati = options.filterStatus.split(":")
0
+ wantedTags = dict([(tag,1) for tag in options.filterTags.split(":") if tag])
0
 
0
         for item in issueSet.shelf.iteritems():
0
             if "comment" in item[0]:
0
@@ -1048,6 +1055,12 @@ if __name__ == '__main__':
0
             issue = item[1].get_data()
0
             if issue.status in filteredStati:
0
                 continue
0
+ if wantedTags and not issue.tags:
0
+ continue
0
+ if wantedTags:
0
+ matchingTags = [tag for tag in issue.tags.split(", ") if wantedTags.has_key(tag)]
0
+ if not matchingTags:
0
+ continue
0
             formatString = "%4d %s %-" + str(titleWidth+len("Title")-1) + "s %-6s %5s %6s %s"
0
             print formatString % \
0
                 (index, issue.name[:7], issue.title, issue.status,

Comments

    No one has commented yet.