Show More
@@ -249,18 +249,18 b' def revset(pats, opts):' | |||
|
249 | 249 | """Return revset str built of revisions, log options and file patterns. |
|
250 | 250 | """ |
|
251 | 251 | opt2revset = { |
|
252 |
'follow': ( |
|
|
253 |
'no_merges': ( |
|
|
254 |
'only_merges': ( |
|
|
255 |
'removed': ( |
|
|
256 |
'date': ( |
|
|
257 |
'branch': ( |
|
|
258 |
'exclude': ( |
|
|
259 |
'include': ( |
|
|
260 |
'keyword': ( |
|
|
261 |
'only_branch': ( |
|
|
262 |
'prune': ( |
|
|
263 |
'user': ( |
|
|
252 | 'follow': ('follow()', None), | |
|
253 | 'no_merges': ('not merge()', None), | |
|
254 | 'only_merges': ('merge()', None), | |
|
255 | 'removed': ('removes("*")', None), | |
|
256 | 'date': ('date($)', None), | |
|
257 | 'branch': ('branch($)', ' and '), | |
|
258 | 'exclude': ('not file($)', ' and '), | |
|
259 | 'include': ('file($)', ' and '), | |
|
260 | 'keyword': ('keyword($)', ' and '), | |
|
261 | 'only_branch': ('branch($)', ' and '), | |
|
262 | 'prune': ('not ($ or ancestors($))', ' and '), | |
|
263 | 'user': ('user($)', ' and '), | |
|
264 | 264 | } |
|
265 | 265 | optrevset = [] |
|
266 | 266 | revset = [] |
@@ -272,15 +272,16 b' def revset(pats, opts):' | |||
|
272 | 272 | revset.extend(val) |
|
273 | 273 | if op not in opt2revset: |
|
274 | 274 | continue |
|
275 |
|
|
|
276 | revop = revop.replace('$', '%(val)r') | |
|
277 | if arity == 0: | |
|
275 | revop, andor = opt2revset[op] | |
|
276 | if '$' not in revop: | |
|
278 | 277 | optrevset.append(revop) |
|
279 | elif arity == 1: | |
|
280 | optrevset.append(revop % {'val': val}) | |
|
281 | 278 | else: |
|
282 | for f in val: | |
|
283 | optrevset.append(revop % {'val': f}) | |
|
279 | revop = revop.replace('$', '%(val)r') | |
|
280 | if not isinstance(val, list): | |
|
281 | expr = revop % {'val': val} | |
|
282 | else: | |
|
283 | expr = '(' + andor.join((revop % {'val': v}) for v in val) + ')' | |
|
284 | optrevset.append(expr) | |
|
284 | 285 | |
|
285 | 286 | for path in pats: |
|
286 | 287 | optrevset.append('file(%r)' % path) |
@@ -1419,7 +1419,7 b' Test log -G options' | |||
|
1419 | 1419 | abort: unknown revision 'something nice'! |
|
1420 | 1420 | [255] |
|
1421 | 1421 | $ hg log -G --print-revset -k 'something' -k 'nice' |
|
1422 | ('group', ('and', ('func', ('symbol', 'keyword'), ('string', 'something')), ('func', ('symbol', 'keyword'), ('string', 'nice')))) | |
|
1422 | ('group', ('group', ('and', ('func', ('symbol', 'keyword'), ('string', 'something')), ('func', ('symbol', 'keyword'), ('string', 'nice'))))) | |
|
1423 | 1423 | $ hg log -G --only-branch 'something nice' |
|
1424 | 1424 | abort: unknown revision 'something nice'! |
|
1425 | 1425 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now