做这件事有很多种方法。
在提交之前,您可以使用hg diff --git
显示重命名的内容:
$ hg diff --git
diff --git a/theTest.txt b/aTest.txt
rename from theTest.txt
rename to aTest.txt
请注意,这仅在您使用过时才有效hg mv
, hg rename
, or mv
and hg addremove --similarity 100
.
提交后,您仍然可以使用hg diff
,但您必须使用指定更改-r
:
$ hg diff -r 0 -r 1 --git
diff --git a/test.txt b/theTest.txt
rename from test.txt
rename to theTest.txt
对彼此而言hg status
and hg log
,使用 -C 命令行标志查看复制文件的源。
$ hg status -C
A aTest.txt
theTest.txt
R theTest.txt
aTest.txt 下面的行表示复制的源 (theTest.txt)。
$ hg log -v -C
changeset: 1:4d7b42489d9f
tag: tip
user: jhurne
date: Tue Apr 20 20:57:07 2010 -0400
files: test.txt theTest.txt
copies: theTest.txt (test.txt)
description:
Renamed test.txt
您可以看到受影响的文件(test.txt 和 theTest.txt),并且“theTest.txt”是从 test.txt 复制的。