Mercurial > hg
annotate tests/test-import-merge.t @ 23702:c48924787eaa
filectx.parents: enforce changeid of parent to be in own changectx ancestors
Because of the way filenodes are computed, you can have multiple changesets
"introducing" the same file revision. For example, in the changeset graph
below, changeset 2 and 3 both change a file -to- and -from- the same content.
o 3: content = new
|
| o 2: content = new
|/
o 1: content = old
In such cases, the file revision is create once, when 2 is added, and just reused
for 3. So the file change in '3' (from "old" to "new)" has no linkrev pointing
to it). We'll call this situation "linkrev-shadowing". As the linkrev is used for
optimization purposes when walking a file history, the linkrev-shadowing
results in an unexpected jump to another branch during such a walk.. This leads to
multiple bugs with log, annotate and rename detection.
One element to fix such bugs is to ensure that walking the file history sticks on
the same topology as the changeset's history. For this purpose, we extend the
logic in 'basefilectx.parents' so that it always defines the proper changeset
to associate the parent file revision with. This "proper" changeset has to be an
ancestor of the changeset associated with the child file revision.
This logic is performed in the '_adjustlinkrev' function. This function is
given the starting changeset and all the information regarding the parent file
revision. If the linkrev for the file revision is an ancestor of the starting
changeset, the linkrev is valid and will be used. If it is not, we detected a
topological jump caused by linkrev shadowing, we are going to walk the
ancestors of the starting changeset until we find one setting the file to the
revision we are trying to create.
The performance impact appears acceptable:
- We are walking the changelog once for each filelog traversal (as there should
be no overlap between searches),
- changelog traversal itself is fairly cheap, compared to what is likely going
to be perform on the result on the filelog traversal,
- We only touch the manifest for ancestors touching the file, And such
changesets are likely to be the one introducing the file. (except in
pathological cases involving merge),
- We use manifest diff instead of full manifest unpacking to check manifest
content, so it does not involve applying multiple diffs in most case.
- linkrev shadowing is not the common case.
Tests for fixed issues in log, annotate and rename detection have been
added.
But this changeset does not solve all problems. It fixes -ancestry-
computation, but if the linkrev-shadowed changesets is the starting one, we'll
still get things wrong. We'll have to fix the bootstrapping of such operations
in a later changeset. Also, the usage of `hg log FILE` without --follow still
has issues with linkrev pointing to hidden changesets, because it relies on the
`filelog` revset which implement its own traversal logic that is still to be
fixed.
Thanks goes to:
- Matt Mackall: for nudging me in the right direction
- Julien Cristau and RĂ©mi Cardona: for keep telling me linkrev bug were an
evolution show stopper for 3 years.
- Durham Goode: for finding a new linkrev issue every few weeks
- Mads Kiilerich: for that last rename bug who raise this topic over my
anoyance limit.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 23 Dec 2014 15:30:38 -0800 |
parents | bdc0e04df243 |
children | eb586ed5d8ce |
rev | line source |
---|---|
15511
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 $ echo "[extensions]" >> $HGRCPATH |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 $ echo "mq=" >> $HGRCPATH |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 $ tipparents() { |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 > } |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 Test import and merge diffs |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 $ hg init repo |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 $ cd repo |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 $ echo a > a |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 $ hg ci -Am adda |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 adding a |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 $ echo a >> a |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 $ hg ci -m changea |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 $ echo c > c |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 $ hg ci -Am addc |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 adding c |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 $ hg up 0 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 $ echo b > b |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 $ hg ci -Am addb |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 adding b |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 created new head |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 $ hg up 1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 $ hg merge 3 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 (branch merge, don't forget to commit) |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 $ hg ci -m merge |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 $ hg export . > ../merge.diff |
22250
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff |
15511
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 $ cd .. |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 $ hg clone -r2 repo repo2 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 adding changesets |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 adding manifests |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 adding file changes |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 added 3 changesets with 3 changes to 2 files |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 updating to branch default |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 $ cd repo2 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 $ hg pull -r3 ../repo |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
44 pulling from ../repo |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 searching for changes |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 adding changesets |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 adding manifests |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 adding file changes |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 added 1 changesets with 1 changes to 1 files (+1 heads) |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 (run 'hg heads' to see heads, 'hg merge' to merge) |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 Test without --exact and diff.p1 == workingdir.p1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 $ hg up 1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
22250
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
56 $ cat > $TESTTMP/editor.sh <<EOF |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
57 > env | grep HGEDITFORM |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
58 > echo merge > \$1 |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
59 > EOF |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
60 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
61 applying ../merge.nomsg.diff |
f3200bf460a8
import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
62 HGEDITFORM=import.normal.merge |
15511
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
64 1:540395c44225 changea |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
65 3:102a90ea7b4a addb |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
66 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
68 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
69 Test without --exact and diff.p1 != workingdir.p1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
70 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
71 $ hg up 2 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
73 $ hg import ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
74 applying ../merge.diff |
22303
0c838e7459a5
import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
75 warning: import the patch as a normal revision |
0c838e7459a5
import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
76 (use --exact to import the patch as a merge) |
15511
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
77 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
78 2:890ecaa90481 addc |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
79 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
80 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
81 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
82 Test with --exact |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
83 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
84 $ hg import --exact ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
85 applying ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
87 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
88 1:540395c44225 changea |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
89 3:102a90ea7b4a addb |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
90 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
91 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
92 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
93 Test with --bypass and diff.p1 == workingdir.p1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
94 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
95 $ hg up 1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
97 $ hg import --bypass ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
98 applying ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
99 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
100 1:540395c44225 changea |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
101 3:102a90ea7b4a addb |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
102 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
103 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
104 Test with --bypass and diff.p1 != workingdir.p1 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
105 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
106 $ hg up 2 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
108 $ hg import --bypass ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
109 applying ../merge.diff |
22303
0c838e7459a5
import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
110 warning: import the patch as a normal revision |
0c838e7459a5
import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20303
diff
changeset
|
111 (use --exact to import the patch as a merge) |
15511
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
112 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
113 2:890ecaa90481 addc |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
114 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
115 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
116 Test with --bypass and --exact |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
117 |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
118 $ hg import --bypass --exact ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
119 applying ../merge.diff |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
120 $ tipparents |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
121 1:540395c44225 changea |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
122 3:102a90ea7b4a addb |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
123 $ hg strip --no-backup tip |
6cae68a361ed
import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
124 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
15511
diff
changeset
|
125 $ cd .. |
18656
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
126 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
127 Test that --exact on a bad header doesn't corrupt the repo (issue3616) |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
128 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
129 $ hg init repo3 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
130 $ cd repo3 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
131 $ echo a>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
132 $ hg ci -Aqm0 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
133 $ echo a>>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
134 $ hg ci -m1 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
135 $ echo a>>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
136 $ hg ci -m2 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
137 $ echo a>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
138 $ echo b>>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
139 $ echo a>>a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
140 $ hg ci -m3 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
141 $ hg export 2 | head -7 > ../a.patch |
19628
3193b23eec61
solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents:
18656
diff
changeset
|
142 $ hg export tip > out |
20303
3a3731a60354
test-import-merge: mangle file in binary mode
Matt Mackall <mpm@selenic.com>
parents:
19628
diff
changeset
|
143 >>> apatch = open("../a.patch", "ab") |
19628
3193b23eec61
solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents:
18656
diff
changeset
|
144 >>> apatch.write("".join(open("out").readlines()[7:])) |
18656
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
145 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
146 $ cd .. |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
147 $ hg clone -qr0 repo3 repo3-clone |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
148 $ cd repo3-clone |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
149 $ hg pull -qr1 ../repo3 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
150 |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
151 $ hg import --exact ../a.patch |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
152 applying ../a.patch |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
154 patching file a |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
155 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines). |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
156 transaction abort! |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
157 rollback completed |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
158 abort: patch is damaged or loses information |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
159 [255] |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
160 $ hg verify |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
161 checking changesets |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
162 checking manifests |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
163 crosschecking files in changesets and manifests |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
164 checking files |
8eb3408bf005
import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents:
16913
diff
changeset
|
165 1 files, 2 changesets, 2 total revisions |