##// END OF EJS Templates
tests: show that merging with sparse is broken when rename is involved...
Pulkit Goyal -
r39562:c6eb2118 default
parent child Browse files
Show More
@@ -1,121 +1,185 b''
1 test merging things outside of the sparse checkout
1 test merging things outside of the sparse checkout
2
2
3 $ hg init myrepo
3 $ hg init myrepo
4 $ cd myrepo
4 $ cd myrepo
5 $ cat > .hg/hgrc <<EOF
5 $ cat > .hg/hgrc <<EOF
6 > [extensions]
6 > [extensions]
7 > sparse=
7 > sparse=
8 > EOF
8 > EOF
9
9
10 $ echo foo > foo
10 $ echo foo > foo
11 $ echo bar > bar
11 $ echo bar > bar
12 $ hg add foo bar
12 $ hg add foo bar
13 $ hg commit -m initial
13 $ hg commit -m initial
14
14
15 $ hg branch feature
15 $ hg branch feature
16 marked working directory as branch feature
16 marked working directory as branch feature
17 (branches are permanent and global, did you want a bookmark?)
17 (branches are permanent and global, did you want a bookmark?)
18 $ echo bar2 >> bar
18 $ echo bar2 >> bar
19 $ hg commit -m 'feature - bar2'
19 $ hg commit -m 'feature - bar2'
20
20
21 $ hg update -q default
21 $ hg update -q default
22 $ hg debugsparse --exclude 'bar**'
22 $ hg debugsparse --exclude 'bar**'
23
23
24 $ hg merge feature
24 $ hg merge feature
25 temporarily included 1 file(s) in the sparse checkout for merging
25 temporarily included 1 file(s) in the sparse checkout for merging
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 (branch merge, don't forget to commit)
27 (branch merge, don't forget to commit)
28
28
29 Verify bar was merged temporarily
29 Verify bar was merged temporarily
30
30
31 $ ls
31 $ ls
32 bar
32 bar
33 foo
33 foo
34 $ hg status
34 $ hg status
35 M bar
35 M bar
36
36
37 Verify bar disappears automatically when the working copy becomes clean
37 Verify bar disappears automatically when the working copy becomes clean
38
38
39 $ hg commit -m "merged"
39 $ hg commit -m "merged"
40 cleaned up 1 temporarily added file(s) from the sparse checkout
40 cleaned up 1 temporarily added file(s) from the sparse checkout
41 $ hg status
41 $ hg status
42 $ ls
42 $ ls
43 foo
43 foo
44
44
45 $ hg cat -r . bar
45 $ hg cat -r . bar
46 bar
46 bar
47 bar2
47 bar2
48
48
49 Test merging things outside of the sparse checkout that are not in the working
49 Test merging things outside of the sparse checkout that are not in the working
50 copy
50 copy
51
51
52 $ hg strip -q -r . --config extensions.strip=
52 $ hg strip -q -r . --config extensions.strip=
53 $ hg up -q feature
53 $ hg up -q feature
54 $ touch branchonly
54 $ touch branchonly
55 $ hg ci -Aqm 'add branchonly'
55 $ hg ci -Aqm 'add branchonly'
56
56
57 $ hg up -q default
57 $ hg up -q default
58 $ hg debugsparse -X branchonly
58 $ hg debugsparse -X branchonly
59 $ hg merge feature
59 $ hg merge feature
60 temporarily included 2 file(s) in the sparse checkout for merging
60 temporarily included 2 file(s) in the sparse checkout for merging
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 (branch merge, don't forget to commit)
62 (branch merge, don't forget to commit)
63
63
64 $ cd ..
64 $ cd ..
65
65
66 Tests merging a file which is modified in one branch and deleted in another and
66 Tests merging a file which is modified in one branch and deleted in another and
67 file is excluded from sparse checkout
67 file is excluded from sparse checkout
68
68
69 $ hg init ytest
69 $ hg init ytest
70 $ cd ytest
70 $ cd ytest
71 $ echo "syntax: glob" >> .hgignore
71 $ echo "syntax: glob" >> .hgignore
72 $ echo "*.orig" >> .hgignore
72 $ echo "*.orig" >> .hgignore
73 $ hg ci -Aqm "added .hgignore"
73 $ hg ci -Aqm "added .hgignore"
74 $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
74 $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
75 $ cat >> .hg/hgrc <<EOF
75 $ cat >> .hg/hgrc <<EOF
76 > [alias]
76 > [alias]
77 > glog = log -GT "{rev}:{node|short} {desc}"
77 > glog = log -GT "{rev}:{node|short} {desc}"
78 > [extensions]
78 > [extensions]
79 > sparse =
79 > sparse =
80 > EOF
80 > EOF
81
81
82 $ hg glog
82 $ hg glog
83 @ 2:f29feff37cfc added d
83 @ 2:f29feff37cfc added d
84 |
84 |
85 o 1:617125d27d6b added a
85 o 1:617125d27d6b added a
86 |
86 |
87 o 0:53f3774ed939 added .hgignore
87 o 0:53f3774ed939 added .hgignore
88
88
89 $ hg rm d
89 $ hg rm d
90 $ hg ci -m "removed d"
90 $ hg ci -m "removed d"
91
91
92 $ hg up '.^'
92 $ hg up '.^'
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 $ hg debugsparse --reset
94 $ hg debugsparse --reset
95 $ echo bar >> d
95 $ echo bar >> d
96 $ hg ci -Am "added bar to d"
96 $ hg ci -Am "added bar to d"
97 created new head
97 created new head
98
98
99 $ hg glog
99 $ hg glog
100 @ 4:6527874a90e4 added bar to d
100 @ 4:6527874a90e4 added bar to d
101 |
101 |
102 | o 3:372c8558de45 removed d
102 | o 3:372c8558de45 removed d
103 |/
103 |/
104 o 2:f29feff37cfc added d
104 o 2:f29feff37cfc added d
105 |
105 |
106 o 1:617125d27d6b added a
106 o 1:617125d27d6b added a
107 |
107 |
108 o 0:53f3774ed939 added .hgignore
108 o 0:53f3774ed939 added .hgignore
109
109
110 $ hg debugsparse --exclude "d"
110 $ hg debugsparse --exclude "d"
111 $ ls
111 $ ls
112 a
112 a
113
113
114 $ hg merge
114 $ hg merge
115 temporarily included 1 file(s) in the sparse checkout for merging
115 temporarily included 1 file(s) in the sparse checkout for merging
116 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
116 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
117 What do you want to do?
117 What do you want to do?
118 use (c)hanged version, (d)elete, or leave (u)nresolved? u
118 use (c)hanged version, (d)elete, or leave (u)nresolved? u
119 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
119 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
120 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
120 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
121 [1]
121 [1]
122
123 $ cd ..
124
125 Testing merging of a file which is renamed+modified on one side and modified on
126 another
127
128 $ hg init mvtest
129 $ cd mvtest
130 $ echo "syntax: glob" >> .hgignore
131 $ echo "*.orig" >> .hgignore
132 $ hg ci -Aqm "added .hgignore"
133 $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done;
134 $ cat >> .hg/hgrc <<EOF
135 > [alias]
136 > glog = log -GT "{rev}:{node|short} {desc}"
137 > [extensions]
138 > sparse =
139 > EOF
140
141 $ hg glog
142 @ 2:f29feff37cfc added d
143 |
144 o 1:617125d27d6b added a
145 |
146 o 0:53f3774ed939 added .hgignore
147
148 $ echo babar >> a
149 $ hg ci -m "added babar to a"
150
151 $ hg up '.^'
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 $ hg mv a amove
154 $ hg ci -m "moved a to amove"
155 created new head
156
157 $ hg up 3
158 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
159 $ hg glog
160 o 4:5d1e85955f6d moved a to amove
161 |
162 | @ 3:a06e41a6c16c added babar to a
163 |/
164 o 2:f29feff37cfc added d
165 |
166 o 1:617125d27d6b added a
167 |
168 o 0:53f3774ed939 added .hgignore
169
170 $ hg debugsparse --exclude "a"
171 $ ls
172 d
173
174 $ hg merge
175 abort: $ENOENT$: $TESTTMP/mvtest/a
176 [255]
177
178 $ hg up -C 4
179 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
180
181 $ hg merge
182 merging amove and a to amove
183 abort: cannot add 'a' - it is outside the sparse checkout
184 (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
185 [255]
General Comments 0
You need to be logged in to leave comments. Login now