graphlog: fix --follow FILE and relative paths

The situation is complicated because filelog() revset uses a match object in
relpath mode while follow() revset interprets the filename as a manifest entry.
This commit is contained in:
Patrick Mezard 2012-04-14 11:27:11 +02:00
parent 97d474a24b
commit aa91736f8f
2 changed files with 17 additions and 1 deletions

View File

@ -353,7 +353,9 @@ def _makelogrevset(repo, pats, opts, revs):
fnopats = (('_ancestors', '_fancestors'),
('_descendants', '_fdescendants'))
if pats:
opts[fpats[followfirst]] = list(pats)
# follow() revset inteprets its file argument as a
# manifest entry, so use match.files(), not pats.
opts[fpats[followfirst]] = list(match.files())
else:
opts[fnopats[followdescendants][followfirst]] = str(startrev)
else:

View File

@ -2026,6 +2026,20 @@ Test subdir
('string', 'r:')
('string', 'd:relpath'))
('string', 'p:.'))))
$ testlog ../b
[]
(group
(group
(func
('symbol', 'filelog')
('string', '../b'))))
$ testlog -f ../b
[]
(group
(group
(func
('symbol', 'follow')
('string', 'b'))))
$ cd ..
Test --hidden