hg log -f -r : foo.cpp gives an error
Matt Mackall
mpm at selenic.com
Mon Jul 20 17:13:22 UTC 2015
On Mon, 2015-07-20 at 09:58 -0400, Bob Eby wrote:
> PS - Oh, you're saying -f makes no sense in this case?
You're now up to 2/5th of my original email.
> Doesn't -f cause renames to be followed?
Yes. But it follows everything reachable from a _singular starting
point_. Let's imagine that I've got a repo like the following:
$ echo "obama" > senator-illinois.txt
$ hg commit
$ rm president.txt
$ hg commit
$ mv senator-illinois.txt president.txt
$ hg commit
If I now do:
$ hg log -f president.txt
..it's going to follow the current entity named president.txt back to
its introduction and not tell me about any other unrelated files that
were previously named president.txt. And if I do:
$ hg log -f -r "date(1861)" president.txt
..it's going to follow the history of a different president.txt. But if
I simply do:
$ hg log president.txt
..it's going to tell me about every entity ever named president.txt, but
not about other files. Two completely distinct semantics, one based on
names and one based on "rename identity".
Now one could interpret:
$ hg log -f -r : president.txt
..as "tell me about every change of office of EVERY president" but
that's not how --follow is designed to work.
But instead you're trying to do some sort of ordering of the --follow
output. That's ALSO not how --follow with --rev works. The --rev arg
says where to start following, not how to order the result.
In my first message, I suggested that you might want to try one of:
hg log -r "reverse(follow('foo.cpp'))"
hg log -r "follow('foo.cpp')"
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list