1 Make status look into subrepositories by default: |
1 Make status look into subrepositories by default: |
2 |
2 |
3 $ echo '[defaults]' >> $HGRCPATH |
3 $ echo '[defaults]' >> $HGRCPATH |
4 $ echo 'status = -S' >> $HGRCPATH |
4 $ echo 'status = -S' >> $HGRCPATH |
|
5 $ echo 'diff = --nodates -S' >> $HGRCPATH |
5 |
6 |
6 Create test repository: |
7 Create test repository: |
7 |
8 |
8 $ hg init |
9 $ hg init |
9 $ echo x1 > x.txt |
10 $ echo x1 > x.txt |
52 $ echo y3 >> foo/y.txt |
53 $ echo y3 >> foo/y.txt |
53 $ echo z3 >> foo/bar/z.txt |
54 $ echo z3 >> foo/bar/z.txt |
54 $ hg status |
55 $ hg status |
55 M foo/bar/z.txt |
56 M foo/bar/z.txt |
56 M foo/y.txt |
57 M foo/y.txt |
|
58 $ hg diff |
|
59 diff -r d254738c5f5e foo/y.txt |
|
60 --- a/foo/y.txt |
|
61 +++ b/foo/y.txt |
|
62 @@ -1,2 +1,3 @@ |
|
63 y1 |
|
64 y2 |
|
65 +y3 |
|
66 diff -r 9647f22de499 foo/bar/z.txt |
|
67 --- a/foo/bar/z.txt |
|
68 +++ b/foo/bar/z.txt |
|
69 @@ -1,2 +1,3 @@ |
|
70 z1 |
|
71 z2 |
|
72 +z3 |
57 |
73 |
58 Status call crossing repository boundaries: |
74 Status call crossing repository boundaries: |
59 |
75 |
60 $ hg status foo/bar/z.txt |
76 $ hg status foo/bar/z.txt |
61 M foo/bar/z.txt |
77 M foo/bar/z.txt |
62 $ hg status -I 'foo/?.txt' |
78 $ hg status -I 'foo/?.txt' |
63 M foo/y.txt |
79 M foo/y.txt |
64 $ hg status -I '**/?.txt' |
80 $ hg status -I '**/?.txt' |
65 M foo/bar/z.txt |
81 M foo/bar/z.txt |
66 M foo/y.txt |
82 M foo/y.txt |
|
83 $ hg diff -I '**/?.txt' |
|
84 diff -r d254738c5f5e foo/y.txt |
|
85 --- a/foo/y.txt |
|
86 +++ b/foo/y.txt |
|
87 @@ -1,2 +1,3 @@ |
|
88 y1 |
|
89 y2 |
|
90 +y3 |
|
91 diff -r 9647f22de499 foo/bar/z.txt |
|
92 --- a/foo/bar/z.txt |
|
93 +++ b/foo/bar/z.txt |
|
94 @@ -1,2 +1,3 @@ |
|
95 z1 |
|
96 z2 |
|
97 +z3 |
67 |
98 |
68 Status from within a subdirectory: |
99 Status from within a subdirectory: |
69 |
100 |
70 $ mkdir dir |
101 $ mkdir dir |
71 $ cd dir |
102 $ cd dir |
72 $ echo a1 > a.txt |
103 $ echo a1 > a.txt |
73 $ hg status |
104 $ hg status |
74 M foo/bar/z.txt |
105 M foo/bar/z.txt |
75 M foo/y.txt |
106 M foo/y.txt |
76 ? dir/a.txt |
107 ? dir/a.txt |
|
108 $ hg diff |
|
109 diff -r d254738c5f5e foo/y.txt |
|
110 --- a/foo/y.txt |
|
111 +++ b/foo/y.txt |
|
112 @@ -1,2 +1,3 @@ |
|
113 y1 |
|
114 y2 |
|
115 +y3 |
|
116 diff -r 9647f22de499 foo/bar/z.txt |
|
117 --- a/foo/bar/z.txt |
|
118 +++ b/foo/bar/z.txt |
|
119 @@ -1,2 +1,3 @@ |
|
120 z1 |
|
121 z2 |
|
122 +z3 |
77 |
123 |
78 Status with relative path: |
124 Status with relative path: |
79 |
125 |
80 $ hg status .. |
126 $ hg status .. |
81 M ../foo/bar/z.txt |
127 M ../foo/bar/z.txt |
82 M ../foo/y.txt |
128 M ../foo/y.txt |
83 ? a.txt |
129 ? a.txt |
|
130 $ hg diff .. |
|
131 diff -r d254738c5f5e foo/y.txt |
|
132 --- a/foo/y.txt |
|
133 +++ b/foo/y.txt |
|
134 @@ -1,2 +1,3 @@ |
|
135 y1 |
|
136 y2 |
|
137 +y3 |
|
138 diff -r 9647f22de499 foo/bar/z.txt |
|
139 --- a/foo/bar/z.txt |
|
140 +++ b/foo/bar/z.txt |
|
141 @@ -1,2 +1,3 @@ |
|
142 z1 |
|
143 z2 |
|
144 +z3 |
84 $ cd .. |
145 $ cd .. |
|
146 |
|
147 Cleanup and final commit: |
|
148 |
|
149 $ rm -r dir |
|
150 $ hg commit -m 2-3-2 |
|
151 committing subrepository foo |
|
152 committing subrepository foo/bar |
|
153 |
|
154 Log with the relationships between repo and its subrepo: |
|
155 |
|
156 $ hg log --template '{rev}:{node|short} {desc}\n' |
|
157 2:1326fa26d0c0 2-3-2 |
|
158 1:4b3c9ff4f66b 1-2-1 |
|
159 0:23376cbba0d8 0-0-0 |
|
160 |
|
161 $ hg -R foo log --template '{rev}:{node|short} {desc}\n' |
|
162 3:65903cebad86 2-3-2 |
|
163 2:d254738c5f5e 0-2-1 |
|
164 1:8629ce7dcc39 0-1-0 |
|
165 0:af048e97ade2 0-0-0 |
|
166 |
|
167 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' |
|
168 2:31ecbdafd357 2-3-2 |
|
169 1:9647f22de499 0-1-1 |
|
170 0:4904098473f9 0-0-0 |
85 |
171 |
86 Status between revisions: |
172 Status between revisions: |
87 |
173 |
88 $ rm -r dir |
|
89 $ hg commit -m 2-2-1 |
|
90 committing subrepository foo |
|
91 committing subrepository foo/bar |
|
92 $ hg status |
174 $ hg status |
93 $ hg status --rev 0:1 |
175 $ hg status --rev 0:1 |
94 M .hgsubstate |
176 M .hgsubstate |
95 M foo/.hgsubstate |
177 M foo/.hgsubstate |
96 M foo/bar/z.txt |
178 M foo/bar/z.txt |
97 M foo/y.txt |
179 M foo/y.txt |
|
180 $ hg diff -I '**/?.txt' --rev 0:1 |
|
181 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt |
|
182 --- a/foo/y.txt |
|
183 +++ b/foo/y.txt |
|
184 @@ -1,1 +1,2 @@ |
|
185 y1 |
|
186 +y2 |
|
187 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt |
|
188 --- a/foo/bar/z.txt |
|
189 +++ b/foo/bar/z.txt |
|
190 @@ -1,1 +1,2 @@ |
|
191 z1 |
|
192 +z2 |