mheinzerling
mheinzerling

Reputation: 1065

Add to rename tracking in mercurial after commit

Simple scenario:

I have renamed a file. The changes are committed and pushed. I didn't have used hg rename.

How can I tell mercurial that an add/remove in a commit was a rename? Is there something like the svn .mergeinfo that I can edit manually?

(It is not the last commit, so solution with amending to a commit are nice, but won't help me.)

Upvotes: 2

Views: 210

Answers (1)

Tim Delaney
Tim Delaney

Reputation: 5605

You could try the following:

  1. hg update to the commit before the file was renamed.

  2. Do an hg rename to the new filename, and ensure the contents of the file are the same as on the main branch.

  3. hg commit.

  4. hg update to the main branch.

  5. hg merge --tool internal:other the new branch into the main branch.

From the merged commit onwards Mercurial should know about the rename.

Upvotes: 2

Related Questions