Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391336

Add/remove copied files with Mercurial, TortoiseHg does it, but what's the command line variant?

The Mercurial command addremove detects files that have been renamed according to a similarity ration.

TortoiseHg is also able to detect copies, ie. files that were copied on disk but not explicitly communicated to Mercurial as copies.

It doesn't appear that the addremove command have any options to detect copies, only renames. Does anyone know what the equivalent command line command and/or options would be to do this?

For instance, if I do this:

hg init .
echo 111>test1.txt
hg commit -m "initial" --addremove
copy test1.txt test2.txt
??? what do I write here to get the equivalent of: hg cp test1.txt test2.txt

Upvotes: 1

Views: 528

Answers (1)

anton.burger
anton.burger

Reputation: 5706

I don't know of any way to do it using the CLI. Only supporting moves means you can whittle down the set of files to be compared to those that are either missing or added.

I'm not sure how Tortoise does it, but I'd guess it's pretty expensive.

Upvotes: 1

Related Questions