| author | Dmitriy Morozov <morozov@cs.duke.edu> |
| Wed, 16 Apr 2008 17:21:40 -0400 | |
| changeset 21 | 5b3579dc7abf |
| parent 20 | 1630cf85c7f7 |
| child 24 | 17a8293bbbbf |
| permissions | -rw-r--r-- |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
1 |
# Author: Dmitriy Morozov <hg@foxcub.org>, 2007 |
|
19
c79f89b04676
Added vim instruction to expand tabs + number of comments aligned to preset width in ilist
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
18
diff
changeset
|
2 |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
3 |
"""A very simple and lightweight issue tracker for Mercurial.""" |
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
4 |
|
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
5 |
from mercurial import hg, util |
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
6 |
from mercurial.i18n import _ |
|
7
74cbd53bf7d8
Implemented basic filters functionality in ilist (fixing 8e4)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
6
diff
changeset
|
7 |
import os, time, random, mailbox, glob, socket, ConfigParser |
| 0 | 8 |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
9 |
|
|
5
cef66aa31468
ilist doesn't show fixed issues by default (instead of showing only new ones)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
4
diff
changeset
|
10 |
state = {'new': 'new', 'fixed': 'fixed'}
|
|
cef66aa31468
ilist doesn't show fixed issues by default (instead of showing only new ones)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
4
diff
changeset
|
11 |
state['default'] = state['new'] |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
12 |
issues_dir = ".issues" |
|
7
74cbd53bf7d8
Implemented basic filters functionality in ilist (fixing 8e4)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
6
diff
changeset
|
13 |
filter_prefix = ".filter" |
|
15
e5b03298394e
Fixed using Mirko Friedenhagen's observations the date bug (c56) + fixed timezones of all bugs
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
13
diff
changeset
|
14 |
date_format = '%a, %d %b %Y %H:%M:%S' |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
15 |
|
| 0 | 16 |
|
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
17 |
def ilist(ui, repo, **opts): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
18 |
"""List issues associated with the project""" |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
19 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
20 |
# Process options |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
21 |
show_all = opts['all'] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
22 |
properties = [] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
23 |
match_date, date_match = False, lambda x: True |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
24 |
if opts['date']: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
25 |
match_date, date_match = True, util.matchdate(opts['date']) |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
26 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
27 |
# Find issues |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
28 |
issues_path = os.path.join(repo.root, issues_dir) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
29 |
if not os.path.exists(issues_path): return |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
30 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
31 |
issues = glob.glob(os.path.join(issues_path, '*')) |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
32 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
33 |
# Process filter |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
34 |
if opts['filter']: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
35 |
filters = glob.glob(os.path.join(issues_path, filter_prefix + '*')) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
36 |
config = ConfigParser.SafeConfigParser() |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
37 |
config.read(filters) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
38 |
if not config.has_section(opts['filter']): |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
39 |
ui.warning('No filter %s defined\n', opts['filter'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
40 |
else: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
41 |
properties += config.items(opts['filter']) |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
42 |
|
|
18
57157f212cde
Fix for nonworking property option in ilist.
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
17
diff
changeset
|
43 |
properties += _get_properties(opts['property']) |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
44 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
45 |
for issue in issues: |
| 21 | 46 |
mbox = mailbox.Maildir(issue, factory=mailbox.MaildirMessage) |
47 |
root = _find_root_key(mbox) |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
48 |
property_match = True |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
49 |
for property,value in properties: |
| 21 | 50 |
property_match = property_match and (mbox[root][property] == value) |
51 |
if not show_all and (not properties or not property_match) and (properties or mbox[root]['State'].upper() == state['fixed'].upper()): continue |
|
|
5
cef66aa31468
ilist doesn't show fixed issues by default (instead of showing only new ones)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
4
diff
changeset
|
52 |
|
|
cef66aa31468
ilist doesn't show fixed issues by default (instead of showing only new ones)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
4
diff
changeset
|
53 |
|
| 21 | 54 |
if match_date and not date_match(util.parsedate(mbox[root]['date'])[0]): continue |
|
19
c79f89b04676
Added vim instruction to expand tabs + number of comments aligned to preset width in ilist
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
18
diff
changeset
|
55 |
ui.write("%s (%3d) [%s]: %s\n" % (issue[len(issues_path)+1:], # +1 for trailing /
|
|
c79f89b04676
Added vim instruction to expand tabs + number of comments aligned to preset width in ilist
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
18
diff
changeset
|
56 |
len(mbox)-1, # number of replies (-1 for self) |
| 21 | 57 |
mbox[root]['State'], |
58 |
mbox[root]['Subject'])) |
|
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
59 |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
60 |
|
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
61 |
def iadd(ui, repo, id = None, comment = 0): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
62 |
"""Adds a new issue, or comment to an existing issue ID or its comment COMMENT""" |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
63 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
64 |
comment = int(comment) |
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
65 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
66 |
# First, make sure issues have a directory |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
67 |
issues_path = os.path.join(repo.root, issues_dir) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
68 |
if not os.path.exists(issues_path): os.mkdir(issues_path) |
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
69 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
70 |
if id: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
71 |
issue_fn, issue_id = _find_issue(ui, repo, id) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
72 |
if not issue_fn: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
73 |
ui.warn('No such issue\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
74 |
return |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
75 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
76 |
user = ui.username() |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
77 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
78 |
default_issue_text = "From: %s\nDate: %s\n" % (user, util.datestr(format = date_format)) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
79 |
if not id: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
80 |
default_issue_text += "State: %s\n" % state['default'] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
81 |
default_issue_text += "Subject: brief description\n\n" |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
82 |
default_issue_text += "Detailed description." |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
83 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
84 |
issue = ui.edit(default_issue_text, user) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
85 |
if issue.strip() == '': |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
86 |
ui.warn('Empty issue, ignoring\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
87 |
return |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
88 |
if issue.strip() == default_issue_text: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
89 |
ui.warn('Unchanged issue text, ignoring\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
90 |
return |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
91 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
92 |
# Create the message |
| 21 | 93 |
msg = mailbox.MaildirMessage(issue) |
94 |
#msg.set_from('artemis', True)
|
|
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
95 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
96 |
# Pick random filename |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
97 |
if not id: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
98 |
issue_fn = issues_path |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
99 |
while os.path.exists(issue_fn): |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
100 |
issue_id = _random_id() |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
101 |
issue_fn = os.path.join(issues_path, issue_id) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
102 |
# else: issue_fn already set |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
103 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
104 |
# Add message to the mailbox |
| 21 | 105 |
mbox = mailbox.Maildir(issue_fn) |
106 |
keys = _order_keys_date(mbox) |
|
107 |
mbox.lock() |
|
108 |
if id and comment >= len(mbox): |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
109 |
ui.warn('No such comment number in mailbox, commenting on the issue itself\n')
|
| 21 | 110 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
111 |
if not id: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
112 |
msg.add_header('Message-Id', "<%s-0-artemis@%s>" % (issue_id, socket.gethostname()))
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
113 |
else: |
| 21 | 114 |
root = keys[0] |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
115 |
msg.add_header('Message-Id', "<%s-%s-artemis@%s>" % (issue_id, _random_id(), socket.gethostname()))
|
| 21 | 116 |
msg.add_header('References', mbox[(comment < len(mbox) and keys[comment]) or root]['Message-Id'])
|
117 |
msg.add_header('In-Reply-To', mbox[(comment < len(mbox) and keys[comment]) or root]['Message-Id'])
|
|
118 |
repo.add([issue_fn[(len(repo.root)+1):] + '/new/' + mbox.add(msg)]) # +1 for the trailing / |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
119 |
mbox.close() |
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
120 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
121 |
# If adding issue, add the new mailbox to the repository |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
122 |
if not id: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
123 |
ui.status('Added new issue %s\n' % issue_id)
|
|
1
0bbf290d6f07
Commit artemis before cleaning repository
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
0
diff
changeset
|
124 |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
125 |
|
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
126 |
def ishow(ui, repo, id, comment = 0, **opts): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
127 |
"""Shows issue ID, or possibly its comment COMMENT""" |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
128 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
129 |
comment = int(comment) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
130 |
issue, id = _find_issue(ui, repo, id) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
131 |
if not issue: return |
| 21 | 132 |
mbox = mailbox.Maildir(issue, factory=mailbox.MaildirMessage) |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
133 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
134 |
if opts['all']: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
135 |
ui.write('='*70 + '\n')
|
| 21 | 136 |
i = 0 |
137 |
keys = _order_keys_date(mbox) |
|
138 |
for k in keys: |
|
139 |
_write_message(ui, mbox[k], i) |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
140 |
ui.write('-'*70 + '\n')
|
| 21 | 141 |
i += 1 |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
142 |
return |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
143 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
144 |
_show_mbox(ui, mbox, comment) |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
145 |
|
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
146 |
|
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
147 |
def iupdate(ui, repo, id, **opts): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
148 |
"""Update properties of issue ID""" |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
149 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
150 |
issue, id = _find_issue(ui, repo, id) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
151 |
if not issue: return |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
152 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
153 |
properties = _get_properties(opts['property']) |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
154 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
155 |
# Read the issue |
| 21 | 156 |
mbox = mailbox.Maildir(issue, factory=mailbox.MaildirMessage) |
157 |
root = _find_root_key(mbox) |
|
158 |
msg = mbox[root] |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
159 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
160 |
# Fix the properties |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
161 |
properties_text = '' |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
162 |
for property, value in properties: |
|
20
1630cf85c7f7
Fixed error on changing non-existent property in iupdate
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
19
diff
changeset
|
163 |
if property in msg: |
|
1630cf85c7f7
Fixed error on changing non-existent property in iupdate
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
19
diff
changeset
|
164 |
msg.replace_header(property, value) |
|
1630cf85c7f7
Fixed error on changing non-existent property in iupdate
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
19
diff
changeset
|
165 |
else: |
|
1630cf85c7f7
Fixed error on changing non-existent property in iupdate
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
19
diff
changeset
|
166 |
msg.add_header(property, value) |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
167 |
properties_text += '%s=%s\n' % (property, value) |
| 21 | 168 |
mbox.lock() |
169 |
mbox[root] = msg |
|
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
170 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
171 |
# Write down a comment about updated properties |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
172 |
if properties and not opts['no_property_comment']: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
173 |
user = ui.username() |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
174 |
properties_text = "From: %s\nDate: %s\nSubject: properties changes (%s)\n\n%s" % \ |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
175 |
(user, util.datestr(format = date_format), |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
176 |
_pretty_list(list(set([property for property, value in properties]))), |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
177 |
properties_text) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
178 |
msg = mailbox.mboxMessage(properties_text) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
179 |
msg.add_header('Message-Id', "<%s-%s-artemis@%s>" % (id, _random_id(), socket.gethostname()))
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
180 |
msg.add_header('References', mbox[0]['Message-Id'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
181 |
msg.add_header('In-Reply-To', mbox[0]['Message-Id'])
|
| 21 | 182 |
#msg.set_from('artemis', True)
|
183 |
repo.add([issue_fn[(len(repo.root)+1):] + '/new/' + mbox.add(msg)]) # +1 for the trailing / |
|
184 |
mbox.close() |
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
185 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
186 |
# Show updated message |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
187 |
_show_mbox(ui, mbox, 0) |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
188 |
|
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
189 |
|
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
190 |
def _find_issue(ui, repo, id): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
191 |
issues_path = os.path.join(repo.root, issues_dir) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
192 |
if not os.path.exists(issues_path): return False |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
193 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
194 |
issues = glob.glob(os.path.join(issues_path, id + '*')) |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
195 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
196 |
if len(issues) == 0: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
197 |
return False, 0 |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
198 |
elif len(issues) > 1: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
199 |
ui.status("Multiple choices:\n")
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
200 |
for i in issues: ui.status(' ', i[len(issues_path)+1:], '\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
201 |
return False, 0 |
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
202 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
203 |
return issues[0], issues[0][len(issues_path)+1:] |
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
204 |
|
|
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
205 |
def _get_properties(property_list): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
206 |
return [p.split('=') for p in property_list]
|
|
17
f70d7e98eb21
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
16
diff
changeset
|
207 |
|
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
208 |
def _write_message(ui, message, index = 0): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
209 |
if index: ui.write("Comment: %d\n" % index)
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
210 |
if ui.verbose: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
211 |
ui.write(message.as_string().strip() + '\n') |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
212 |
else: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
213 |
if 'From' in message: ui.write('From: %s\n' % message['From'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
214 |
if 'Date' in message: ui.write('Date: %s\n' % message['Date'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
215 |
if 'Subject' in message: ui.write('Subject: %s\n' % message['Subject'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
216 |
if 'State' in message: ui.write('State: %s\n' % message['State'])
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
217 |
ui.write('\n' + message.get_payload().strip() + '\n')
|
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
218 |
|
|
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
219 |
def _show_mbox(ui, mbox, comment): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
220 |
# Output the issue (or comment) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
221 |
if comment >= len(mbox): |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
222 |
comment = 0 |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
223 |
ui.warn('Comment out of range, showing the issue itself\n')
|
| 21 | 224 |
keys = _order_keys_date(mbox) |
225 |
root = keys[0] |
|
226 |
msg = mbox[keys[comment]] |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
227 |
ui.write('='*70 + '\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
228 |
if comment: |
| 21 | 229 |
ui.write('Subject: %s\n' % mbox[root]['Subject'])
|
230 |
ui.write('State: %s\n' % mbox[root]['State'])
|
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
231 |
ui.write('-'*70 + '\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
232 |
_write_message(ui, msg, comment) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
233 |
ui.write('-'*70 + '\n')
|
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
234 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
235 |
# Read the mailbox into the messages and children dictionaries |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
236 |
messages = {}
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
237 |
children = {}
|
| 21 | 238 |
i = 0 |
239 |
for k in keys: |
|
240 |
m = mbox[k] |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
241 |
messages[m['Message-Id']] = (i,m) |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
242 |
children.setdefault(m['In-Reply-To'], []).append(m['Message-Id']) |
| 21 | 243 |
i += 1 |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
244 |
children[None] = [] # Safeguard against infinte loop on empty Message-Id |
|
4
bf71e2069dbd
Basic functionality in place; added feature request for integration with commit (ef1)
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
2
diff
changeset
|
245 |
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
246 |
# Iterate over children |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
247 |
id = msg['Message-Id'] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
248 |
id_stack = (id in children and map(lambda x: (x, 1), reversed(children[id]))) or [] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
249 |
if not id_stack: return |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
250 |
ui.write('Comments:\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
251 |
while id_stack: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
252 |
id,offset = id_stack.pop() |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
253 |
id_stack += (id in children and map(lambda x: (x, offset+1), reversed(children[id]))) or [] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
254 |
index, msg = messages[id] |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
255 |
ui.write(' '*offset + ('%d: ' % index) + msg['Subject'] + '\n')
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
256 |
ui.write('-'*70 + '\n')
|
|
2
9e804a85c82c
list works well, basic show, add, and update functionality
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
1
diff
changeset
|
257 |
|
| 21 | 258 |
def _find_root_key(maildir): |
259 |
for k,m in maildir.iteritems(): |
|
260 |
if 'in-reply-to' not in m: |
|
261 |
return k |
|
262 |
||
263 |
def _order_keys_date(mbox): |
|
264 |
keys = mbox.keys() |
|
265 |
root = _find_root_key(mbox) |
|
266 |
keys.sort(lambda k1,k2: -(k1 == root) or cmp(util.parsedate(mbox[k1]['date']), util.parsedate(mbox[k2]['date']))) |
|
267 |
return keys |
|
268 |
||
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
269 |
def _pretty_list(lst): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
270 |
s = '' |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
271 |
for i in lst: |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
272 |
s += i + ', ' |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
273 |
return s[:-2] |
|
6
11cab5930258
Function rename + pretty list
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
5
diff
changeset
|
274 |
|
|
8
b1f268a9e4ed
Message-Ids in <...> + randomized comment ids
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
7
diff
changeset
|
275 |
def _random_id(): |
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
276 |
return "%x" % random.randint(2**63, 2**64-1) |
|
8
b1f268a9e4ed
Message-Ids in <...> + randomized comment ids
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
7
diff
changeset
|
277 |
|
| 0 | 278 |
|
279 |
cmdtable = {
|
|
|
16
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
280 |
'ilist': (ilist, |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
281 |
[('a', 'all', False,
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
282 |
'list all issues (by default only those with state new)'), |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
283 |
('p', 'property', [],
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
284 |
'list issues with specific field values (e.g., -p state=fixed)'), |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
285 |
('d', 'date', '', 'restrict to issues matching the date (e.g., -d ">12/28/2007)"'),
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
286 |
('f', 'filter', '', 'restrict to pre-defined filter (in %s/%s*)' % (issues_dir, filter_prefix))],
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
287 |
_('hg ilist [OPTIONS]')),
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
288 |
'iadd': (iadd, |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
289 |
[], |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
290 |
_('hg iadd [ID] [COMMENT]')),
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
291 |
'ishow': (ishow, |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
292 |
[('a', 'all', None, 'list all comments')],
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
293 |
_('hg ishow [OPTIONS] ID [COMMENT]')),
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
294 |
'iupdate': (iupdate, |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
295 |
[('p', 'property', [],
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
296 |
'update properties (e.g., -p state=fixed)'), |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
297 |
('n', 'no-property-comment', None,
|
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
298 |
'do not add a comment about changed properties')], |
|
49645303d045
Spaces instead of tabs
Mirko Friedenhagen <mirko.friedenhagen@1und1.de>
parents:
15
diff
changeset
|
299 |
_('hg iupdate [OPTIONS] ID'))
|
| 0 | 300 |
} |
|
19
c79f89b04676
Added vim instruction to expand tabs + number of comments aligned to preset width in ilist
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
18
diff
changeset
|
301 |
|
|
c79f89b04676
Added vim instruction to expand tabs + number of comments aligned to preset width in ilist
Dmitriy Morozov <morozov@cs.duke.edu>
parents:
18
diff
changeset
|
302 |
# vim: expandtab |