##// END OF EJS Templates
graphlog: paths arguments must be or'ed
Patrick Mezard -
r16159:ec33539b default
parent child Browse files
Show More
@@ -257,17 +257,19 b' def revset(pats, opts):'
257 'branch': ('branch(%(val)r)', ' or '),
257 'branch': ('branch(%(val)r)', ' or '),
258 'exclude': ('not file(%(val)r)', ' and '),
258 'exclude': ('not file(%(val)r)', ' and '),
259 'include': ('file(%(val)r)', ' and '),
259 'include': ('file(%(val)r)', ' and '),
260 '_pats': ('file(%(val)r)', ' or '),
260 'keyword': ('keyword(%(val)r)', ' or '),
261 'keyword': ('keyword(%(val)r)', ' or '),
261 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '),
262 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '),
262 'user': ('user(%(val)r)', ' or '),
263 'user': ('user(%(val)r)', ' or '),
263 'rev': ('%(val)s', ' or '),
264 'rev': ('%(val)s', ' or '),
264 }
265 }
265
266
267 opts = dict(opts)
266 # branch and only_branch are really aliases and must be handled at
268 # branch and only_branch are really aliases and must be handled at
267 # the same time
269 # the same time
268 if 'branch' in opts and 'only_branch' in opts:
270 if 'branch' in opts and 'only_branch' in opts:
269 opts = dict(opts)
270 opts['branch'] = opts['branch'] + opts.pop('only_branch')
271 opts['branch'] = opts['branch'] + opts.pop('only_branch')
272 opts['_pats'] = list(pats)
271
273
272 revset = []
274 revset = []
273 for op, val in opts.iteritems():
275 for op, val in opts.iteritems():
@@ -285,9 +287,6 b' def revset(pats, opts):'
285 expr = '(' + andor.join((revop % {'val': v}) for v in val) + ')'
287 expr = '(' + andor.join((revop % {'val': v}) for v in val) + ')'
286 revset.append(expr)
288 revset.append(expr)
287
289
288 for path in pats:
289 revset.append('file(%r)' % path)
290
291 if revset:
290 if revset:
292 revset = '(' + ' and '.join(revset) + ')'
291 revset = '(' + ' and '.join(revset) + ')'
293 else:
292 else:
@@ -1486,3 +1486,38 b' Test log -G options'
1486 $ hg log -G --follow a
1486 $ hg log -G --follow a
1487 abort: -G/--graph option is incompatible with --follow with file argument
1487 abort: -G/--graph option is incompatible with --follow with file argument
1488 [255]
1488 [255]
1489
1490
1491 Dedicated repo for --follow and paths filtering
1492
1493 $ cd ..
1494 $ hg init follow
1495 $ cd follow
1496 $ echo a > a
1497 $ hg ci -Am "add a"
1498 adding a
1499 $ hg cp a b
1500 $ hg ci -m "copy a b"
1501 $ mkdir dir
1502 $ hg mv b dir
1503 $ hg ci -m "mv b dir/b"
1504 $ hg mv a b
1505 $ echo a > d
1506 $ hg add d
1507 $ hg ci -m "mv a b; add d"
1508 $ hg mv dir/b e
1509 $ hg ci -m "mv dir/b e"
1510 $ hg glog --template '({rev}) {desc|firstline}\n'
1511 @ (4) mv dir/b e
1512 |
1513 o (3) mv a b; add d
1514 |
1515 o (2) mv b dir/b
1516 |
1517 o (1) copy a b
1518 |
1519 o (0) add a
1520
1521
1522 $ testlog a c
1523 ('group', ('group', ('or', ('func', ('symbol', 'file'), ('string', 'a')), ('func', ('symbol', 'file'), ('string', 'c')))))
General Comments 0
You need to be logged in to leave comments. Login now