# HG changeset patch # User Patrick Mezard # Date 1334395631 -7200 # Node ID 8b62a77d0895bd9bc3cd64c1fc9c302dc19b4cd7 # Parent e38b29937118e619f894c293ea273acd8a624818 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. diff -r e38b29937118 -r 8b62a77d0895 hgext/graphlog.py --- a/hgext/graphlog.py Sat Apr 14 11:16:57 2012 +0200 +++ b/hgext/graphlog.py Sat Apr 14 11:27:11 2012 +0200 @@ -353,7 +353,9 @@ 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: diff -r e38b29937118 -r 8b62a77d0895 tests/test-glog.t --- a/tests/test-glog.t Sat Apr 14 11:16:57 2012 +0200 +++ b/tests/test-glog.t Sat Apr 14 11:27:11 2012 +0200 @@ -2026,6 +2026,20 @@ ('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