##// END OF EJS Templates
tests: tweak the subrepo dirty state tests...
Matt Harbison -
r33359:583aa1e3 default
parent child Browse files
Show More
@@ -1,119 +1,129 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
32
33 $ hg ci -Sm 'change b'
34 committing subrepository subrepo
35
31 $ rm a
36 $ rm a
32 $ hg id
37 $ hg id
33 cb66ec850af7+ tip
38 9bfe45a197d7+ tip
34 $ hg sum
39 $ hg sum
35 parent: 3:cb66ec850af7 tip
40 parent: 4:9bfe45a197d7 tip
36 add b
41 change b
37 branch: default
42 branch: default
38 commit: 1 deleted (clean)
43 commit: 1 deleted (clean)
39 update: 1 new changesets, 2 branch heads (merge)
44 update: 1 new changesets, 2 branch heads (merge)
40 phases: 4 draft
45 phases: 5 draft
41
46
42 $ hg up --check -r '.^'
47 $ hg up --check -r '.^'
43 abort: uncommitted changes
48 abort: uncommitted changes
44 [255]
49 [255]
45 $ hg st -S
50 $ hg st -S
46 ! a
51 ! a
47 $ hg up -Cq .
52 $ hg up -Cq .
48
53
49 Test that dirty is consistent through subrepos
54 Test that dirty is consistent through subrepos
50
55
51 $ rm subrepo/b
56 $ rm subrepo/b
52
57
53 TODO: a deleted subrepo file should be flagged as dirty, like the top level repo
58 TODO: a deleted subrepo file should be flagged as dirty, like the top level repo
54
59
55 $ hg id
60 $ hg id --config extensions.blackbox= --config blackbox.dirty=True
56 cb66ec850af7 tip
61 9bfe45a197d7 tip
62 $ cat .hg/blackbox.log
63 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5 (*)> id (glob)
64 * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5 (*)> id --config "extensions.blackbox=" --config "blackbox.dirty=True" exited 0 * (glob)
57
65
58 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
59
67
60 $ hg sum
68 $ hg sum
61 parent: 3:cb66ec850af7 tip
69 parent: 4:9bfe45a197d7 tip
62 add b
70 change b
63 branch: default
71 branch: default
64 commit: (clean)
72 commit: (clean)
65 update: 1 new changesets, 2 branch heads (merge)
73 update: 1 new changesets, 2 branch heads (merge)
66 phases: 4 draft
74 phases: 5 draft
67
75
68 Modified subrepo files are noticed by `update --check` and `summary`
76 Modified subrepo files are noticed by `update --check` and `summary`
69
77
70 $ echo mod > subrepo/b
78 $ echo mod > subrepo/b
71 $ hg st -S
79 $ hg st -S
72 M subrepo/b
80 M subrepo/b
73
81
74 $ hg up -r '.^' --check
82 $ hg up -r '.^' --check
75 abort: uncommitted changes in subrepository 'subrepo'
83 abort: uncommitted changes in subrepository 'subrepo'
76 [255]
84 [255]
77
85
78 $ hg sum
86 $ hg sum
79 parent: 3:cb66ec850af7 tip
87 parent: 4:9bfe45a197d7 tip
80 add b
88 change b
81 branch: default
89 branch: default
82 commit: 1 subrepos
90 commit: 1 subrepos
83 update: 1 new changesets, 2 branch heads (merge)
91 update: 1 new changesets, 2 branch heads (merge)
84 phases: 4 draft
92 phases: 5 draft
85
93
86 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
87 discrete unit, then this should probably warn or something.
95 discrete unit, then this should probably warn or something.
88 $ hg revert -R subrepo --no-backup subrepo/b -r .
96 $ hg revert -R subrepo --no-backup subrepo/b -r .
89
97
90 $ rm subrepo/b
98 $ rm subrepo/b
91 $ hg st -S
99 $ hg st -S
92 ! subrepo/b
100 ! subrepo/b
93
101
94 TODO: --check should notice a subrepo with a missing file. It already notices
102 TODO: --check should notice a subrepo with a missing file. It already notices
95 a modified file.
103 a modified file.
96
104
97 $ hg up -r '.^' --check
105 $ hg up -r '.^' --check --config ui.interactive=True << EOF
106 > c
107 > EOF
108 other [destination] changed b which local [working copy] deleted
109 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99
111
100 TODO: update without --clean shouldn't restore a deleted subrepo file, since it
101 doesn't restore a deleted top level repo file.
102 $ hg st -S
112 $ hg st -S
103
113
104 $ hg bookmark -r tip @other
114 $ hg bookmark -r tip @other
105 $ echo xyz > subrepo/c
115 $ echo xyz > subrepo/c
106 $ hg ci -SAm 'add c'
116 $ hg ci -SAm 'add c'
107 adding subrepo/c
117 adding subrepo/c
108 committing subrepository subrepo
118 committing subrepository subrepo
109 created new head
119 created new head
110 $ rm subrepo/c
120 $ rm subrepo/c
111
121
112 Merge sees deleted subrepo files as an uncommitted change
122 Merge sees deleted subrepo files as an uncommitted change
113
123
114 $ hg merge @other
124 $ hg merge @other
115 subrepository subrepo diverged (local revision: 2b4750dcc93f, remote revision: cde40f86152f)
125 subrepository subrepo diverged (local revision: de222c2e1eac, remote revision: 7d3f8eba8116)
116 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
126 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
117 abort: uncommitted changes (in subrepo subrepo)
127 abort: uncommitted changes (in subrepo subrepo)
118 (use 'hg status' to list changes)
128 (use 'hg status' to list changes)
119 [255]
129 [255]
General Comments 0
You need to be logged in to leave comments. Login now