##// END OF EJS Templates
test-subrepo: demonstrate a status problem when merge deletes a file...
Matt Harbison -
r33366:062c1bde default
parent child Browse files
Show More
@@ -1,130 +1,138 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -qAm 'add a'
4 $ hg ci -qAm 'add a'
5
5
6 $ hg init subrepo
6 $ hg init subrepo
7 $ echo 'subrepo = http://example.net/libfoo' > .hgsub
7 $ echo 'subrepo = http://example.net/libfoo' > .hgsub
8 $ hg ci -qAm 'added subrepo'
8 $ hg ci -qAm 'added subrepo'
9
9
10 $ hg up -qC 0
10 $ hg up -qC 0
11 $ echo ax > a
11 $ echo ax > a
12 $ hg ci -m 'changed a'
12 $ hg ci -m 'changed a'
13 created new head
13 created new head
14
14
15 $ hg up -qC 1
15 $ hg up -qC 1
16 $ cd subrepo
16 $ cd subrepo
17 $ echo b > b
17 $ echo b > b
18 $ hg add b
18 $ hg add b
19 $ cd ..
19 $ cd ..
20
20
21 Should fail, since there are added files to subrepo:
21 Should fail, since there are added files to subrepo:
22
22
23 $ hg merge
23 $ hg merge
24 abort: uncommitted changes in subrepository "subrepo"
24 abort: uncommitted changes in subrepository "subrepo"
25 [255]
25 [255]
26
26
27 Deleted files trigger a '+' marker in top level repos. Deleted files are also
27 Deleted files trigger a '+' marker in top level repos. Deleted files are also
28 noticed by `update --check` in the top level repo.
28 noticed by `update --check` in the top level repo.
29
29
30 $ hg ci -Sqm 'add b'
30 $ hg ci -Sqm 'add b'
31 $ echo change > subrepo/b
31 $ echo change > subrepo/b
32
32
33 $ hg ci -Sm 'change b'
33 $ hg ci -Sm 'change b'
34 committing subrepository subrepo
34 committing subrepository subrepo
35
35
36 $ rm a
36 $ rm a
37 $ hg id
37 $ hg id
38 9bfe45a197d7+ tip
38 9bfe45a197d7+ tip
39 $ hg sum
39 $ hg sum
40 parent: 4:9bfe45a197d7 tip
40 parent: 4:9bfe45a197d7 tip
41 change b
41 change b
42 branch: default
42 branch: default
43 commit: 1 deleted (clean)
43 commit: 1 deleted (clean)
44 update: 1 new changesets, 2 branch heads (merge)
44 update: 1 new changesets, 2 branch heads (merge)
45 phases: 5 draft
45 phases: 5 draft
46
46
47 $ hg up --check -r '.^'
47 $ hg up --check -r '.^'
48 abort: uncommitted changes
48 abort: uncommitted changes
49 [255]
49 [255]
50 $ hg st -S
50 $ hg st -S
51 ! a
51 ! a
52 $ hg up -Cq .
52 $ hg up -Cq .
53
53
54 Test that dirty is consistent through subrepos
54 Test that dirty is consistent through subrepos
55
55
56 $ rm subrepo/b
56 $ rm subrepo/b
57
57
58 A deleted subrepo file is flagged as dirty, like the top level repo
58 A deleted subrepo file is flagged as dirty, like the top level repo
59
59
60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
61 9bfe45a197d7+ tip
61 9bfe45a197d7+ tip
62 $ cat .hg/blackbox.log
62 $ cat .hg/blackbox.log
63 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id (glob)
63 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id (glob)
64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
65
65
66 TODO: a deleted file should be listed as such, like the top level repo
66 TODO: a deleted file should be listed as such, like the top level repo
67
67
68 $ hg sum
68 $ hg sum
69 parent: 4:9bfe45a197d7 tip
69 parent: 4:9bfe45a197d7 tip
70 change b
70 change b
71 branch: default
71 branch: default
72 commit: (clean)
72 commit: (clean)
73 update: 1 new changesets, 2 branch heads (merge)
73 update: 1 new changesets, 2 branch heads (merge)
74 phases: 5 draft
74 phases: 5 draft
75
75
76 Modified subrepo files are noticed by `update --check` and `summary`
76 Modified subrepo files are noticed by `update --check` and `summary`
77
77
78 $ echo mod > subrepo/b
78 $ echo mod > subrepo/b
79 $ hg st -S
79 $ hg st -S
80 M subrepo/b
80 M subrepo/b
81
81
82 $ hg up -r '.^' --check
82 $ hg up -r '.^' --check
83 abort: uncommitted changes in subrepository "subrepo"
83 abort: uncommitted changes in subrepository "subrepo"
84 [255]
84 [255]
85
85
86 $ hg sum
86 $ hg sum
87 parent: 4:9bfe45a197d7 tip
87 parent: 4:9bfe45a197d7 tip
88 change b
88 change b
89 branch: default
89 branch: default
90 commit: 1 subrepos
90 commit: 1 subrepos
91 update: 1 new changesets, 2 branch heads (merge)
91 update: 1 new changesets, 2 branch heads (merge)
92 phases: 5 draft
92 phases: 5 draft
93
93
94 TODO: why is -R needed here? If it's because the subrepo is treated as a
94 TODO: why is -R needed here? If it's because the subrepo is treated as a
95 discrete unit, then this should probably warn or something.
95 discrete unit, then this should probably warn or something.
96 $ hg revert -R subrepo --no-backup subrepo/b -r .
96 $ hg revert -R subrepo --no-backup subrepo/b -r .
97
97
98 $ rm subrepo/b
98 $ rm subrepo/b
99 $ hg st -S
99 $ hg st -S
100 ! subrepo/b
100 ! subrepo/b
101
101
102 `hg update --check` notices a subrepo with a missing file, like it notices a
102 `hg update --check` notices a subrepo with a missing file, like it notices a
103 missing file in the top level repo.
103 missing file in the top level repo.
104
104
105 $ hg up -r '.^' --check
105 $ hg up -r '.^' --check
106 abort: uncommitted changes in subrepository "subrepo"
106 abort: uncommitted changes in subrepository "subrepo"
107 [255]
107 [255]
108
108
109 $ hg up -r '.^' --config ui.interactive=True << EOF
109 $ hg up -r '.^' --config ui.interactive=True << EOF
110 > c
110 > d
111 > EOF
111 > EOF
112 other [destination] changed b which local [working copy] deleted
112 other [destination] changed b which local [working copy] deleted
113 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
113 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115
115
116 XXX: There's a difference between wdir() and '.', so there should be a status.
117 `hg files -S` from the top is also missing 'subrepo/b'.
118
116 $ hg st -S
119 $ hg st -S
120 $ hg st -R subrepo
121 $ hg files -R subrepo
122 [1]
123 $ hg files -R subrepo -r '.'
124 subrepo/b (glob)
117
125
118 $ hg bookmark -r tip @other
126 $ hg bookmark -r tip @other
119 $ echo xyz > subrepo/c
127 $ echo xyz > subrepo/c
120 $ hg ci -SAm 'add c'
128 $ hg ci -SAm 'add c'
121 adding subrepo/c
129 adding subrepo/c
122 committing subrepository subrepo
130 committing subrepository subrepo
123 created new head
131 created new head
124 $ rm subrepo/c
132 $ rm subrepo/c
125
133
126 Merge sees deleted subrepo files as an uncommitted change
134 Merge sees deleted subrepo files as an uncommitted change
127
135
128 $ hg merge @other
136 $ hg merge @other
129 abort: uncommitted changes in subrepository "subrepo"
137 abort: uncommitted changes in subrepository "subrepo"
130 [255]
138 [255]
General Comments 0
You need to be logged in to leave comments. Login now