I need help in understanding hg log --follow.
$ hg log --help
...
-f --follow follow changeset history, or file history across
copies and renames
When I specify -f, the log output includes all the commits. I expected it to return commits related to the file changed in the given revision. Is this the intended behaviour of the -f flag. If so, what is its use case?
/tmp:$ hg --version
Mercurial Distributed SCM (version 4.5.3)
/tmp:$ mkdir hg-f
/tmp:$ cd hg-f
/tmp/hg-f:$ hg init
/tmp/hg-f:$ touch file0
/tmp/hg-f:$ hg add file0
/tmp/hg-f:$ hg commit -m 'file0 added'
/tmp/hg-f:$ touch foobar
/tmp/hg-f:$ hg add foobar
/tmp/hg-f:$ hg commit -m 'added foobar'
/tmp/hg-f:$ hg mv foobar barfoo
/tmp/hg-f:$ hg commit -m 'moved foobar'
/tmp/hg-f:$ hg log -v -r 2
changeset: 2:492bd607810c
tag: tip
user: 'notalex'
date: Tue Apr 16 09:10:25 2019 +0530
files: barfoo foobar
description:
moved foobar
/tmp/hg-f:$ hg log -v -f -r 2
changeset: 2:492bd607810c
tag: tip
user: 'notalex'
date: Tue Apr 16 09:10:25 2019 +0530
files: barfoo foobar
description:
moved foobar
changeset: 1:adfd98042078
user: 'notalex'
date: Tue Apr 16 09:10:14 2019 +0530
files: foobar
description:
added foobar
changeset: 0:64e5211bd019
user: 'notalex'
date: Tue Apr 16 09:09:53 2019 +0530
files: file0
description:
file0 added