John
John

Reputation: 5635

How to get complete history of a file, including deletes, renames and the source of copy/rename?

The --removed and --follow switches seem to be incompatible so I can get either deletions or copy / renames.

I also want to find the source of the rename or copy.

Upvotes: 1

Views: 762

Answers (2)

iuzuz
iuzuz

Reputation: 97

You can use a custom template to display and also to format the file-copy messages properly:

hg log --template "{rev}\n{file_copies % '  {file_copy}\n'}\n" --follow <file_name>    

More about custom templates:

hg help -v templates

Upvotes: 0

Mark Tolonen
Mark Tolonen

Reputation: 177600

That --removed doesn't work with --follow seems like a bug. You get file copies using:

hg --verbose -C -f <file>

or use a custom template using {file_copies}:

hg log --template "changeset: {node|short}\nuser: {author}\ndate: {date|rfc822date}\nfile+: {file_adds}\nfilem: {file_mods}\nfile-: {file_dels}\nfilec: {file_copies}\nsummary: {desc|firstline}\n\n" -f file2

Upvotes: 4

Related Questions