# HG changeset patch # User Matt Mackall # Date 1418153539 21600 # Node ID 32e68271a0373de803bd3c105460cf6c462f89dd # Parent 2164226a5637bf7037be13c5913902a9e33fdcf1# Parent 424d669118d323ca1aeb309f2a8a4631f69d1fe3 merge with stable diff -r 2164226a5637 -r 32e68271a037 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Dec 09 12:39:23 2014 -0600 +++ b/mercurial/cmdutil.py Tue Dec 09 13:32:19 2014 -0600 @@ -1745,6 +1745,9 @@ else: slowpath = False + fpats = ('_patsfollow', '_patsfollowfirst') + fnopats = (('_ancestors', '_fancestors'), + ('_descendants', '_fdescendants')) if slowpath: # See walkchangerevs() slow path. # @@ -1763,11 +1766,10 @@ matchargs.append('x:' + p) matchargs = ','.join(('%r' % p) for p in matchargs) opts['_matchfiles'] = matchargs + if follow: + opts[fnopats[0][followfirst]] = '.' else: if follow: - fpats = ('_patsfollow', '_patsfollowfirst') - fnopats = (('_ancestors', '_fancestors'), - ('_descendants', '_fdescendants')) if pats: # follow() revset interprets its file argument as a # manifest entry, so use match.files(), not pats. @@ -1793,7 +1795,7 @@ filematcher = lambda rev: match expr = [] - for op, val in opts.iteritems(): + for op, val in sorted(opts.iteritems()): if not val: continue if op not in opt2revset: diff -r 2164226a5637 -r 32e68271a037 tests/test-glog.t --- a/tests/test-glog.t Tue Dec 09 12:39:23 2014 -0600 +++ b/tests/test-glog.t Tue Dec 09 13:32:19 2014 -0600 @@ -1658,13 +1658,17 @@ $ testlog -f dir [] (group - (func - ('symbol', '_matchfiles') - (list + (and + (func + ('symbol', 'ancestors') + ('symbol', '.')) + (func + ('symbol', '_matchfiles') (list - ('string', 'r:') - ('string', 'd:relpath')) - ('string', 'p:dir')))) + (list + ('string', 'r:') + ('string', 'd:relpath')) + ('string', 'p:dir'))))) $ hg up -q tip Test --follow on file not in parent revision @@ -1679,13 +1683,17 @@ $ testlog -f 'glob:*' [] (group - (func - ('symbol', '_matchfiles') - (list + (and + (func + ('symbol', 'ancestors') + ('symbol', '.')) + (func + ('symbol', '_matchfiles') (list - ('string', 'r:') - ('string', 'd:relpath')) - ('string', 'p:glob:*')))) + (list + ('string', 'r:') + ('string', 'd:relpath')) + ('string', 'p:glob:*'))))) Test --follow on a single rename @@ -1852,13 +1860,17 @@ $ testlog --removed --follow a [] (group - (func - ('symbol', '_matchfiles') - (list + (and + (func + ('symbol', 'ancestors') + ('symbol', '.')) + (func + ('symbol', '_matchfiles') (list - ('string', 'r:') - ('string', 'd:relpath')) - ('string', 'p:a')))) + (list + ('string', 'r:') + ('string', 'd:relpath')) + ('string', 'p:a'))))) Test --patch and --stat with --follow and --follow-first diff -r 2164226a5637 -r 32e68271a037 tests/test-log.t --- a/tests/test-log.t Tue Dec 09 12:39:23 2014 -0600 +++ b/tests/test-log.t Tue Dec 09 13:32:19 2014 -0600 @@ -1543,3 +1543,24 @@ $ cd .. + +hg log -f dir across branches + + $ hg init acrossbranches + $ cd acrossbranches + $ mkdir d + $ echo a > d/a && hg ci -Aqm a + $ echo b > d/a && hg ci -Aqm b + $ hg up -q 0 + $ echo b > d/a && hg ci -Aqm c + $ hg log -f d -T '{desc}' -G + @ c + | + o a + + $ hg log -f d/a -T '{desc}' -G + o b + | + o a + + $ cd ..