I want to merge history of two files in different branch.Two files’s content is different.
Example
Branch1 a.txt
History(rev)
1 make file
7 Modify file
15 add functions
Branch 2 b.txt
32 make file
45 Modify file
60 add functions
Expectation
a.txt
1 make file
7 Modify file
15 add functions
32 make file
45 Modify file
60 add functions
File name can be a.txt or b.txt
Branch1
is ancestor of Branch2
(test it), you can try some tricks with dump of repo (dump-edit-import into new repo, test result, replace unmodified repo with extended):Hard way
In order to have common history, you have to have new or edited existing changeset between r15 and r32, in which rename a.txt ->b.txt will be recorded... But, if you add revision in the middle of existing history, you must also change numbers of all subsequent revisions (AFAICR) also
Less tricky way