Show More
@@ -257,17 +257,19 b' def revset(pats, opts):' | |||
|
257 | 257 | 'branch': ('branch(%(val)r)', ' or '), |
|
258 | 258 | 'exclude': ('not file(%(val)r)', ' and '), |
|
259 | 259 | 'include': ('file(%(val)r)', ' and '), |
|
260 | '_pats': ('file(%(val)r)', ' or '), | |
|
260 | 261 | 'keyword': ('keyword(%(val)r)', ' or '), |
|
261 | 262 | 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '), |
|
262 | 263 | 'user': ('user(%(val)r)', ' or '), |
|
263 | 264 | 'rev': ('%(val)s', ' or '), |
|
264 | 265 | } |
|
265 | 266 | |
|
267 | opts = dict(opts) | |
|
266 | 268 | # branch and only_branch are really aliases and must be handled at |
|
267 | 269 | # the same time |
|
268 | 270 | if 'branch' in opts and 'only_branch' in opts: |
|
269 | opts = dict(opts) | |
|
270 | 271 | opts['branch'] = opts['branch'] + opts.pop('only_branch') |
|
272 | opts['_pats'] = list(pats) | |
|
271 | 273 | |
|
272 | 274 | revset = [] |
|
273 | 275 | for op, val in opts.iteritems(): |
@@ -285,9 +287,6 b' def revset(pats, opts):' | |||
|
285 | 287 | expr = '(' + andor.join((revop % {'val': v}) for v in val) + ')' |
|
286 | 288 | revset.append(expr) |
|
287 | 289 | |
|
288 | for path in pats: | |
|
289 | revset.append('file(%r)' % path) | |
|
290 | ||
|
291 | 290 | if revset: |
|
292 | 291 | revset = '(' + ' and '.join(revset) + ')' |
|
293 | 292 | else: |
@@ -1486,3 +1486,38 b' Test log -G options' | |||
|
1486 | 1486 | $ hg log -G --follow a |
|
1487 | 1487 | abort: -G/--graph option is incompatible with --follow with file argument |
|
1488 | 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