Mercurial - 文件历史记录在不同分支上不显示相同的更改
Mercurial - file history doesn't show the same change on different branches
我们遇到了一个生产问题,即在不同的分支上进行了重复更改(其中一个是偶然的),但我们没有发现它,因为 Hg 文件历史记录没有向我们显示第二个分支上的更改.
我们已经做了一些分析,这很容易复制(见下面的简单示例)。这是功能还是错误?
复制步骤:
hg init Test
cd Test
hg branch "branch 1"
echo "file1" > test.txt
hg add
hg commit -m "Added test.txt - branch 1"
hg branch "branch 2"
echo "file2" > test.txt
hg commit -m "Updated test.txt - branch 2"
hg update "branch 1"
hg branch "branch 3"
echo "file2" > test.txt
hg commit -m "Updated test.txt - branch 3"
如果我们运行
> hg log test.txt
然后我们在文件历史记录中只显示了 2 个更改 - 分支 3 上的更改丢失了。
changeset: 1:1754be7ba0aa
branch: branch 2
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Updated test.txt - branch 2
changeset: 0:b10c4fde7ba1
branch: branch 1
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Added test.txt - branch 1
但是存储库的历史记录显示了所有 3 次提交
> hg log
changeset: 2:f6f91ab357a6
branch: branch 3
tag: tip
parent: 0:b10c4fde7ba1
user: chrisgill
date: Tue Jun 06 14:30:14 2017 +0100
summary: Updated test.txt - branch 3
changeset: 1:1754be7ba0aa
branch: branch 2
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Updated test.txt - branch 2
changeset: 0:b10c4fde7ba1
branch: branch 1
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Added test.txt - branch 1
Note:
For performance reasons, 'hg log FILE'
may omit duplicate changes
made on branches and will not show removals or mode changes. To see
all such changes, use the --removed
switch.
我们遇到了一个生产问题,即在不同的分支上进行了重复更改(其中一个是偶然的),但我们没有发现它,因为 Hg 文件历史记录没有向我们显示第二个分支上的更改.
我们已经做了一些分析,这很容易复制(见下面的简单示例)。这是功能还是错误?
复制步骤:
hg init Test
cd Test
hg branch "branch 1"
echo "file1" > test.txt
hg add
hg commit -m "Added test.txt - branch 1"
hg branch "branch 2"
echo "file2" > test.txt
hg commit -m "Updated test.txt - branch 2"
hg update "branch 1"
hg branch "branch 3"
echo "file2" > test.txt
hg commit -m "Updated test.txt - branch 3"
如果我们运行
> hg log test.txt
然后我们在文件历史记录中只显示了 2 个更改 - 分支 3 上的更改丢失了。
changeset: 1:1754be7ba0aa
branch: branch 2
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Updated test.txt - branch 2
changeset: 0:b10c4fde7ba1
branch: branch 1
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Added test.txt - branch 1
但是存储库的历史记录显示了所有 3 次提交
> hg log
changeset: 2:f6f91ab357a6
branch: branch 3
tag: tip
parent: 0:b10c4fde7ba1
user: chrisgill
date: Tue Jun 06 14:30:14 2017 +0100
summary: Updated test.txt - branch 3
changeset: 1:1754be7ba0aa
branch: branch 2
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Updated test.txt - branch 2
changeset: 0:b10c4fde7ba1
branch: branch 1
user: chrisgill
date: Tue Jun 06 14:30:13 2017 +0100
summary: Added test.txt - branch 1
Note:
For performance reasons,
'hg log FILE'
may omit duplicate changes made on branches and will not show removals or mode changes. To see all such changes, use the--removed
switch.