English 中文(简体)
显示身份重新命名?
原标题:Showing renames in hg status?

我知道,Mercurial可以跟踪档案的更名次,但我是如何去show,而不是在我做什么时添加/移除。” 例如,不是:

A bin/extract-csv-column.pl
A bin/find-mirna-binding.pl
A bin/xls2csv-separate-sheets.pl
A lib/Text/CSV/Euclid.pm
R src/extract-csv-column.pl
R src/find-mirna-binding.pl
R src/modules/Text/CSV/Euclid.pm
R src/xls2csv-separate-sheets.pl

我要指出,有4个档案已经移走。

我认为,我在某些地方读到,产出就好像这样,以保持与某个其他东西方的后向兼容性,但我不担心。

最佳回答

这样做有几个途径。

在您承诺之前,您可使用<代码>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 更名为mvhg 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和hglog,均使用-C的指挥线旗,看看来文方档案被复制。

$ hg status -C
A aTest.txt
  theTest.txt
R theTest.txt

紧低于《试验》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

你们可以看到受到影响的档案(测试、txt和测试)以及“试验.txt”的复制件。

问题回答

你们可以发现有多少档案被重新命名为“秘密摘要”。 如果你想看到重新命名的实际档案,我发现的最快方式是:

hg st -a -C

这将产生这样的结果:

A <path	o
enamedfile>
  <pathcopiedfrom>
A <path	oaddedfile>
A <path	o
enamedfile>
  <pathcopiedfrom>

由于身份认定改名是复制件和去除,你更名为档案的复印件将列入档案。 添加但未重新命名的卷宗将不从档案中开列复印件。





相关问题
bzr init-repo and multiple projects

I m having difficulties understanding bzr init-repo. I have 3 projects that I want to have in their own isolated repository, in subversion I would use svnadmin create three times to create them. Like ...

How suitable is a DVCS for the corporate environment?

I ve been using SVN for some time now, and am pretty happy with how it works (but I can t say I m an expert, and I haven t really done much with branches and merging). However an opportunity has ...

Renaming directories with the Fossil DVCS

Is it possible to rename directories with Fossil? I ve tried the obvious command: fossil mv oldname newname Fossil then informs me that it has done something: RENAME oldname newname However, ...

Distributed source control for VisualWorks Smalltalk

One of the annoying things about Smalltalk is that it (usually) requires its own VCS, due to the way that it manages its source code. Squeak and Gemstone (at least in its GLASS version) have a DVCS ...

Can I clone part of a Mercurial repository?

Is it possible to clone part of a Mercurial repository? Let s say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository? E.g. in ...

How does git track source code moved between files?

Apparently, when you move a function from one source code file to another, the git revision log (for the new file) can show you where that code fragment was originally coming from (see for example the ...

热门标签