Create clean "move changeset" in anonymous branch and graft
it into needed location?
Attach a moved file to its previous history afterwards
-
30-11-2021 - |
题
Due to a defect in the MercurialEclipse plugin, I have lost the history of a moved file.
It's been while now, and I have switched to a newer version of MercurialEclipse which fixes this bug.
I would like to connect this file to its previous location/versions.
How can I achieve that ? Either in Eclipse or with command line ?
解决方案
其他提示
If you just want to find out all the history of a specific files, both before/after rename/move/copy, a simple "hg log --follow filename" will do that.
luke@luke-linux:~/work/hg$ hg init test
luke@luke-linux:~/work/hg$ cd test
luke@luke-linux:~/work/hg/test$ echo a > a.txt
luke@luke-linux:~/work/hg/test$ hg add a.txt
adding a.txt
luke@luke-linux:~/work/hg/test$ hg ci -m a.txt
a.txt
committed changeset 0:552282c32ac4
luke@luke-linux:~/work/hg/test$ hg mv a.txt b.txt
moving a.txt to b.txt
luke@luke-linux:~/work/hg/test$ hg ci -m "a.txt-->b.txt"
b.txt
committed changeset 1:10dda3a3b48a
luke@luke-linux:~/work/hg/test$ hg mv b.txt c.txt
moving b.txt to c.txt
luke@luke-linux:~/work/hg/test$ hg ci -m "b.txt-->c.txt"
c.txt
committed changeset 2:f79245e6c0fe
luke@luke-linux:~/work/hg/test$ hg log --follow c.txt
changeset: 2:f79245e6c0fe
tag: tip
user: Luke Luo <luke.jf.luo@gmail.com>
date: Wed Nov 21 23:23:16 2012 +0800
files: b.txt c.txt
description:
b.txt-->c.txt
changeset: 1:10dda3a3b48a
user: Luke Luo <luke.jf.luo@gmail.com>
date: Wed Nov 21 23:22:56 2012 +0800
files: a.txt b.txt
description:
a.txt-->b.txt
changeset: 0:552282c32ac4
user: Luke Luo <luke.jf.luo@gmail.com>
date: Wed Nov 21 23:22:34 2012 +0800
files: a.txt
description:
a.txt
不隶属于 StackOverflow