Show More
@@ -153,8 +153,17 b' class patchheader(object):' | |||||
153 | self.user = user |
|
153 | self.user = user | |
154 |
|
154 | |||
155 | def setdate(self, date): |
|
155 | def setdate(self, date): | |
156 | if self.updateheader(['# Date '], date): |
|
156 | if not self.updateheader(['Date: ', '# Date '], date): | |
157 | self.date = date |
|
157 | try: | |
|
158 | patchheaderat = self.comments.index('# HG changeset patch') | |||
|
159 | self.comments.insert(patchheaderat + 1, '# Date ' + date) | |||
|
160 | except ValueError: | |||
|
161 | if self._hasheader(['From: ']): | |||
|
162 | self.comments = ['Date: ' + date] + self.comments | |||
|
163 | else: | |||
|
164 | tmp = ['# HG changeset patch', '# Date ' + date, ''] | |||
|
165 | self.comments = tmp + self.comments | |||
|
166 | self.date = date | |||
158 |
|
167 | |||
159 | def setmessage(self, message): |
|
168 | def setmessage(self, message): | |
160 | if self.comments: |
|
169 | if self.comments: | |
@@ -2599,8 +2608,8 b' cmdtable = {' | |||||
2599 | ('s', 'short', None, _('refresh only files already in the patch and specified files')), |
|
2608 | ('s', 'short', None, _('refresh only files already in the patch and specified files')), | |
2600 | ('U', 'currentuser', None, _('add/update "From: <current user>" in patch')), |
|
2609 | ('U', 'currentuser', None, _('add/update "From: <current user>" in patch')), | |
2601 | ('u', 'user', '', _('add/update "From: <given user>" in patch')), |
|
2610 | ('u', 'user', '', _('add/update "From: <given user>" in patch')), | |
2602 |
('D', 'currentdate', None, _('update "Date: <current date>" in patch |
|
2611 | ('D', 'currentdate', None, _('add/update "Date: <current date>" in patch')), | |
2603 |
('d', 'date', '', _('update "Date: <given date>" in patch |
|
2612 | ('d', 'date', '', _('add/update "Date: <given date>" in patch')) | |
2604 | ] + commands.walkopts + commands.commitopts, |
|
2613 | ] + commands.walkopts + commands.commitopts, | |
2605 | _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...')), |
|
2614 | _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...')), | |
2606 | 'qrename|qmv': |
|
2615 | 'qrename|qmv': |
@@ -35,6 +35,10 b' diff -r ... 2' | |||||
35 | 1: [mq]: 2.patch - test |
|
35 | 1: [mq]: 2.patch - test | |
36 | 0: [mq]: 1.patch - test |
|
36 | 0: [mq]: 1.patch - test | |
37 | ==== qref -d |
|
37 | ==== qref -d | |
|
38 | # HG changeset patch | |||
|
39 | # Date 5 0 | |||
|
40 | ||||
|
41 | ||||
38 | diff -r ... 2 |
|
42 | diff -r ... 2 | |
39 | --- /dev/null |
|
43 | --- /dev/null | |
40 | +++ b/2 |
|
44 | +++ b/2 | |
@@ -118,6 +122,9 b' 2: Four - test' | |||||
118 | 1: Three (again) - test |
|
122 | 1: Three (again) - test | |
119 | 0: [mq]: 1.patch - test |
|
123 | 0: [mq]: 1.patch - test | |
120 | ==== qref -d |
|
124 | ==== qref -d | |
|
125 | # HG changeset patch | |||
|
126 | # Date 9 0 | |||
|
127 | ||||
121 | Four |
|
128 | Four | |
122 |
|
129 | |||
123 | diff -r ... 4 |
|
130 | diff -r ... 4 | |
@@ -177,6 +184,7 b' 2: [mq]: 5.patch - test' | |||||
177 | 1: Three (again) - test |
|
184 | 1: Three (again) - test | |
178 | 0: [mq]: 1.patch - test |
|
185 | 0: [mq]: 1.patch - test | |
179 | ==== qref -d |
|
186 | ==== qref -d | |
|
187 | Date: 12 0 | |||
180 | From: jane |
|
188 | From: jane | |
181 |
|
189 | |||
182 | diff -r ... 6 |
|
190 | diff -r ... 6 | |
@@ -232,6 +240,7 b' 1: Three (again) - test' | |||||
232 | 0: [mq]: 1.patch - test |
|
240 | 0: [mq]: 1.patch - test | |
233 | ==== qref -u -d |
|
241 | ==== qref -u -d | |
234 | # HG changeset patch |
|
242 | # HG changeset patch | |
|
243 | # Date 14 0 | |||
235 | # User john |
|
244 | # User john | |
236 |
|
245 | |||
237 |
|
246 | |||
@@ -263,6 +272,7 b' 1: Three (again) - test' | |||||
263 | 0: [mq]: 1.patch - test |
|
272 | 0: [mq]: 1.patch - test | |
264 | ==== qref -u -d |
|
273 | ==== qref -u -d | |
265 | # HG changeset patch |
|
274 | # HG changeset patch | |
|
275 | # Date 15 0 | |||
266 | # User john |
|
276 | # User john | |
267 |
|
277 | |||
268 | Nine |
|
278 | Nine |
General Comments 0
You need to be logged in to leave comments.
Login now