Mercurial > hg
annotate tests/test-issue522 @ 6297:fed1a9c22076
dirstate.remove: during merges, remember the previous file state
We encode the previous state as a negative file size (AFAICS, previous
versions of hg always have size == 0 when state == 'r').
We save the state of 'm'erged and dirty files, because they're the
two states that indicate that a file has to be committed on a merge
to correctly record per-file history.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 18 Mar 2008 04:07:39 -0300 |
parents | 90d9ec0dc69d |
children | 6c82beaaa11a |
rev | line source |
---|---|
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 #!/bin/sh |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
3 # In the merge below, the file "foo" has the same contents in both |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
4 # parents, but if we look at the file-level history, we'll notice that |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
5 # the version in p1 is an ancestor of the version in p2. This test |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
6 # makes sure that we'll use the version from p2 in the manifest of the |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
7 # merge revision. |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
8 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
9 hg init repo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
10 cd repo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
11 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 echo foo > foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 hg ci -d '0 0' -qAm 'add foo' |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
14 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
15 echo bar >> foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 hg ci -d '0 0' -m 'change foo' |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
17 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
18 hg backout -d '0 0' -r tip -m 'backout changed foo' |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 hg up -C 0 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
21 touch bar |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
22 hg ci -d '0 0' -qAm 'add bar' |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
23 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
24 hg merge --debug |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
25 hg debugstate | grep foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
26 hg st -A foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 hg ci -d '0 0' -m 'merge' |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
28 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
29 hg manifest --debug | grep foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 hg debugindex .hg/store/data/foo.i |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
31 |