Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Version control Mercurial-文件历史记录不';t在不同的分支上显示相同的变化_Version Control_Mercurial - Fatal编程技术网

Version control Mercurial-文件历史记录不';t在不同的分支上显示相同的变化

Version control Mercurial-文件历史记录不';t在不同的分支上显示相同的变化,version-control,mercurial,Version Control,Mercurial,我们遇到了一个生产问题,在不同的分支上进行了重复更改(其中一个是偶然发生的),我们没有发现它,因为Hg文件历史记录没有显示第二个分支上的更改 我们已经做了一些分析,这很容易复制(参见下面的简单示例)。这是一个特性还是一个bug 复制的步骤: 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 "b

我们遇到了一个生产问题,在不同的分支上进行了重复更改(其中一个是偶然发生的),我们没有发现它,因为Hg文件历史记录没有显示第二个分支上的更改

我们已经做了一些分析,这很容易复制(参见下面的简单示例)。这是一个特性还是一个bug

复制的步骤:

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
即:

注: 出于性能原因,
'hg log FILE'
可能会忽略重复的更改 在分支上创建,不会显示删除或模式更改。看 所有此类更改,请使用
--removed
开关


有点奇怪,文件更改没有显示在文件历史记录中,您必须使用“-removed”标志才能看到它,不是吗?此外,如果继续执行
hg分支“branch 4”
(在分支3的顶部),然后在分支4中执行
echo“file4”>>test.txt
+
hg commit-m”,那么命令行仍然会错过“branch 3”提交,但龟甲将错过“branch 2”改为承诺?