##// END OF EJS Templates
cat: record the current behavior of wildcard matches in subrepos...
Yuya Nishihara -
r35166:27196b7f stable
parent child Browse files
Show More
@@ -1,169 +1,169
1 Subrepositories let you nest external repositories or projects into a
1 Subrepositories let you nest external repositories or projects into a
2 parent Mercurial repository, and make commands operate on them as a
2 parent Mercurial repository, and make commands operate on them as a
3 group.
3 group.
4
4
5 Mercurial currently supports Mercurial, Git, and Subversion
5 Mercurial currently supports Mercurial, Git, and Subversion
6 subrepositories.
6 subrepositories.
7
7
8 Subrepositories are made of three components:
8 Subrepositories are made of three components:
9
9
10 1. Nested repository checkouts. They can appear anywhere in the
10 1. Nested repository checkouts. They can appear anywhere in the
11 parent working directory.
11 parent working directory.
12
12
13 2. Nested repository references. They are defined in ``.hgsub``, which
13 2. Nested repository references. They are defined in ``.hgsub``, which
14 should be placed in the root of working directory, and
14 should be placed in the root of working directory, and
15 tell where the subrepository checkouts come from. Mercurial
15 tell where the subrepository checkouts come from. Mercurial
16 subrepositories are referenced like::
16 subrepositories are referenced like::
17
17
18 path/to/nested = https://example.com/nested/repo/path
18 path/to/nested = https://example.com/nested/repo/path
19
19
20 Git and Subversion subrepos are also supported::
20 Git and Subversion subrepos are also supported::
21
21
22 path/to/nested = [git]git://example.com/nested/repo/path
22 path/to/nested = [git]git://example.com/nested/repo/path
23 path/to/nested = [svn]https://example.com/nested/trunk/path
23 path/to/nested = [svn]https://example.com/nested/trunk/path
24
24
25 where ``path/to/nested`` is the checkout location relatively to the
25 where ``path/to/nested`` is the checkout location relatively to the
26 parent Mercurial root, and ``https://example.com/nested/repo/path``
26 parent Mercurial root, and ``https://example.com/nested/repo/path``
27 is the source repository path. The source can also reference a
27 is the source repository path. The source can also reference a
28 filesystem path.
28 filesystem path.
29
29
30 Note that ``.hgsub`` does not exist by default in Mercurial
30 Note that ``.hgsub`` does not exist by default in Mercurial
31 repositories, you have to create and add it to the parent
31 repositories, you have to create and add it to the parent
32 repository before using subrepositories.
32 repository before using subrepositories.
33
33
34 3. Nested repository states. They are defined in ``.hgsubstate``, which
34 3. Nested repository states. They are defined in ``.hgsubstate``, which
35 is placed in the root of working directory, and
35 is placed in the root of working directory, and
36 capture whatever information is required to restore the
36 capture whatever information is required to restore the
37 subrepositories to the state they were committed in a parent
37 subrepositories to the state they were committed in a parent
38 repository changeset. Mercurial automatically record the nested
38 repository changeset. Mercurial automatically record the nested
39 repositories states when committing in the parent repository.
39 repositories states when committing in the parent repository.
40
40
41 .. note::
41 .. note::
42
42
43 The ``.hgsubstate`` file should not be edited manually.
43 The ``.hgsubstate`` file should not be edited manually.
44
44
45
45
46 Adding a Subrepository
46 Adding a Subrepository
47 ======================
47 ======================
48
48
49 If ``.hgsub`` does not exist, create it and add it to the parent
49 If ``.hgsub`` does not exist, create it and add it to the parent
50 repository. Clone or checkout the external projects where you want it
50 repository. Clone or checkout the external projects where you want it
51 to live in the parent repository. Edit ``.hgsub`` and add the
51 to live in the parent repository. Edit ``.hgsub`` and add the
52 subrepository entry as described above. At this point, the
52 subrepository entry as described above. At this point, the
53 subrepository is tracked and the next commit will record its state in
53 subrepository is tracked and the next commit will record its state in
54 ``.hgsubstate`` and bind it to the committed changeset.
54 ``.hgsubstate`` and bind it to the committed changeset.
55
55
56 Synchronizing a Subrepository
56 Synchronizing a Subrepository
57 =============================
57 =============================
58
58
59 Subrepos do not automatically track the latest changeset of their
59 Subrepos do not automatically track the latest changeset of their
60 sources. Instead, they are updated to the changeset that corresponds
60 sources. Instead, they are updated to the changeset that corresponds
61 with the changeset checked out in the top-level changeset. This is so
61 with the changeset checked out in the top-level changeset. This is so
62 developers always get a consistent set of compatible code and
62 developers always get a consistent set of compatible code and
63 libraries when they update.
63 libraries when they update.
64
64
65 Thus, updating subrepos is a manual process. Simply check out target
65 Thus, updating subrepos is a manual process. Simply check out target
66 subrepo at the desired revision, test in the top-level repo, then
66 subrepo at the desired revision, test in the top-level repo, then
67 commit in the parent repository to record the new combination.
67 commit in the parent repository to record the new combination.
68
68
69 Deleting a Subrepository
69 Deleting a Subrepository
70 ========================
70 ========================
71
71
72 To remove a subrepository from the parent repository, delete its
72 To remove a subrepository from the parent repository, delete its
73 reference from ``.hgsub``, then remove its files.
73 reference from ``.hgsub``, then remove its files.
74
74
75 Interaction with Mercurial Commands
75 Interaction with Mercurial Commands
76 ===================================
76 ===================================
77
77
78 :add: add does not recurse in subrepos unless -S/--subrepos is
78 :add: add does not recurse in subrepos unless -S/--subrepos is
79 specified. However, if you specify the full path of a file in a
79 specified. However, if you specify the full path of a file in a
80 subrepo, it will be added even without -S/--subrepos specified.
80 subrepo, it will be added even without -S/--subrepos specified.
81 Subversion subrepositories are currently silently
81 Subversion subrepositories are currently silently
82 ignored.
82 ignored.
83
83
84 :addremove: addremove does not recurse into subrepos unless
84 :addremove: addremove does not recurse into subrepos unless
85 -S/--subrepos is specified. However, if you specify the full
85 -S/--subrepos is specified. However, if you specify the full
86 path of a directory in a subrepo, addremove will be performed on
86 path of a directory in a subrepo, addremove will be performed on
87 it even without -S/--subrepos being specified. Git and
87 it even without -S/--subrepos being specified. Git and
88 Subversion subrepositories will print a warning and continue.
88 Subversion subrepositories will print a warning and continue.
89
89
90 :archive: archive does not recurse in subrepositories unless
90 :archive: archive does not recurse in subrepositories unless
91 -S/--subrepos is specified.
91 -S/--subrepos is specified.
92
92
93 :cat: cat currently only handles exact file matches in subrepos.
93 :cat: Git subrepositories only support exact file matches.
94 Subversion subrepositories are currently ignored.
94 Subversion subrepositories are currently ignored.
95
95
96 :commit: commit creates a consistent snapshot of the state of the
96 :commit: commit creates a consistent snapshot of the state of the
97 entire project and its subrepositories. If any subrepositories
97 entire project and its subrepositories. If any subrepositories
98 have been modified, Mercurial will abort. Mercurial can be made
98 have been modified, Mercurial will abort. Mercurial can be made
99 to instead commit all modified subrepositories by specifying
99 to instead commit all modified subrepositories by specifying
100 -S/--subrepos, or setting "ui.commitsubrepos=True" in a
100 -S/--subrepos, or setting "ui.commitsubrepos=True" in a
101 configuration file (see :hg:`help config`). After there are no
101 configuration file (see :hg:`help config`). After there are no
102 longer any modified subrepositories, it records their state and
102 longer any modified subrepositories, it records their state and
103 finally commits it in the parent repository. The --addremove
103 finally commits it in the parent repository. The --addremove
104 option also honors the -S/--subrepos option. However, Git and
104 option also honors the -S/--subrepos option. However, Git and
105 Subversion subrepositories will print a warning and abort.
105 Subversion subrepositories will print a warning and abort.
106
106
107 :diff: diff does not recurse in subrepos unless -S/--subrepos is
107 :diff: diff does not recurse in subrepos unless -S/--subrepos is
108 specified. Changes are displayed as usual, on the subrepositories
108 specified. Changes are displayed as usual, on the subrepositories
109 elements. Subversion subrepositories are currently silently ignored.
109 elements. Subversion subrepositories are currently silently ignored.
110
110
111 :files: files does not recurse into subrepos unless -S/--subrepos is
111 :files: files does not recurse into subrepos unless -S/--subrepos is
112 specified. However, if you specify the full path of a file or
112 specified. However, if you specify the full path of a file or
113 directory in a subrepo, it will be displayed even without
113 directory in a subrepo, it will be displayed even without
114 -S/--subrepos being specified. Git and Subversion subrepositories
114 -S/--subrepos being specified. Git and Subversion subrepositories
115 are currently silently ignored.
115 are currently silently ignored.
116
116
117 :forget: forget currently only handles exact file matches in subrepos.
117 :forget: forget currently only handles exact file matches in subrepos.
118 Git and Subversion subrepositories are currently silently ignored.
118 Git and Subversion subrepositories are currently silently ignored.
119
119
120 :incoming: incoming does not recurse in subrepos unless -S/--subrepos
120 :incoming: incoming does not recurse in subrepos unless -S/--subrepos
121 is specified. Git and Subversion subrepositories are currently
121 is specified. Git and Subversion subrepositories are currently
122 silently ignored.
122 silently ignored.
123
123
124 :outgoing: outgoing does not recurse in subrepos unless -S/--subrepos
124 :outgoing: outgoing does not recurse in subrepos unless -S/--subrepos
125 is specified. Git and Subversion subrepositories are currently
125 is specified. Git and Subversion subrepositories are currently
126 silently ignored.
126 silently ignored.
127
127
128 :pull: pull is not recursive since it is not clear what to pull prior
128 :pull: pull is not recursive since it is not clear what to pull prior
129 to running :hg:`update`. Listing and retrieving all
129 to running :hg:`update`. Listing and retrieving all
130 subrepositories changes referenced by the parent repository pulled
130 subrepositories changes referenced by the parent repository pulled
131 changesets is expensive at best, impossible in the Subversion
131 changesets is expensive at best, impossible in the Subversion
132 case.
132 case.
133
133
134 :push: Mercurial will automatically push all subrepositories first
134 :push: Mercurial will automatically push all subrepositories first
135 when the parent repository is being pushed. This ensures new
135 when the parent repository is being pushed. This ensures new
136 subrepository changes are available when referenced by top-level
136 subrepository changes are available when referenced by top-level
137 repositories. Push is a no-op for Subversion subrepositories.
137 repositories. Push is a no-op for Subversion subrepositories.
138
138
139 :serve: serve does not recurse into subrepositories unless
139 :serve: serve does not recurse into subrepositories unless
140 -S/--subrepos is specified. Git and Subversion subrepositories
140 -S/--subrepos is specified. Git and Subversion subrepositories
141 are currently silently ignored.
141 are currently silently ignored.
142
142
143 :status: status does not recurse into subrepositories unless
143 :status: status does not recurse into subrepositories unless
144 -S/--subrepos is specified. Subrepository changes are displayed as
144 -S/--subrepos is specified. Subrepository changes are displayed as
145 regular Mercurial changes on the subrepository
145 regular Mercurial changes on the subrepository
146 elements. Subversion subrepositories are currently silently
146 elements. Subversion subrepositories are currently silently
147 ignored.
147 ignored.
148
148
149 :remove: remove does not recurse into subrepositories unless
149 :remove: remove does not recurse into subrepositories unless
150 -S/--subrepos is specified. However, if you specify a file or
150 -S/--subrepos is specified. However, if you specify a file or
151 directory path in a subrepo, it will be removed even without
151 directory path in a subrepo, it will be removed even without
152 -S/--subrepos. Git and Subversion subrepositories are currently
152 -S/--subrepos. Git and Subversion subrepositories are currently
153 silently ignored.
153 silently ignored.
154
154
155 :update: update restores the subrepos in the state they were
155 :update: update restores the subrepos in the state they were
156 originally committed in target changeset. If the recorded
156 originally committed in target changeset. If the recorded
157 changeset is not available in the current subrepository, Mercurial
157 changeset is not available in the current subrepository, Mercurial
158 will pull it in first before updating. This means that updating
158 will pull it in first before updating. This means that updating
159 can require network access when using subrepositories.
159 can require network access when using subrepositories.
160
160
161 Remapping Subrepositories Sources
161 Remapping Subrepositories Sources
162 =================================
162 =================================
163
163
164 A subrepository source location may change during a project life,
164 A subrepository source location may change during a project life,
165 invalidating references stored in the parent repository history. To
165 invalidating references stored in the parent repository history. To
166 fix this, rewriting rules can be defined in parent repository ``hgrc``
166 fix this, rewriting rules can be defined in parent repository ``hgrc``
167 file or in Mercurial configuration. See the ``[subpaths]`` section in
167 file or in Mercurial configuration. See the ``[subpaths]`` section in
168 hgrc(5) for more details.
168 hgrc(5) for more details.
169
169
@@ -1,1931 +1,1943
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a (glob)
32 s/a (glob)
33
33
34 $ hg -R s ci -Ams0
34 $ hg -R s ci -Ams0
35 $ hg sum
35 $ hg sum
36 parent: 0:f7b1eb17ad24 tip
36 parent: 0:f7b1eb17ad24 tip
37 0
37 0
38 branch: default
38 branch: default
39 commit: 1 added, 1 subrepos
39 commit: 1 added, 1 subrepos
40 update: (current)
40 update: (current)
41 phases: 1 draft
41 phases: 1 draft
42 $ hg ci -m1
42 $ hg ci -m1
43
43
44 test handling .hgsubstate "added" explicitly.
44 test handling .hgsubstate "added" explicitly.
45
45
46 $ hg parents --template '{node}\n{files}\n'
46 $ hg parents --template '{node}\n{files}\n'
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
48 .hgsub .hgsubstate
48 .hgsub .hgsubstate
49 $ hg rollback -q
49 $ hg rollback -q
50 $ hg add .hgsubstate
50 $ hg add .hgsubstate
51 $ hg ci -m1
51 $ hg ci -m1
52 $ hg parents --template '{node}\n{files}\n'
52 $ hg parents --template '{node}\n{files}\n'
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 .hgsub .hgsubstate
54 .hgsub .hgsubstate
55
55
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
57
57
58 $ mkdir snot
58 $ mkdir snot
59 $ touch snot/file
59 $ touch snot/file
60 $ hg remove -S snot/file
60 $ hg remove -S snot/file
61 not removing snot/file: file is untracked (glob)
61 not removing snot/file: file is untracked (glob)
62 [1]
62 [1]
63 $ hg cat snot/filenot
63 $ hg cat snot/filenot
64 snot/filenot: no such file in rev 7cf8cfea66e4 (glob)
64 snot/filenot: no such file in rev 7cf8cfea66e4 (glob)
65 [1]
65 [1]
66 $ rm -r snot
66 $ rm -r snot
67
67
68 Revert subrepo and test subrepo fileset keyword:
68 Revert subrepo and test subrepo fileset keyword:
69
69
70 $ echo b > s/a
70 $ echo b > s/a
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
72 reverting subrepo s
72 reverting subrepo s
73 reverting s/a (glob)
73 reverting s/a (glob)
74 $ cat s/a
74 $ cat s/a
75 b
75 b
76 $ hg revert "set:subrepo('glob:s*')"
76 $ hg revert "set:subrepo('glob:s*')"
77 reverting subrepo s
77 reverting subrepo s
78 reverting s/a (glob)
78 reverting s/a (glob)
79 $ cat s/a
79 $ cat s/a
80 a
80 a
81 $ rm s/a.orig
81 $ rm s/a.orig
82
82
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
84 we're really running 'hg update' in the subrepo:
84 we're really running 'hg update' in the subrepo:
85
85
86 $ echo b > s/a
86 $ echo b > s/a
87 $ hg revert --no-backup s
87 $ hg revert --no-backup s
88 reverting subrepo s
88 reverting subrepo s
89
89
90 Issue2022: update -C
90 Issue2022: update -C
91
91
92 $ echo b > s/a
92 $ echo b > s/a
93 $ hg sum
93 $ hg sum
94 parent: 1:7cf8cfea66e4 tip
94 parent: 1:7cf8cfea66e4 tip
95 1
95 1
96 branch: default
96 branch: default
97 commit: 1 subrepos
97 commit: 1 subrepos
98 update: (current)
98 update: (current)
99 phases: 2 draft
99 phases: 2 draft
100 $ hg co -C 1
100 $ hg co -C 1
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg sum
102 $ hg sum
103 parent: 1:7cf8cfea66e4 tip
103 parent: 1:7cf8cfea66e4 tip
104 1
104 1
105 branch: default
105 branch: default
106 commit: (clean)
106 commit: (clean)
107 update: (current)
107 update: (current)
108 phases: 2 draft
108 phases: 2 draft
109
109
110 commands that require a clean repo should respect subrepos
110 commands that require a clean repo should respect subrepos
111
111
112 $ echo b >> s/a
112 $ echo b >> s/a
113 $ hg backout tip
113 $ hg backout tip
114 abort: uncommitted changes in subrepository "s"
114 abort: uncommitted changes in subrepository "s"
115 [255]
115 [255]
116 $ hg revert -C -R s s/a
116 $ hg revert -C -R s s/a
117
117
118 add sub sub
118 add sub sub
119
119
120 $ echo ss = ss > s/.hgsub
120 $ echo ss = ss > s/.hgsub
121 $ hg init s/ss
121 $ hg init s/ss
122 $ echo a > s/ss/a
122 $ echo a > s/ss/a
123 $ hg -R s add s/.hgsub
123 $ hg -R s add s/.hgsub
124 $ hg -R s/ss add s/ss/a
124 $ hg -R s/ss add s/ss/a
125 $ hg sum
125 $ hg sum
126 parent: 1:7cf8cfea66e4 tip
126 parent: 1:7cf8cfea66e4 tip
127 1
127 1
128 branch: default
128 branch: default
129 commit: 1 subrepos
129 commit: 1 subrepos
130 update: (current)
130 update: (current)
131 phases: 2 draft
131 phases: 2 draft
132 $ hg ci -m2
132 $ hg ci -m2
133 committing subrepository s
133 committing subrepository s
134 committing subrepository s/ss (glob)
134 committing subrepository s/ss (glob)
135 $ hg sum
135 $ hg sum
136 parent: 2:df30734270ae tip
136 parent: 2:df30734270ae tip
137 2
137 2
138 branch: default
138 branch: default
139 commit: (clean)
139 commit: (clean)
140 update: (current)
140 update: (current)
141 phases: 3 draft
141 phases: 3 draft
142
142
143 test handling .hgsubstate "modified" explicitly.
143 test handling .hgsubstate "modified" explicitly.
144
144
145 $ hg parents --template '{node}\n{files}\n'
145 $ hg parents --template '{node}\n{files}\n'
146 df30734270ae757feb35e643b7018e818e78a9aa
146 df30734270ae757feb35e643b7018e818e78a9aa
147 .hgsubstate
147 .hgsubstate
148 $ hg rollback -q
148 $ hg rollback -q
149 $ hg status -A .hgsubstate
149 $ hg status -A .hgsubstate
150 M .hgsubstate
150 M .hgsubstate
151 $ hg ci -m2
151 $ hg ci -m2
152 $ hg parents --template '{node}\n{files}\n'
152 $ hg parents --template '{node}\n{files}\n'
153 df30734270ae757feb35e643b7018e818e78a9aa
153 df30734270ae757feb35e643b7018e818e78a9aa
154 .hgsubstate
154 .hgsubstate
155
155
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
157
157
158 $ echo b > s/a
158 $ echo b > s/a
159 $ hg -R s ci -ms1
159 $ hg -R s ci -ms1
160 $ hg --config ui.commitsubrepos=no ci -m3
160 $ hg --config ui.commitsubrepos=no ci -m3
161
161
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
163
163
164 $ echo c > s/a
164 $ echo c > s/a
165 $ hg --config ui.commitsubrepos=no ci -m4
165 $ hg --config ui.commitsubrepos=no ci -m4
166 abort: uncommitted changes in subrepository "s"
166 abort: uncommitted changes in subrepository "s"
167 (use --subrepos for recursive commit)
167 (use --subrepos for recursive commit)
168 [255]
168 [255]
169 $ hg id
169 $ hg id
170 f6affe3fbfaa+ tip
170 f6affe3fbfaa+ tip
171 $ hg -R s ci -mc
171 $ hg -R s ci -mc
172 $ hg id
172 $ hg id
173 f6affe3fbfaa+ tip
173 f6affe3fbfaa+ tip
174 $ echo d > s/a
174 $ echo d > s/a
175 $ hg ci -m4
175 $ hg ci -m4
176 committing subrepository s
176 committing subrepository s
177 $ hg tip -R s
177 $ hg tip -R s
178 changeset: 4:02dcf1d70411
178 changeset: 4:02dcf1d70411
179 tag: tip
179 tag: tip
180 user: test
180 user: test
181 date: Thu Jan 01 00:00:00 1970 +0000
181 date: Thu Jan 01 00:00:00 1970 +0000
182 summary: 4
182 summary: 4
183
183
184
184
185 check caching
185 check caching
186
186
187 $ hg co 0
187 $ hg co 0
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
189 $ hg debugsub
189 $ hg debugsub
190
190
191 restore
191 restore
192
192
193 $ hg co
193 $ hg co
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg debugsub
195 $ hg debugsub
196 path s
196 path s
197 source s
197 source s
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
199
199
200 new branch for merge tests
200 new branch for merge tests
201
201
202 $ hg co 1
202 $ hg co 1
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ echo t = t >> .hgsub
204 $ echo t = t >> .hgsub
205 $ hg init t
205 $ hg init t
206 $ echo t > t/t
206 $ echo t > t/t
207 $ hg -R t add t
207 $ hg -R t add t
208 adding t/t (glob)
208 adding t/t (glob)
209
209
210 5
210 5
211
211
212 $ hg ci -m5 # add sub
212 $ hg ci -m5 # add sub
213 committing subrepository t
213 committing subrepository t
214 created new head
214 created new head
215 $ echo t2 > t/t
215 $ echo t2 > t/t
216
216
217 6
217 6
218
218
219 $ hg st -R s
219 $ hg st -R s
220 $ hg ci -m6 # change sub
220 $ hg ci -m6 # change sub
221 committing subrepository t
221 committing subrepository t
222 $ hg debugsub
222 $ hg debugsub
223 path s
223 path s
224 source s
224 source s
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
226 path t
226 path t
227 source t
227 source t
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
229 $ echo t3 > t/t
229 $ echo t3 > t/t
230
230
231 7
231 7
232
232
233 $ hg ci -m7 # change sub again for conflict test
233 $ hg ci -m7 # change sub again for conflict test
234 committing subrepository t
234 committing subrepository t
235 $ hg rm .hgsub
235 $ hg rm .hgsub
236
236
237 8
237 8
238
238
239 $ hg ci -m8 # remove sub
239 $ hg ci -m8 # remove sub
240
240
241 test handling .hgsubstate "removed" explicitly.
241 test handling .hgsubstate "removed" explicitly.
242
242
243 $ hg parents --template '{node}\n{files}\n'
243 $ hg parents --template '{node}\n{files}\n'
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
245 .hgsub .hgsubstate
245 .hgsub .hgsubstate
246 $ hg rollback -q
246 $ hg rollback -q
247 $ hg remove .hgsubstate
247 $ hg remove .hgsubstate
248 $ hg ci -m8
248 $ hg ci -m8
249 $ hg parents --template '{node}\n{files}\n'
249 $ hg parents --template '{node}\n{files}\n'
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
251 .hgsub .hgsubstate
251 .hgsub .hgsubstate
252
252
253 merge tests
253 merge tests
254
254
255 $ hg co -C 3
255 $ hg co -C 3
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg merge 5 # test adding
257 $ hg merge 5 # test adding
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 (branch merge, don't forget to commit)
259 (branch merge, don't forget to commit)
260 $ hg debugsub
260 $ hg debugsub
261 path s
261 path s
262 source s
262 source s
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
264 path t
264 path t
265 source t
265 source t
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
267 $ hg ci -m9
267 $ hg ci -m9
268 created new head
268 created new head
269 $ hg merge 6 --debug # test change
269 $ hg merge 6 --debug # test change
270 searching for copies back to rev 2
270 searching for copies back to rev 2
271 resolving manifests
271 resolving manifests
272 branchmerge: True, force: False, partial: False
272 branchmerge: True, force: False, partial: False
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
274 starting 4 threads for background file closing (?)
274 starting 4 threads for background file closing (?)
275 .hgsubstate: versions differ -> m (premerge)
275 .hgsubstate: versions differ -> m (premerge)
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
278 getting subrepo t
278 getting subrepo t
279 resolving manifests
279 resolving manifests
280 branchmerge: False, force: False, partial: False
280 branchmerge: False, force: False, partial: False
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
282 t: remote is newer -> g
282 t: remote is newer -> g
283 getting t
283 getting t
284 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 (branch merge, don't forget to commit)
285 (branch merge, don't forget to commit)
286 $ hg debugsub
286 $ hg debugsub
287 path s
287 path s
288 source s
288 source s
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
290 path t
290 path t
291 source t
291 source t
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
293 $ echo conflict > t/t
293 $ echo conflict > t/t
294 $ hg ci -m10
294 $ hg ci -m10
295 committing subrepository t
295 committing subrepository t
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
297 searching for copies back to rev 2
297 searching for copies back to rev 2
298 resolving manifests
298 resolving manifests
299 branchmerge: True, force: False, partial: False
299 branchmerge: True, force: False, partial: False
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
301 starting 4 threads for background file closing (?)
301 starting 4 threads for background file closing (?)
302 .hgsubstate: versions differ -> m (premerge)
302 .hgsubstate: versions differ -> m (premerge)
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
304 subrepo t: both sides changed
304 subrepo t: both sides changed
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
306 starting 4 threads for background file closing (?)
306 starting 4 threads for background file closing (?)
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
308 merging subrepository "t"
308 merging subrepository "t"
309 searching for copies back to rev 2
309 searching for copies back to rev 2
310 resolving manifests
310 resolving manifests
311 branchmerge: True, force: False, partial: False
311 branchmerge: True, force: False, partial: False
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
313 preserving t for resolve of t
313 preserving t for resolve of t
314 starting 4 threads for background file closing (?)
314 starting 4 threads for background file closing (?)
315 t: versions differ -> m (premerge)
315 t: versions differ -> m (premerge)
316 picked tool ':merge' for t (binary False symlink False changedelete False)
316 picked tool ':merge' for t (binary False symlink False changedelete False)
317 merging t
317 merging t
318 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
318 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
319 t: versions differ -> m (merge)
319 t: versions differ -> m (merge)
320 picked tool ':merge' for t (binary False symlink False changedelete False)
320 picked tool ':merge' for t (binary False symlink False changedelete False)
321 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
321 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
322 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
322 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
323 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
323 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
324 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
324 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
325 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
325 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
326 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
327 (branch merge, don't forget to commit)
327 (branch merge, don't forget to commit)
328
328
329 should conflict
329 should conflict
330
330
331 $ cat t/t
331 $ cat t/t
332 <<<<<<< local: 20a0db6fbf6c - test: 10
332 <<<<<<< local: 20a0db6fbf6c - test: 10
333 conflict
333 conflict
334 =======
334 =======
335 t3
335 t3
336 >>>>>>> other: 7af322bc1198 - test: 7
336 >>>>>>> other: 7af322bc1198 - test: 7
337
337
338 11: remove subrepo t
338 11: remove subrepo t
339
339
340 $ hg co -C 5
340 $ hg co -C 5
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 $ hg revert -r 4 .hgsub # remove t
342 $ hg revert -r 4 .hgsub # remove t
343 $ hg ci -m11
343 $ hg ci -m11
344 created new head
344 created new head
345 $ hg debugsub
345 $ hg debugsub
346 path s
346 path s
347 source s
347 source s
348 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
348 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
349
349
350 local removed, remote changed, keep changed
350 local removed, remote changed, keep changed
351
351
352 $ hg merge 6
352 $ hg merge 6
353 remote [merge rev] changed subrepository t which local [working copy] removed
353 remote [merge rev] changed subrepository t which local [working copy] removed
354 use (c)hanged version or (d)elete? c
354 use (c)hanged version or (d)elete? c
355 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
356 (branch merge, don't forget to commit)
356 (branch merge, don't forget to commit)
357 BROKEN: should include subrepo t
357 BROKEN: should include subrepo t
358 $ hg debugsub
358 $ hg debugsub
359 path s
359 path s
360 source s
360 source s
361 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
361 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
362 $ cat .hgsubstate
362 $ cat .hgsubstate
363 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
363 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
364 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
364 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
365 $ hg ci -m 'local removed, remote changed, keep changed'
365 $ hg ci -m 'local removed, remote changed, keep changed'
366 BROKEN: should include subrepo t
366 BROKEN: should include subrepo t
367 $ hg debugsub
367 $ hg debugsub
368 path s
368 path s
369 source s
369 source s
370 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
370 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
371 BROKEN: should include subrepo t
371 BROKEN: should include subrepo t
372 $ cat .hgsubstate
372 $ cat .hgsubstate
373 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
373 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
374 $ cat t/t
374 $ cat t/t
375 t2
375 t2
376
376
377 local removed, remote changed, keep removed
377 local removed, remote changed, keep removed
378
378
379 $ hg co -C 11
379 $ hg co -C 11
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 $ hg merge --config ui.interactive=true 6 <<EOF
381 $ hg merge --config ui.interactive=true 6 <<EOF
382 > d
382 > d
383 > EOF
383 > EOF
384 remote [merge rev] changed subrepository t which local [working copy] removed
384 remote [merge rev] changed subrepository t which local [working copy] removed
385 use (c)hanged version or (d)elete? d
385 use (c)hanged version or (d)elete? d
386 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
387 (branch merge, don't forget to commit)
387 (branch merge, don't forget to commit)
388 $ hg debugsub
388 $ hg debugsub
389 path s
389 path s
390 source s
390 source s
391 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
391 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
392 $ cat .hgsubstate
392 $ cat .hgsubstate
393 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
393 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
394 $ hg ci -m 'local removed, remote changed, keep removed'
394 $ hg ci -m 'local removed, remote changed, keep removed'
395 created new head
395 created new head
396 $ hg debugsub
396 $ hg debugsub
397 path s
397 path s
398 source s
398 source s
399 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
399 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
400 $ cat .hgsubstate
400 $ cat .hgsubstate
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
402
402
403 local changed, remote removed, keep changed
403 local changed, remote removed, keep changed
404
404
405 $ hg co -C 6
405 $ hg co -C 6
406 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 $ hg merge 11
407 $ hg merge 11
408 local [working copy] changed subrepository t which remote [merge rev] removed
408 local [working copy] changed subrepository t which remote [merge rev] removed
409 use (c)hanged version or (d)elete? c
409 use (c)hanged version or (d)elete? c
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 (branch merge, don't forget to commit)
411 (branch merge, don't forget to commit)
412 BROKEN: should include subrepo t
412 BROKEN: should include subrepo t
413 $ hg debugsub
413 $ hg debugsub
414 path s
414 path s
415 source s
415 source s
416 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
416 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
417 BROKEN: should include subrepo t
417 BROKEN: should include subrepo t
418 $ cat .hgsubstate
418 $ cat .hgsubstate
419 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
419 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
420 $ hg ci -m 'local changed, remote removed, keep changed'
420 $ hg ci -m 'local changed, remote removed, keep changed'
421 created new head
421 created new head
422 BROKEN: should include subrepo t
422 BROKEN: should include subrepo t
423 $ hg debugsub
423 $ hg debugsub
424 path s
424 path s
425 source s
425 source s
426 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
426 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
427 BROKEN: should include subrepo t
427 BROKEN: should include subrepo t
428 $ cat .hgsubstate
428 $ cat .hgsubstate
429 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
429 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
430 $ cat t/t
430 $ cat t/t
431 t2
431 t2
432
432
433 local changed, remote removed, keep removed
433 local changed, remote removed, keep removed
434
434
435 $ hg co -C 6
435 $ hg co -C 6
436 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 $ hg merge --config ui.interactive=true 11 <<EOF
437 $ hg merge --config ui.interactive=true 11 <<EOF
438 > d
438 > d
439 > EOF
439 > EOF
440 local [working copy] changed subrepository t which remote [merge rev] removed
440 local [working copy] changed subrepository t which remote [merge rev] removed
441 use (c)hanged version or (d)elete? d
441 use (c)hanged version or (d)elete? d
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 (branch merge, don't forget to commit)
443 (branch merge, don't forget to commit)
444 $ hg debugsub
444 $ hg debugsub
445 path s
445 path s
446 source s
446 source s
447 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
447 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
448 $ cat .hgsubstate
448 $ cat .hgsubstate
449 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
449 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
450 $ hg ci -m 'local changed, remote removed, keep removed'
450 $ hg ci -m 'local changed, remote removed, keep removed'
451 created new head
451 created new head
452 $ hg debugsub
452 $ hg debugsub
453 path s
453 path s
454 source s
454 source s
455 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
455 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
456 $ cat .hgsubstate
456 $ cat .hgsubstate
457 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
457 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
458
458
459 clean up to avoid having to fix up the tests below
459 clean up to avoid having to fix up the tests below
460
460
461 $ hg co -C 10
461 $ hg co -C 10
462 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ cat >> $HGRCPATH <<EOF
463 $ cat >> $HGRCPATH <<EOF
464 > [extensions]
464 > [extensions]
465 > strip=
465 > strip=
466 > EOF
466 > EOF
467 $ hg strip -r 11:15
467 $ hg strip -r 11:15
468 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
468 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
469
469
470 clone
470 clone
471
471
472 $ cd ..
472 $ cd ..
473 $ hg clone t tc
473 $ hg clone t tc
474 updating to branch default
474 updating to branch default
475 cloning subrepo s from $TESTTMP/t/s
475 cloning subrepo s from $TESTTMP/t/s
476 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
476 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
477 cloning subrepo t from $TESTTMP/t/t
477 cloning subrepo t from $TESTTMP/t/t
478 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
479 $ cd tc
479 $ cd tc
480 $ hg debugsub
480 $ hg debugsub
481 path s
481 path s
482 source s
482 source s
483 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
483 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
484 path t
484 path t
485 source t
485 source t
486 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
486 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
487 $ cd ..
487 $ cd ..
488
488
489 clone with subrepo disabled (update should fail)
489 clone with subrepo disabled (update should fail)
490
490
491 $ hg clone t -U tc2 --config subrepos.allowed=false
491 $ hg clone t -U tc2 --config subrepos.allowed=false
492 $ hg update -R tc2 --config subrepos.allowed=false
492 $ hg update -R tc2 --config subrepos.allowed=false
493 abort: subrepos not enabled
493 abort: subrepos not enabled
494 (see 'hg help config.subrepos' for details)
494 (see 'hg help config.subrepos' for details)
495 [255]
495 [255]
496 $ ls tc2
496 $ ls tc2
497 a
497 a
498
498
499 $ hg clone t tc3 --config subrepos.allowed=false
499 $ hg clone t tc3 --config subrepos.allowed=false
500 updating to branch default
500 updating to branch default
501 abort: subrepos not enabled
501 abort: subrepos not enabled
502 (see 'hg help config.subrepos' for details)
502 (see 'hg help config.subrepos' for details)
503 [255]
503 [255]
504 $ ls tc3
504 $ ls tc3
505 a
505 a
506
506
507 And again with just the hg type disabled
507 And again with just the hg type disabled
508
508
509 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
509 $ hg clone t -U tc4 --config subrepos.hg:allowed=false
510 $ hg update -R tc4 --config subrepos.hg:allowed=false
510 $ hg update -R tc4 --config subrepos.hg:allowed=false
511 abort: hg subrepos not allowed
511 abort: hg subrepos not allowed
512 (see 'hg help config.subrepos' for details)
512 (see 'hg help config.subrepos' for details)
513 [255]
513 [255]
514 $ ls tc4
514 $ ls tc4
515 a
515 a
516
516
517 $ hg clone t tc5 --config subrepos.hg:allowed=false
517 $ hg clone t tc5 --config subrepos.hg:allowed=false
518 updating to branch default
518 updating to branch default
519 abort: hg subrepos not allowed
519 abort: hg subrepos not allowed
520 (see 'hg help config.subrepos' for details)
520 (see 'hg help config.subrepos' for details)
521 [255]
521 [255]
522 $ ls tc5
522 $ ls tc5
523 a
523 a
524
524
525 push
525 push
526
526
527 $ cd tc
527 $ cd tc
528 $ echo bah > t/t
528 $ echo bah > t/t
529 $ hg ci -m11
529 $ hg ci -m11
530 committing subrepository t
530 committing subrepository t
531 $ hg push
531 $ hg push
532 pushing to $TESTTMP/t (glob)
532 pushing to $TESTTMP/t (glob)
533 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
533 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
534 no changes made to subrepo s since last push to $TESTTMP/t/s
534 no changes made to subrepo s since last push to $TESTTMP/t/s
535 pushing subrepo t to $TESTTMP/t/t
535 pushing subrepo t to $TESTTMP/t/t
536 searching for changes
536 searching for changes
537 adding changesets
537 adding changesets
538 adding manifests
538 adding manifests
539 adding file changes
539 adding file changes
540 added 1 changesets with 1 changes to 1 files
540 added 1 changesets with 1 changes to 1 files
541 searching for changes
541 searching for changes
542 adding changesets
542 adding changesets
543 adding manifests
543 adding manifests
544 adding file changes
544 adding file changes
545 added 1 changesets with 1 changes to 1 files
545 added 1 changesets with 1 changes to 1 files
546
546
547 push -f
547 push -f
548
548
549 $ echo bah > s/a
549 $ echo bah > s/a
550 $ hg ci -m12
550 $ hg ci -m12
551 committing subrepository s
551 committing subrepository s
552 $ hg push
552 $ hg push
553 pushing to $TESTTMP/t (glob)
553 pushing to $TESTTMP/t (glob)
554 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
554 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
555 pushing subrepo s to $TESTTMP/t/s
555 pushing subrepo s to $TESTTMP/t/s
556 searching for changes
556 searching for changes
557 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
557 abort: push creates new remote head 12a213df6fa9! (in subrepository "s")
558 (merge or see 'hg help push' for details about pushing new heads)
558 (merge or see 'hg help push' for details about pushing new heads)
559 [255]
559 [255]
560 $ hg push -f
560 $ hg push -f
561 pushing to $TESTTMP/t (glob)
561 pushing to $TESTTMP/t (glob)
562 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
562 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
563 searching for changes
563 searching for changes
564 no changes found
564 no changes found
565 pushing subrepo s to $TESTTMP/t/s
565 pushing subrepo s to $TESTTMP/t/s
566 searching for changes
566 searching for changes
567 adding changesets
567 adding changesets
568 adding manifests
568 adding manifests
569 adding file changes
569 adding file changes
570 added 1 changesets with 1 changes to 1 files (+1 heads)
570 added 1 changesets with 1 changes to 1 files (+1 heads)
571 pushing subrepo t to $TESTTMP/t/t
571 pushing subrepo t to $TESTTMP/t/t
572 searching for changes
572 searching for changes
573 no changes found
573 no changes found
574 searching for changes
574 searching for changes
575 adding changesets
575 adding changesets
576 adding manifests
576 adding manifests
577 adding file changes
577 adding file changes
578 added 1 changesets with 1 changes to 1 files
578 added 1 changesets with 1 changes to 1 files
579
579
580 check that unmodified subrepos are not pushed
580 check that unmodified subrepos are not pushed
581
581
582 $ hg clone . ../tcc
582 $ hg clone . ../tcc
583 updating to branch default
583 updating to branch default
584 cloning subrepo s from $TESTTMP/tc/s
584 cloning subrepo s from $TESTTMP/tc/s
585 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
585 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
586 cloning subrepo t from $TESTTMP/tc/t
586 cloning subrepo t from $TESTTMP/tc/t
587 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
588
588
589 the subrepos on the new clone have nothing to push to its source
589 the subrepos on the new clone have nothing to push to its source
590
590
591 $ hg push -R ../tcc .
591 $ hg push -R ../tcc .
592 pushing to .
592 pushing to .
593 no changes made to subrepo s/ss since last push to s/ss (glob)
593 no changes made to subrepo s/ss since last push to s/ss (glob)
594 no changes made to subrepo s since last push to s
594 no changes made to subrepo s since last push to s
595 no changes made to subrepo t since last push to t
595 no changes made to subrepo t since last push to t
596 searching for changes
596 searching for changes
597 no changes found
597 no changes found
598 [1]
598 [1]
599
599
600 the subrepos on the source do not have a clean store versus the clone target
600 the subrepos on the source do not have a clean store versus the clone target
601 because they were never explicitly pushed to the source
601 because they were never explicitly pushed to the source
602
602
603 $ hg push ../tcc
603 $ hg push ../tcc
604 pushing to ../tcc
604 pushing to ../tcc
605 pushing subrepo s/ss to ../tcc/s/ss (glob)
605 pushing subrepo s/ss to ../tcc/s/ss (glob)
606 searching for changes
606 searching for changes
607 no changes found
607 no changes found
608 pushing subrepo s to ../tcc/s
608 pushing subrepo s to ../tcc/s
609 searching for changes
609 searching for changes
610 no changes found
610 no changes found
611 pushing subrepo t to ../tcc/t
611 pushing subrepo t to ../tcc/t
612 searching for changes
612 searching for changes
613 no changes found
613 no changes found
614 searching for changes
614 searching for changes
615 no changes found
615 no changes found
616 [1]
616 [1]
617
617
618 after push their stores become clean
618 after push their stores become clean
619
619
620 $ hg push ../tcc
620 $ hg push ../tcc
621 pushing to ../tcc
621 pushing to ../tcc
622 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
622 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
623 no changes made to subrepo s since last push to ../tcc/s
623 no changes made to subrepo s since last push to ../tcc/s
624 no changes made to subrepo t since last push to ../tcc/t
624 no changes made to subrepo t since last push to ../tcc/t
625 searching for changes
625 searching for changes
626 no changes found
626 no changes found
627 [1]
627 [1]
628
628
629 updating a subrepo to a different revision or changing
629 updating a subrepo to a different revision or changing
630 its working directory does not make its store dirty
630 its working directory does not make its store dirty
631
631
632 $ hg -R s update '.^'
632 $ hg -R s update '.^'
633 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
633 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
634 $ hg push
634 $ hg push
635 pushing to $TESTTMP/t (glob)
635 pushing to $TESTTMP/t (glob)
636 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
636 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
637 no changes made to subrepo s since last push to $TESTTMP/t/s
637 no changes made to subrepo s since last push to $TESTTMP/t/s
638 no changes made to subrepo t since last push to $TESTTMP/t/t
638 no changes made to subrepo t since last push to $TESTTMP/t/t
639 searching for changes
639 searching for changes
640 no changes found
640 no changes found
641 [1]
641 [1]
642 $ echo foo >> s/a
642 $ echo foo >> s/a
643 $ hg push
643 $ hg push
644 pushing to $TESTTMP/t (glob)
644 pushing to $TESTTMP/t (glob)
645 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
645 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
646 no changes made to subrepo s since last push to $TESTTMP/t/s
646 no changes made to subrepo s since last push to $TESTTMP/t/s
647 no changes made to subrepo t since last push to $TESTTMP/t/t
647 no changes made to subrepo t since last push to $TESTTMP/t/t
648 searching for changes
648 searching for changes
649 no changes found
649 no changes found
650 [1]
650 [1]
651 $ hg -R s update -C tip
651 $ hg -R s update -C tip
652 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
652 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
653
653
654 committing into a subrepo makes its store (but not its parent's store) dirty
654 committing into a subrepo makes its store (but not its parent's store) dirty
655
655
656 $ echo foo >> s/ss/a
656 $ echo foo >> s/ss/a
657 $ hg -R s/ss commit -m 'test dirty store detection'
657 $ hg -R s/ss commit -m 'test dirty store detection'
658
658
659 $ hg out -S -r `hg log -r tip -T "{node|short}"`
659 $ hg out -S -r `hg log -r tip -T "{node|short}"`
660 comparing with $TESTTMP/t (glob)
660 comparing with $TESTTMP/t (glob)
661 searching for changes
661 searching for changes
662 no changes found
662 no changes found
663 comparing with $TESTTMP/t/s
663 comparing with $TESTTMP/t/s
664 searching for changes
664 searching for changes
665 no changes found
665 no changes found
666 comparing with $TESTTMP/t/s/ss
666 comparing with $TESTTMP/t/s/ss
667 searching for changes
667 searching for changes
668 changeset: 1:79ea5566a333
668 changeset: 1:79ea5566a333
669 tag: tip
669 tag: tip
670 user: test
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: test dirty store detection
672 summary: test dirty store detection
673
673
674 comparing with $TESTTMP/t/t
674 comparing with $TESTTMP/t/t
675 searching for changes
675 searching for changes
676 no changes found
676 no changes found
677
677
678 $ hg push
678 $ hg push
679 pushing to $TESTTMP/t (glob)
679 pushing to $TESTTMP/t (glob)
680 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
680 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
681 searching for changes
681 searching for changes
682 adding changesets
682 adding changesets
683 adding manifests
683 adding manifests
684 adding file changes
684 adding file changes
685 added 1 changesets with 1 changes to 1 files
685 added 1 changesets with 1 changes to 1 files
686 no changes made to subrepo s since last push to $TESTTMP/t/s
686 no changes made to subrepo s since last push to $TESTTMP/t/s
687 no changes made to subrepo t since last push to $TESTTMP/t/t
687 no changes made to subrepo t since last push to $TESTTMP/t/t
688 searching for changes
688 searching for changes
689 no changes found
689 no changes found
690 [1]
690 [1]
691
691
692 a subrepo store may be clean versus one repo but not versus another
692 a subrepo store may be clean versus one repo but not versus another
693
693
694 $ hg push
694 $ hg push
695 pushing to $TESTTMP/t (glob)
695 pushing to $TESTTMP/t (glob)
696 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
696 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
697 no changes made to subrepo s since last push to $TESTTMP/t/s
697 no changes made to subrepo s since last push to $TESTTMP/t/s
698 no changes made to subrepo t since last push to $TESTTMP/t/t
698 no changes made to subrepo t since last push to $TESTTMP/t/t
699 searching for changes
699 searching for changes
700 no changes found
700 no changes found
701 [1]
701 [1]
702 $ hg push ../tcc
702 $ hg push ../tcc
703 pushing to ../tcc
703 pushing to ../tcc
704 pushing subrepo s/ss to ../tcc/s/ss (glob)
704 pushing subrepo s/ss to ../tcc/s/ss (glob)
705 searching for changes
705 searching for changes
706 adding changesets
706 adding changesets
707 adding manifests
707 adding manifests
708 adding file changes
708 adding file changes
709 added 1 changesets with 1 changes to 1 files
709 added 1 changesets with 1 changes to 1 files
710 no changes made to subrepo s since last push to ../tcc/s
710 no changes made to subrepo s since last push to ../tcc/s
711 no changes made to subrepo t since last push to ../tcc/t
711 no changes made to subrepo t since last push to ../tcc/t
712 searching for changes
712 searching for changes
713 no changes found
713 no changes found
714 [1]
714 [1]
715
715
716 update
716 update
717
717
718 $ cd ../t
718 $ cd ../t
719 $ hg up -C # discard our earlier merge
719 $ hg up -C # discard our earlier merge
720 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 updated to "c373c8102e68: 12"
721 updated to "c373c8102e68: 12"
722 2 other heads for branch "default"
722 2 other heads for branch "default"
723 $ echo blah > t/t
723 $ echo blah > t/t
724 $ hg ci -m13
724 $ hg ci -m13
725 committing subrepository t
725 committing subrepository t
726
726
727 backout calls revert internally with minimal opts, which should not raise
727 backout calls revert internally with minimal opts, which should not raise
728 KeyError
728 KeyError
729
729
730 $ hg backout ".^" --no-commit
730 $ hg backout ".^" --no-commit
731 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
731 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
732 changeset c373c8102e68 backed out, don't forget to commit.
732 changeset c373c8102e68 backed out, don't forget to commit.
733
733
734 $ hg up -C # discard changes
734 $ hg up -C # discard changes
735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
736 updated to "925c17564ef8: 13"
736 updated to "925c17564ef8: 13"
737 2 other heads for branch "default"
737 2 other heads for branch "default"
738
738
739 pull
739 pull
740
740
741 $ cd ../tc
741 $ cd ../tc
742 $ hg pull
742 $ hg pull
743 pulling from $TESTTMP/t (glob)
743 pulling from $TESTTMP/t (glob)
744 searching for changes
744 searching for changes
745 adding changesets
745 adding changesets
746 adding manifests
746 adding manifests
747 adding file changes
747 adding file changes
748 added 1 changesets with 1 changes to 1 files
748 added 1 changesets with 1 changes to 1 files
749 new changesets 925c17564ef8
749 new changesets 925c17564ef8
750 (run 'hg update' to get a working copy)
750 (run 'hg update' to get a working copy)
751
751
752 should pull t
752 should pull t
753
753
754 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
754 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
755 comparing with $TESTTMP/t (glob)
755 comparing with $TESTTMP/t (glob)
756 no changes found
756 no changes found
757 comparing with $TESTTMP/t/s
757 comparing with $TESTTMP/t/s
758 searching for changes
758 searching for changes
759 no changes found
759 no changes found
760 comparing with $TESTTMP/t/s/ss
760 comparing with $TESTTMP/t/s/ss
761 searching for changes
761 searching for changes
762 no changes found
762 no changes found
763 comparing with $TESTTMP/t/t
763 comparing with $TESTTMP/t/t
764 searching for changes
764 searching for changes
765 changeset: 5:52c0adc0515a
765 changeset: 5:52c0adc0515a
766 tag: tip
766 tag: tip
767 user: test
767 user: test
768 date: Thu Jan 01 00:00:00 1970 +0000
768 date: Thu Jan 01 00:00:00 1970 +0000
769 summary: 13
769 summary: 13
770
770
771
771
772 $ hg up
772 $ hg up
773 pulling subrepo t from $TESTTMP/t/t
773 pulling subrepo t from $TESTTMP/t/t
774 searching for changes
774 searching for changes
775 adding changesets
775 adding changesets
776 adding manifests
776 adding manifests
777 adding file changes
777 adding file changes
778 added 1 changesets with 1 changes to 1 files
778 added 1 changesets with 1 changes to 1 files
779 new changesets 52c0adc0515a
779 new changesets 52c0adc0515a
780 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
780 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
781 updated to "925c17564ef8: 13"
781 updated to "925c17564ef8: 13"
782 2 other heads for branch "default"
782 2 other heads for branch "default"
783 $ cat t/t
783 $ cat t/t
784 blah
784 blah
785
785
786 bogus subrepo path aborts
786 bogus subrepo path aborts
787
787
788 $ echo 'bogus=[boguspath' >> .hgsub
788 $ echo 'bogus=[boguspath' >> .hgsub
789 $ hg ci -m 'bogus subrepo path'
789 $ hg ci -m 'bogus subrepo path'
790 abort: missing ] in subrepository source
790 abort: missing ] in subrepository source
791 [255]
791 [255]
792
792
793 Issue1986: merge aborts when trying to merge a subrepo that
793 Issue1986: merge aborts when trying to merge a subrepo that
794 shouldn't need merging
794 shouldn't need merging
795
795
796 # subrepo layout
796 # subrepo layout
797 #
797 #
798 # o 5 br
798 # o 5 br
799 # /|
799 # /|
800 # o | 4 default
800 # o | 4 default
801 # | |
801 # | |
802 # | o 3 br
802 # | o 3 br
803 # |/|
803 # |/|
804 # o | 2 default
804 # o | 2 default
805 # | |
805 # | |
806 # | o 1 br
806 # | o 1 br
807 # |/
807 # |/
808 # o 0 default
808 # o 0 default
809
809
810 $ cd ..
810 $ cd ..
811 $ rm -rf sub
811 $ rm -rf sub
812 $ hg init main
812 $ hg init main
813 $ cd main
813 $ cd main
814 $ hg init s
814 $ hg init s
815 $ cd s
815 $ cd s
816 $ echo a > a
816 $ echo a > a
817 $ hg ci -Am1
817 $ hg ci -Am1
818 adding a
818 adding a
819 $ hg branch br
819 $ hg branch br
820 marked working directory as branch br
820 marked working directory as branch br
821 (branches are permanent and global, did you want a bookmark?)
821 (branches are permanent and global, did you want a bookmark?)
822 $ echo a >> a
822 $ echo a >> a
823 $ hg ci -m1
823 $ hg ci -m1
824 $ hg up default
824 $ hg up default
825 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
825 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
826 $ echo b > b
826 $ echo b > b
827 $ hg ci -Am1
827 $ hg ci -Am1
828 adding b
828 adding b
829 $ hg up br
829 $ hg up br
830 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
830 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
831 $ hg merge tip
831 $ hg merge tip
832 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 (branch merge, don't forget to commit)
833 (branch merge, don't forget to commit)
834 $ hg ci -m1
834 $ hg ci -m1
835 $ hg up 2
835 $ hg up 2
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
837 $ echo c > c
837 $ echo c > c
838 $ hg ci -Am1
838 $ hg ci -Am1
839 adding c
839 adding c
840 $ hg up 3
840 $ hg up 3
841 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
841 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
842 $ hg merge 4
842 $ hg merge 4
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 (branch merge, don't forget to commit)
844 (branch merge, don't forget to commit)
845 $ hg ci -m1
845 $ hg ci -m1
846
846
847 # main repo layout:
847 # main repo layout:
848 #
848 #
849 # * <-- try to merge default into br again
849 # * <-- try to merge default into br again
850 # .`|
850 # .`|
851 # . o 5 br --> substate = 5
851 # . o 5 br --> substate = 5
852 # . |
852 # . |
853 # o | 4 default --> substate = 4
853 # o | 4 default --> substate = 4
854 # | |
854 # | |
855 # | o 3 br --> substate = 2
855 # | o 3 br --> substate = 2
856 # |/|
856 # |/|
857 # o | 2 default --> substate = 2
857 # o | 2 default --> substate = 2
858 # | |
858 # | |
859 # | o 1 br --> substate = 3
859 # | o 1 br --> substate = 3
860 # |/
860 # |/
861 # o 0 default --> substate = 2
861 # o 0 default --> substate = 2
862
862
863 $ cd ..
863 $ cd ..
864 $ echo 's = s' > .hgsub
864 $ echo 's = s' > .hgsub
865 $ hg -R s up 2
865 $ hg -R s up 2
866 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
866 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
867 $ hg ci -Am1
867 $ hg ci -Am1
868 adding .hgsub
868 adding .hgsub
869 $ hg branch br
869 $ hg branch br
870 marked working directory as branch br
870 marked working directory as branch br
871 (branches are permanent and global, did you want a bookmark?)
871 (branches are permanent and global, did you want a bookmark?)
872 $ echo b > b
872 $ echo b > b
873 $ hg -R s up 3
873 $ hg -R s up 3
874 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
874 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
875 $ hg ci -Am1
875 $ hg ci -Am1
876 adding b
876 adding b
877 $ hg up default
877 $ hg up default
878 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
878 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
879 $ echo c > c
879 $ echo c > c
880 $ hg ci -Am1
880 $ hg ci -Am1
881 adding c
881 adding c
882 $ hg up 1
882 $ hg up 1
883 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
883 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
884 $ hg merge 2
884 $ hg merge 2
885 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
885 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
886 (branch merge, don't forget to commit)
886 (branch merge, don't forget to commit)
887 $ hg ci -m1
887 $ hg ci -m1
888 $ hg up 2
888 $ hg up 2
889 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
889 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
890 $ hg -R s up 4
890 $ hg -R s up 4
891 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
891 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
892 $ echo d > d
892 $ echo d > d
893 $ hg ci -Am1
893 $ hg ci -Am1
894 adding d
894 adding d
895 $ hg up 3
895 $ hg up 3
896 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
896 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
897 $ hg -R s up 5
897 $ hg -R s up 5
898 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 $ echo e > e
899 $ echo e > e
900 $ hg ci -Am1
900 $ hg ci -Am1
901 adding e
901 adding e
902
902
903 $ hg up 5
903 $ hg up 5
904 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
904 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 $ hg merge 4 # try to merge default into br again
905 $ hg merge 4 # try to merge default into br again
906 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
906 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
907 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
907 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 (branch merge, don't forget to commit)
909 (branch merge, don't forget to commit)
910 $ cd ..
910 $ cd ..
911
911
912 test subrepo delete from .hgsubstate
912 test subrepo delete from .hgsubstate
913
913
914 $ hg init testdelete
914 $ hg init testdelete
915 $ mkdir testdelete/nested testdelete/nested2
915 $ mkdir testdelete/nested testdelete/nested2
916 $ hg init testdelete/nested
916 $ hg init testdelete/nested
917 $ hg init testdelete/nested2
917 $ hg init testdelete/nested2
918 $ echo test > testdelete/nested/foo
918 $ echo test > testdelete/nested/foo
919 $ echo test > testdelete/nested2/foo
919 $ echo test > testdelete/nested2/foo
920 $ hg -R testdelete/nested add
920 $ hg -R testdelete/nested add
921 adding testdelete/nested/foo (glob)
921 adding testdelete/nested/foo (glob)
922 $ hg -R testdelete/nested2 add
922 $ hg -R testdelete/nested2 add
923 adding testdelete/nested2/foo (glob)
923 adding testdelete/nested2/foo (glob)
924 $ hg -R testdelete/nested ci -m test
924 $ hg -R testdelete/nested ci -m test
925 $ hg -R testdelete/nested2 ci -m test
925 $ hg -R testdelete/nested2 ci -m test
926 $ echo nested = nested > testdelete/.hgsub
926 $ echo nested = nested > testdelete/.hgsub
927 $ echo nested2 = nested2 >> testdelete/.hgsub
927 $ echo nested2 = nested2 >> testdelete/.hgsub
928 $ hg -R testdelete add
928 $ hg -R testdelete add
929 adding testdelete/.hgsub (glob)
929 adding testdelete/.hgsub (glob)
930 $ hg -R testdelete ci -m "nested 1 & 2 added"
930 $ hg -R testdelete ci -m "nested 1 & 2 added"
931 $ echo nested = nested > testdelete/.hgsub
931 $ echo nested = nested > testdelete/.hgsub
932 $ hg -R testdelete ci -m "nested 2 deleted"
932 $ hg -R testdelete ci -m "nested 2 deleted"
933 $ cat testdelete/.hgsubstate
933 $ cat testdelete/.hgsubstate
934 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
934 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
935 $ hg -R testdelete remove testdelete/.hgsub
935 $ hg -R testdelete remove testdelete/.hgsub
936 $ hg -R testdelete ci -m ".hgsub deleted"
936 $ hg -R testdelete ci -m ".hgsub deleted"
937 $ cat testdelete/.hgsubstate
937 $ cat testdelete/.hgsubstate
938 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
938 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
939
939
940 test repository cloning
940 test repository cloning
941
941
942 $ mkdir mercurial mercurial2
942 $ mkdir mercurial mercurial2
943 $ hg init nested_absolute
943 $ hg init nested_absolute
944 $ echo test > nested_absolute/foo
944 $ echo test > nested_absolute/foo
945 $ hg -R nested_absolute add
945 $ hg -R nested_absolute add
946 adding nested_absolute/foo (glob)
946 adding nested_absolute/foo (glob)
947 $ hg -R nested_absolute ci -mtest
947 $ hg -R nested_absolute ci -mtest
948 $ cd mercurial
948 $ cd mercurial
949 $ hg init nested_relative
949 $ hg init nested_relative
950 $ echo test2 > nested_relative/foo2
950 $ echo test2 > nested_relative/foo2
951 $ hg -R nested_relative add
951 $ hg -R nested_relative add
952 adding nested_relative/foo2 (glob)
952 adding nested_relative/foo2 (glob)
953 $ hg -R nested_relative ci -mtest2
953 $ hg -R nested_relative ci -mtest2
954 $ hg init main
954 $ hg init main
955 $ echo "nested_relative = ../nested_relative" > main/.hgsub
955 $ echo "nested_relative = ../nested_relative" > main/.hgsub
956 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
956 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
957 $ hg -R main add
957 $ hg -R main add
958 adding main/.hgsub (glob)
958 adding main/.hgsub (glob)
959 $ hg -R main ci -m "add subrepos"
959 $ hg -R main ci -m "add subrepos"
960 $ cd ..
960 $ cd ..
961 $ hg clone mercurial/main mercurial2/main
961 $ hg clone mercurial/main mercurial2/main
962 updating to branch default
962 updating to branch default
963 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
963 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
964 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
964 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
965 > mercurial2/main/nested_relative/.hg/hgrc
965 > mercurial2/main/nested_relative/.hg/hgrc
966 [paths]
966 [paths]
967 default = $TESTTMP/mercurial/nested_absolute
967 default = $TESTTMP/mercurial/nested_absolute
968 [paths]
968 [paths]
969 default = $TESTTMP/mercurial/nested_relative
969 default = $TESTTMP/mercurial/nested_relative
970 $ rm -rf mercurial mercurial2
970 $ rm -rf mercurial mercurial2
971
971
972 Issue1977: multirepo push should fail if subrepo push fails
972 Issue1977: multirepo push should fail if subrepo push fails
973
973
974 $ hg init repo
974 $ hg init repo
975 $ hg init repo/s
975 $ hg init repo/s
976 $ echo a > repo/s/a
976 $ echo a > repo/s/a
977 $ hg -R repo/s ci -Am0
977 $ hg -R repo/s ci -Am0
978 adding a
978 adding a
979 $ echo s = s > repo/.hgsub
979 $ echo s = s > repo/.hgsub
980 $ hg -R repo ci -Am1
980 $ hg -R repo ci -Am1
981 adding .hgsub
981 adding .hgsub
982 $ hg clone repo repo2
982 $ hg clone repo repo2
983 updating to branch default
983 updating to branch default
984 cloning subrepo s from $TESTTMP/repo/s
984 cloning subrepo s from $TESTTMP/repo/s
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
986 $ hg -q -R repo2 pull -u
986 $ hg -q -R repo2 pull -u
987 $ echo 1 > repo2/s/a
987 $ echo 1 > repo2/s/a
988 $ hg -R repo2/s ci -m2
988 $ hg -R repo2/s ci -m2
989 $ hg -q -R repo2/s push
989 $ hg -q -R repo2/s push
990 $ hg -R repo2/s up -C 0
990 $ hg -R repo2/s up -C 0
991 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
991 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
992 $ echo 2 > repo2/s/b
992 $ echo 2 > repo2/s/b
993 $ hg -R repo2/s ci -m3 -A
993 $ hg -R repo2/s ci -m3 -A
994 adding b
994 adding b
995 created new head
995 created new head
996 $ hg -R repo2 ci -m3
996 $ hg -R repo2 ci -m3
997 $ hg -q -R repo2 push
997 $ hg -q -R repo2 push
998 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
998 abort: push creates new remote head cc505f09a8b2! (in subrepository "s")
999 (merge or see 'hg help push' for details about pushing new heads)
999 (merge or see 'hg help push' for details about pushing new heads)
1000 [255]
1000 [255]
1001 $ hg -R repo update
1001 $ hg -R repo update
1002 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1002 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003
1003
1004 test if untracked file is not overwritten
1004 test if untracked file is not overwritten
1005
1005
1006 (this also tests that updated .hgsubstate is treated as "modified",
1006 (this also tests that updated .hgsubstate is treated as "modified",
1007 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1007 when 'merge.update()' is aborted before 'merge.recordupdates()', even
1008 if none of mode, size and timestamp of it isn't changed on the
1008 if none of mode, size and timestamp of it isn't changed on the
1009 filesystem (see also issue4583))
1009 filesystem (see also issue4583))
1010
1010
1011 $ echo issue3276_ok > repo/s/b
1011 $ echo issue3276_ok > repo/s/b
1012 $ hg -R repo2 push -f -q
1012 $ hg -R repo2 push -f -q
1013 $ touch -t 200001010000 repo/.hgsubstate
1013 $ touch -t 200001010000 repo/.hgsubstate
1014
1014
1015 $ cat >> repo/.hg/hgrc <<EOF
1015 $ cat >> repo/.hg/hgrc <<EOF
1016 > [fakedirstatewritetime]
1016 > [fakedirstatewritetime]
1017 > # emulate invoking dirstate.write() via repo.status()
1017 > # emulate invoking dirstate.write() via repo.status()
1018 > # at 2000-01-01 00:00
1018 > # at 2000-01-01 00:00
1019 > fakenow = 200001010000
1019 > fakenow = 200001010000
1020 >
1020 >
1021 > [extensions]
1021 > [extensions]
1022 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1022 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
1023 > EOF
1023 > EOF
1024 $ hg -R repo update
1024 $ hg -R repo update
1025 b: untracked file differs
1025 b: untracked file differs
1026 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1026 abort: untracked files in working directory differ from files in requested revision (in subrepository "s")
1027 [255]
1027 [255]
1028 $ cat >> repo/.hg/hgrc <<EOF
1028 $ cat >> repo/.hg/hgrc <<EOF
1029 > [extensions]
1029 > [extensions]
1030 > fakedirstatewritetime = !
1030 > fakedirstatewritetime = !
1031 > EOF
1031 > EOF
1032
1032
1033 $ cat repo/s/b
1033 $ cat repo/s/b
1034 issue3276_ok
1034 issue3276_ok
1035 $ rm repo/s/b
1035 $ rm repo/s/b
1036 $ touch -t 200001010000 repo/.hgsubstate
1036 $ touch -t 200001010000 repo/.hgsubstate
1037 $ hg -R repo revert --all
1037 $ hg -R repo revert --all
1038 reverting repo/.hgsubstate (glob)
1038 reverting repo/.hgsubstate (glob)
1039 reverting subrepo s
1039 reverting subrepo s
1040 $ hg -R repo update
1040 $ hg -R repo update
1041 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1041 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1042 $ cat repo/s/b
1042 $ cat repo/s/b
1043 2
1043 2
1044 $ rm -rf repo2 repo
1044 $ rm -rf repo2 repo
1045
1045
1046
1046
1047 Issue1852 subrepos with relative paths always push/pull relative to default
1047 Issue1852 subrepos with relative paths always push/pull relative to default
1048
1048
1049 Prepare a repo with subrepo
1049 Prepare a repo with subrepo
1050
1050
1051 $ hg init issue1852a
1051 $ hg init issue1852a
1052 $ cd issue1852a
1052 $ cd issue1852a
1053 $ hg init sub/repo
1053 $ hg init sub/repo
1054 $ echo test > sub/repo/foo
1054 $ echo test > sub/repo/foo
1055 $ hg -R sub/repo add sub/repo/foo
1055 $ hg -R sub/repo add sub/repo/foo
1056 $ echo sub/repo = sub/repo > .hgsub
1056 $ echo sub/repo = sub/repo > .hgsub
1057 $ hg add .hgsub
1057 $ hg add .hgsub
1058 $ hg ci -mtest
1058 $ hg ci -mtest
1059 committing subrepository sub/repo (glob)
1059 committing subrepository sub/repo (glob)
1060 $ echo test >> sub/repo/foo
1060 $ echo test >> sub/repo/foo
1061 $ hg ci -mtest
1061 $ hg ci -mtest
1062 committing subrepository sub/repo (glob)
1062 committing subrepository sub/repo (glob)
1063 $ hg cat sub/repo/foo
1063 $ hg cat sub/repo/foo
1064 test
1064 test
1065 test
1065 test
1066 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1066 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1067 [
1067 [
1068 {
1068 {
1069 "abspath": "foo",
1069 "abspath": "foo",
1070 "data": "test\ntest\n",
1070 "data": "test\ntest\n",
1071 "path": "sub/repo/foo"
1071 "path": "sub/repo/foo"
1072 }
1072 }
1073 ]
1073 ]
1074
1075 non-exact match:
1076
1077 $ hg cat -T '{path}\n' 'glob:**'
1078 .hgsub
1079 .hgsubstate
1080 sub/repo/foo (glob)
1081 $ hg cat -T '{path}\n' 're:^sub'
1082 sub/repo/foo (glob)
1083
1084 missing subrepos in working directory:
1085
1074 $ mkdir -p tmp/sub/repo
1086 $ mkdir -p tmp/sub/repo
1075 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1087 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1076 $ cat tmp/sub/repo/foo_p
1088 $ cat tmp/sub/repo/foo_p
1077 test
1089 test
1078 $ mv sub/repo sub_
1090 $ mv sub/repo sub_
1079 $ hg cat sub/repo/baz
1091 $ hg cat sub/repo/baz
1080 skipping missing subrepository: sub/repo
1092 skipping missing subrepository: sub/repo
1081 [1]
1093 [1]
1082 $ rm -rf sub/repo
1094 $ rm -rf sub/repo
1083 $ mv sub_ sub/repo
1095 $ mv sub_ sub/repo
1084 $ cd ..
1096 $ cd ..
1085
1097
1086 Create repo without default path, pull top repo, and see what happens on update
1098 Create repo without default path, pull top repo, and see what happens on update
1087
1099
1088 $ hg init issue1852b
1100 $ hg init issue1852b
1089 $ hg -R issue1852b pull issue1852a
1101 $ hg -R issue1852b pull issue1852a
1090 pulling from issue1852a
1102 pulling from issue1852a
1091 requesting all changes
1103 requesting all changes
1092 adding changesets
1104 adding changesets
1093 adding manifests
1105 adding manifests
1094 adding file changes
1106 adding file changes
1095 added 2 changesets with 3 changes to 2 files
1107 added 2 changesets with 3 changes to 2 files
1096 new changesets 19487b456929:be5eb94e7215
1108 new changesets 19487b456929:be5eb94e7215
1097 (run 'hg update' to get a working copy)
1109 (run 'hg update' to get a working copy)
1098 $ hg -R issue1852b update
1110 $ hg -R issue1852b update
1099 abort: default path for subrepository not found (in subrepository "sub/repo") (glob)
1111 abort: default path for subrepository not found (in subrepository "sub/repo") (glob)
1100 [255]
1112 [255]
1101
1113
1102 Ensure a full traceback, not just the SubrepoAbort part
1114 Ensure a full traceback, not just the SubrepoAbort part
1103
1115
1104 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1116 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1105 raise error.Abort(_("default path for subrepository not found"))
1117 raise error.Abort(_("default path for subrepository not found"))
1106
1118
1107 Pull -u now doesn't help
1119 Pull -u now doesn't help
1108
1120
1109 $ hg -R issue1852b pull -u issue1852a
1121 $ hg -R issue1852b pull -u issue1852a
1110 pulling from issue1852a
1122 pulling from issue1852a
1111 searching for changes
1123 searching for changes
1112 no changes found
1124 no changes found
1113
1125
1114 Try the same, but with pull -u
1126 Try the same, but with pull -u
1115
1127
1116 $ hg init issue1852c
1128 $ hg init issue1852c
1117 $ hg -R issue1852c pull -r0 -u issue1852a
1129 $ hg -R issue1852c pull -r0 -u issue1852a
1118 pulling from issue1852a
1130 pulling from issue1852a
1119 adding changesets
1131 adding changesets
1120 adding manifests
1132 adding manifests
1121 adding file changes
1133 adding file changes
1122 added 1 changesets with 2 changes to 2 files
1134 added 1 changesets with 2 changes to 2 files
1123 new changesets 19487b456929
1135 new changesets 19487b456929
1124 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1136 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1125 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1137 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1126
1138
1127 Try to push from the other side
1139 Try to push from the other side
1128
1140
1129 $ hg -R issue1852a push `pwd`/issue1852c
1141 $ hg -R issue1852a push `pwd`/issue1852c
1130 pushing to $TESTTMP/issue1852c (glob)
1142 pushing to $TESTTMP/issue1852c (glob)
1131 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1143 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1132 searching for changes
1144 searching for changes
1133 no changes found
1145 no changes found
1134 searching for changes
1146 searching for changes
1135 adding changesets
1147 adding changesets
1136 adding manifests
1148 adding manifests
1137 adding file changes
1149 adding file changes
1138 added 1 changesets with 1 changes to 1 files
1150 added 1 changesets with 1 changes to 1 files
1139
1151
1140 Incoming and outgoing should not use the default path:
1152 Incoming and outgoing should not use the default path:
1141
1153
1142 $ hg clone -q issue1852a issue1852d
1154 $ hg clone -q issue1852a issue1852d
1143 $ hg -R issue1852d outgoing --subrepos issue1852c
1155 $ hg -R issue1852d outgoing --subrepos issue1852c
1144 comparing with issue1852c
1156 comparing with issue1852c
1145 searching for changes
1157 searching for changes
1146 no changes found
1158 no changes found
1147 comparing with issue1852c/sub/repo
1159 comparing with issue1852c/sub/repo
1148 searching for changes
1160 searching for changes
1149 no changes found
1161 no changes found
1150 [1]
1162 [1]
1151 $ hg -R issue1852d incoming --subrepos issue1852c
1163 $ hg -R issue1852d incoming --subrepos issue1852c
1152 comparing with issue1852c
1164 comparing with issue1852c
1153 searching for changes
1165 searching for changes
1154 no changes found
1166 no changes found
1155 comparing with issue1852c/sub/repo
1167 comparing with issue1852c/sub/repo
1156 searching for changes
1168 searching for changes
1157 no changes found
1169 no changes found
1158 [1]
1170 [1]
1159
1171
1160 Check that merge of a new subrepo doesn't write the uncommitted state to
1172 Check that merge of a new subrepo doesn't write the uncommitted state to
1161 .hgsubstate (issue4622)
1173 .hgsubstate (issue4622)
1162
1174
1163 $ hg init issue1852a/addedsub
1175 $ hg init issue1852a/addedsub
1164 $ echo zzz > issue1852a/addedsub/zz.txt
1176 $ echo zzz > issue1852a/addedsub/zz.txt
1165 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1177 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1166
1178
1167 $ hg clone issue1852a/addedsub issue1852d/addedsub
1179 $ hg clone issue1852a/addedsub issue1852d/addedsub
1168 updating to branch default
1180 updating to branch default
1169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1170
1182
1171 $ echo def > issue1852a/sub/repo/foo
1183 $ echo def > issue1852a/sub/repo/foo
1172 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1184 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1173 adding tmp/sub/repo/foo_p
1185 adding tmp/sub/repo/foo_p
1174 committing subrepository sub/repo (glob)
1186 committing subrepository sub/repo (glob)
1175
1187
1176 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1188 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1177 $ echo xyz > issue1852d/sub/repo/foo
1189 $ echo xyz > issue1852d/sub/repo/foo
1178 $ hg -R issue1852d pull -u
1190 $ hg -R issue1852d pull -u
1179 pulling from $TESTTMP/issue1852a (glob)
1191 pulling from $TESTTMP/issue1852a (glob)
1180 searching for changes
1192 searching for changes
1181 adding changesets
1193 adding changesets
1182 adding manifests
1194 adding manifests
1183 adding file changes
1195 adding file changes
1184 added 1 changesets with 2 changes to 2 files
1196 added 1 changesets with 2 changes to 2 files
1185 new changesets c82b79fdcc5b
1197 new changesets c82b79fdcc5b
1186 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1198 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1187 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1199 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1188 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1200 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1189 searching for changes
1201 searching for changes
1190 adding changesets
1202 adding changesets
1191 adding manifests
1203 adding manifests
1192 adding file changes
1204 adding file changes
1193 added 1 changesets with 1 changes to 1 files
1205 added 1 changesets with 1 changes to 1 files
1194 new changesets 46cd4aac504c
1206 new changesets 46cd4aac504c
1195 subrepository sources for sub/repo differ (glob)
1207 subrepository sources for sub/repo differ (glob)
1196 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1208 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1197 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1198 $ cat issue1852d/.hgsubstate
1210 $ cat issue1852d/.hgsubstate
1199 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1211 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1200
1212
1201 Check status of files when none of them belong to the first
1213 Check status of files when none of them belong to the first
1202 subrepository:
1214 subrepository:
1203
1215
1204 $ hg init subrepo-status
1216 $ hg init subrepo-status
1205 $ cd subrepo-status
1217 $ cd subrepo-status
1206 $ hg init subrepo-1
1218 $ hg init subrepo-1
1207 $ hg init subrepo-2
1219 $ hg init subrepo-2
1208 $ cd subrepo-2
1220 $ cd subrepo-2
1209 $ touch file
1221 $ touch file
1210 $ hg add file
1222 $ hg add file
1211 $ cd ..
1223 $ cd ..
1212 $ echo subrepo-1 = subrepo-1 > .hgsub
1224 $ echo subrepo-1 = subrepo-1 > .hgsub
1213 $ echo subrepo-2 = subrepo-2 >> .hgsub
1225 $ echo subrepo-2 = subrepo-2 >> .hgsub
1214 $ hg add .hgsub
1226 $ hg add .hgsub
1215 $ hg ci -m 'Added subrepos'
1227 $ hg ci -m 'Added subrepos'
1216 committing subrepository subrepo-2
1228 committing subrepository subrepo-2
1217 $ hg st subrepo-2/file
1229 $ hg st subrepo-2/file
1218
1230
1219 Check that share works with subrepo
1231 Check that share works with subrepo
1220 $ hg --config extensions.share= share . ../shared
1232 $ hg --config extensions.share= share . ../shared
1221 updating working directory
1233 updating working directory
1222 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1234 sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1
1223 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1235 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1224 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1225 $ find ../shared/* | sort
1237 $ find ../shared/* | sort
1226 ../shared/subrepo-1
1238 ../shared/subrepo-1
1227 ../shared/subrepo-1/.hg
1239 ../shared/subrepo-1/.hg
1228 ../shared/subrepo-1/.hg/cache
1240 ../shared/subrepo-1/.hg/cache
1229 ../shared/subrepo-1/.hg/cache/storehash
1241 ../shared/subrepo-1/.hg/cache/storehash
1230 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1242 ../shared/subrepo-1/.hg/cache/storehash/* (glob)
1231 ../shared/subrepo-1/.hg/hgrc
1243 ../shared/subrepo-1/.hg/hgrc
1232 ../shared/subrepo-1/.hg/requires
1244 ../shared/subrepo-1/.hg/requires
1233 ../shared/subrepo-1/.hg/sharedpath
1245 ../shared/subrepo-1/.hg/sharedpath
1234 ../shared/subrepo-2
1246 ../shared/subrepo-2
1235 ../shared/subrepo-2/.hg
1247 ../shared/subrepo-2/.hg
1236 ../shared/subrepo-2/.hg/branch
1248 ../shared/subrepo-2/.hg/branch
1237 ../shared/subrepo-2/.hg/cache
1249 ../shared/subrepo-2/.hg/cache
1238 ../shared/subrepo-2/.hg/cache/checkisexec (execbit !)
1250 ../shared/subrepo-2/.hg/cache/checkisexec (execbit !)
1239 ../shared/subrepo-2/.hg/cache/checklink (symlink !)
1251 ../shared/subrepo-2/.hg/cache/checklink (symlink !)
1240 ../shared/subrepo-2/.hg/cache/checklink-target (symlink !)
1252 ../shared/subrepo-2/.hg/cache/checklink-target (symlink !)
1241 ../shared/subrepo-2/.hg/cache/storehash
1253 ../shared/subrepo-2/.hg/cache/storehash
1242 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1254 ../shared/subrepo-2/.hg/cache/storehash/* (glob)
1243 ../shared/subrepo-2/.hg/dirstate
1255 ../shared/subrepo-2/.hg/dirstate
1244 ../shared/subrepo-2/.hg/hgrc
1256 ../shared/subrepo-2/.hg/hgrc
1245 ../shared/subrepo-2/.hg/requires
1257 ../shared/subrepo-2/.hg/requires
1246 ../shared/subrepo-2/.hg/sharedpath
1258 ../shared/subrepo-2/.hg/sharedpath
1247 ../shared/subrepo-2/file
1259 ../shared/subrepo-2/file
1248 $ hg -R ../shared in
1260 $ hg -R ../shared in
1249 abort: repository default not found!
1261 abort: repository default not found!
1250 [255]
1262 [255]
1251 $ hg -R ../shared/subrepo-2 showconfig paths
1263 $ hg -R ../shared/subrepo-2 showconfig paths
1252 paths.default=$TESTTMP/subrepo-status/subrepo-2
1264 paths.default=$TESTTMP/subrepo-status/subrepo-2
1253 $ hg -R ../shared/subrepo-1 sum --remote
1265 $ hg -R ../shared/subrepo-1 sum --remote
1254 parent: -1:000000000000 tip (empty repository)
1266 parent: -1:000000000000 tip (empty repository)
1255 branch: default
1267 branch: default
1256 commit: (clean)
1268 commit: (clean)
1257 update: (current)
1269 update: (current)
1258 remote: (synced)
1270 remote: (synced)
1259
1271
1260 Check hg update --clean
1272 Check hg update --clean
1261 $ cd $TESTTMP/t
1273 $ cd $TESTTMP/t
1262 $ rm -r t/t.orig
1274 $ rm -r t/t.orig
1263 $ hg status -S --all
1275 $ hg status -S --all
1264 C .hgsub
1276 C .hgsub
1265 C .hgsubstate
1277 C .hgsubstate
1266 C a
1278 C a
1267 C s/.hgsub
1279 C s/.hgsub
1268 C s/.hgsubstate
1280 C s/.hgsubstate
1269 C s/a
1281 C s/a
1270 C s/ss/a
1282 C s/ss/a
1271 C t/t
1283 C t/t
1272 $ echo c1 > s/a
1284 $ echo c1 > s/a
1273 $ cd s
1285 $ cd s
1274 $ echo c1 > b
1286 $ echo c1 > b
1275 $ echo c1 > c
1287 $ echo c1 > c
1276 $ hg add b
1288 $ hg add b
1277 $ cd ..
1289 $ cd ..
1278 $ hg status -S
1290 $ hg status -S
1279 M s/a
1291 M s/a
1280 A s/b
1292 A s/b
1281 ? s/c
1293 ? s/c
1282 $ hg update -C
1294 $ hg update -C
1283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1284 updated to "925c17564ef8: 13"
1296 updated to "925c17564ef8: 13"
1285 2 other heads for branch "default"
1297 2 other heads for branch "default"
1286 $ hg status -S
1298 $ hg status -S
1287 ? s/b
1299 ? s/b
1288 ? s/c
1300 ? s/c
1289
1301
1290 Sticky subrepositories, no changes
1302 Sticky subrepositories, no changes
1291 $ cd $TESTTMP/t
1303 $ cd $TESTTMP/t
1292 $ hg id
1304 $ hg id
1293 925c17564ef8 tip
1305 925c17564ef8 tip
1294 $ hg -R s id
1306 $ hg -R s id
1295 12a213df6fa9 tip
1307 12a213df6fa9 tip
1296 $ hg -R t id
1308 $ hg -R t id
1297 52c0adc0515a tip
1309 52c0adc0515a tip
1298 $ hg update 11
1310 $ hg update 11
1299 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1311 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1300 $ hg id
1312 $ hg id
1301 365661e5936a
1313 365661e5936a
1302 $ hg -R s id
1314 $ hg -R s id
1303 fc627a69481f
1315 fc627a69481f
1304 $ hg -R t id
1316 $ hg -R t id
1305 e95bcfa18a35
1317 e95bcfa18a35
1306
1318
1307 Sticky subrepositories, file changes
1319 Sticky subrepositories, file changes
1308 $ touch s/f1
1320 $ touch s/f1
1309 $ touch t/f1
1321 $ touch t/f1
1310 $ hg add -S s/f1
1322 $ hg add -S s/f1
1311 $ hg add -S t/f1
1323 $ hg add -S t/f1
1312 $ hg id
1324 $ hg id
1313 365661e5936a+
1325 365661e5936a+
1314 $ hg -R s id
1326 $ hg -R s id
1315 fc627a69481f+
1327 fc627a69481f+
1316 $ hg -R t id
1328 $ hg -R t id
1317 e95bcfa18a35+
1329 e95bcfa18a35+
1318 $ hg update tip
1330 $ hg update tip
1319 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1331 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1320 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1332 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1321 subrepository sources for s differ
1333 subrepository sources for s differ
1322 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1334 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1323 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1335 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1324 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1336 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1325 subrepository sources for t differ
1337 subrepository sources for t differ
1326 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1338 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1327 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1339 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1328 $ hg id
1340 $ hg id
1329 925c17564ef8+ tip
1341 925c17564ef8+ tip
1330 $ hg -R s id
1342 $ hg -R s id
1331 fc627a69481f+
1343 fc627a69481f+
1332 $ hg -R t id
1344 $ hg -R t id
1333 e95bcfa18a35+
1345 e95bcfa18a35+
1334 $ hg update --clean tip
1346 $ hg update --clean tip
1335 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1347 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1336
1348
1337 Sticky subrepository, revision updates
1349 Sticky subrepository, revision updates
1338 $ hg id
1350 $ hg id
1339 925c17564ef8 tip
1351 925c17564ef8 tip
1340 $ hg -R s id
1352 $ hg -R s id
1341 12a213df6fa9 tip
1353 12a213df6fa9 tip
1342 $ hg -R t id
1354 $ hg -R t id
1343 52c0adc0515a tip
1355 52c0adc0515a tip
1344 $ cd s
1356 $ cd s
1345 $ hg update -r -2
1357 $ hg update -r -2
1346 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1358 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1347 $ cd ../t
1359 $ cd ../t
1348 $ hg update -r 2
1360 $ hg update -r 2
1349 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1361 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1350 $ cd ..
1362 $ cd ..
1351 $ hg update 10
1363 $ hg update 10
1352 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1364 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1353 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1365 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1354 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1366 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1355 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1367 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1356 subrepository sources for t differ (in checked out version)
1368 subrepository sources for t differ (in checked out version)
1357 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1369 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1358 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1370 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1359 $ hg id
1371 $ hg id
1360 e45c8b14af55+
1372 e45c8b14af55+
1361 $ hg -R s id
1373 $ hg -R s id
1362 02dcf1d70411
1374 02dcf1d70411
1363 $ hg -R t id
1375 $ hg -R t id
1364 7af322bc1198
1376 7af322bc1198
1365
1377
1366 Sticky subrepository, file changes and revision updates
1378 Sticky subrepository, file changes and revision updates
1367 $ touch s/f1
1379 $ touch s/f1
1368 $ touch t/f1
1380 $ touch t/f1
1369 $ hg add -S s/f1
1381 $ hg add -S s/f1
1370 $ hg add -S t/f1
1382 $ hg add -S t/f1
1371 $ hg id
1383 $ hg id
1372 e45c8b14af55+
1384 e45c8b14af55+
1373 $ hg -R s id
1385 $ hg -R s id
1374 02dcf1d70411+
1386 02dcf1d70411+
1375 $ hg -R t id
1387 $ hg -R t id
1376 7af322bc1198+
1388 7af322bc1198+
1377 $ hg update tip
1389 $ hg update tip
1378 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1390 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1379 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1391 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1380 subrepository sources for s differ
1392 subrepository sources for s differ
1381 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1393 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1382 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1394 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1383 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1395 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1384 subrepository sources for t differ
1396 subrepository sources for t differ
1385 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1397 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1386 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1398 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1387 $ hg id
1399 $ hg id
1388 925c17564ef8+ tip
1400 925c17564ef8+ tip
1389 $ hg -R s id
1401 $ hg -R s id
1390 02dcf1d70411+
1402 02dcf1d70411+
1391 $ hg -R t id
1403 $ hg -R t id
1392 7af322bc1198+
1404 7af322bc1198+
1393
1405
1394 Sticky repository, update --clean
1406 Sticky repository, update --clean
1395 $ hg update --clean tip
1407 $ hg update --clean tip
1396 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1408 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1397 $ hg id
1409 $ hg id
1398 925c17564ef8 tip
1410 925c17564ef8 tip
1399 $ hg -R s id
1411 $ hg -R s id
1400 12a213df6fa9 tip
1412 12a213df6fa9 tip
1401 $ hg -R t id
1413 $ hg -R t id
1402 52c0adc0515a tip
1414 52c0adc0515a tip
1403
1415
1404 Test subrepo already at intended revision:
1416 Test subrepo already at intended revision:
1405 $ cd s
1417 $ cd s
1406 $ hg update fc627a69481f
1418 $ hg update fc627a69481f
1407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1419 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1408 $ cd ..
1420 $ cd ..
1409 $ hg update 11
1421 $ hg update 11
1410 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1422 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1411 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1423 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1412 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1413 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1414 $ hg id -n
1426 $ hg id -n
1415 11+
1427 11+
1416 $ hg -R s id
1428 $ hg -R s id
1417 fc627a69481f
1429 fc627a69481f
1418 $ hg -R t id
1430 $ hg -R t id
1419 e95bcfa18a35
1431 e95bcfa18a35
1420
1432
1421 Test that removing .hgsubstate doesn't break anything:
1433 Test that removing .hgsubstate doesn't break anything:
1422
1434
1423 $ hg rm -f .hgsubstate
1435 $ hg rm -f .hgsubstate
1424 $ hg ci -mrm
1436 $ hg ci -mrm
1425 nothing changed
1437 nothing changed
1426 [1]
1438 [1]
1427 $ hg log -vr tip
1439 $ hg log -vr tip
1428 changeset: 13:925c17564ef8
1440 changeset: 13:925c17564ef8
1429 tag: tip
1441 tag: tip
1430 user: test
1442 user: test
1431 date: Thu Jan 01 00:00:00 1970 +0000
1443 date: Thu Jan 01 00:00:00 1970 +0000
1432 files: .hgsubstate
1444 files: .hgsubstate
1433 description:
1445 description:
1434 13
1446 13
1435
1447
1436
1448
1437
1449
1438 Test that removing .hgsub removes .hgsubstate:
1450 Test that removing .hgsub removes .hgsubstate:
1439
1451
1440 $ hg rm .hgsub
1452 $ hg rm .hgsub
1441 $ hg ci -mrm2
1453 $ hg ci -mrm2
1442 created new head
1454 created new head
1443 $ hg log -vr tip
1455 $ hg log -vr tip
1444 changeset: 14:2400bccd50af
1456 changeset: 14:2400bccd50af
1445 tag: tip
1457 tag: tip
1446 parent: 11:365661e5936a
1458 parent: 11:365661e5936a
1447 user: test
1459 user: test
1448 date: Thu Jan 01 00:00:00 1970 +0000
1460 date: Thu Jan 01 00:00:00 1970 +0000
1449 files: .hgsub .hgsubstate
1461 files: .hgsub .hgsubstate
1450 description:
1462 description:
1451 rm2
1463 rm2
1452
1464
1453
1465
1454 Test issue3153: diff -S with deleted subrepos
1466 Test issue3153: diff -S with deleted subrepos
1455
1467
1456 $ hg diff --nodates -S -c .
1468 $ hg diff --nodates -S -c .
1457 diff -r 365661e5936a -r 2400bccd50af .hgsub
1469 diff -r 365661e5936a -r 2400bccd50af .hgsub
1458 --- a/.hgsub
1470 --- a/.hgsub
1459 +++ /dev/null
1471 +++ /dev/null
1460 @@ -1,2 +0,0 @@
1472 @@ -1,2 +0,0 @@
1461 -s = s
1473 -s = s
1462 -t = t
1474 -t = t
1463 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1475 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1464 --- a/.hgsubstate
1476 --- a/.hgsubstate
1465 +++ /dev/null
1477 +++ /dev/null
1466 @@ -1,2 +0,0 @@
1478 @@ -1,2 +0,0 @@
1467 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1479 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1468 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1480 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1469
1481
1470 Test behavior of add for explicit path in subrepo:
1482 Test behavior of add for explicit path in subrepo:
1471 $ cd ..
1483 $ cd ..
1472 $ hg init explicit
1484 $ hg init explicit
1473 $ cd explicit
1485 $ cd explicit
1474 $ echo s = s > .hgsub
1486 $ echo s = s > .hgsub
1475 $ hg add .hgsub
1487 $ hg add .hgsub
1476 $ hg init s
1488 $ hg init s
1477 $ hg ci -m0
1489 $ hg ci -m0
1478 Adding with an explicit path in a subrepo adds the file
1490 Adding with an explicit path in a subrepo adds the file
1479 $ echo c1 > f1
1491 $ echo c1 > f1
1480 $ echo c2 > s/f2
1492 $ echo c2 > s/f2
1481 $ hg st -S
1493 $ hg st -S
1482 ? f1
1494 ? f1
1483 ? s/f2
1495 ? s/f2
1484 $ hg add s/f2
1496 $ hg add s/f2
1485 $ hg st -S
1497 $ hg st -S
1486 A s/f2
1498 A s/f2
1487 ? f1
1499 ? f1
1488 $ hg ci -R s -m0
1500 $ hg ci -R s -m0
1489 $ hg ci -Am1
1501 $ hg ci -Am1
1490 adding f1
1502 adding f1
1491 Adding with an explicit path in a subrepo with -S has the same behavior
1503 Adding with an explicit path in a subrepo with -S has the same behavior
1492 $ echo c3 > f3
1504 $ echo c3 > f3
1493 $ echo c4 > s/f4
1505 $ echo c4 > s/f4
1494 $ hg st -S
1506 $ hg st -S
1495 ? f3
1507 ? f3
1496 ? s/f4
1508 ? s/f4
1497 $ hg add -S s/f4
1509 $ hg add -S s/f4
1498 $ hg st -S
1510 $ hg st -S
1499 A s/f4
1511 A s/f4
1500 ? f3
1512 ? f3
1501 $ hg ci -R s -m1
1513 $ hg ci -R s -m1
1502 $ hg ci -Ama2
1514 $ hg ci -Ama2
1503 adding f3
1515 adding f3
1504 Adding without a path or pattern silently ignores subrepos
1516 Adding without a path or pattern silently ignores subrepos
1505 $ echo c5 > f5
1517 $ echo c5 > f5
1506 $ echo c6 > s/f6
1518 $ echo c6 > s/f6
1507 $ echo c7 > s/f7
1519 $ echo c7 > s/f7
1508 $ hg st -S
1520 $ hg st -S
1509 ? f5
1521 ? f5
1510 ? s/f6
1522 ? s/f6
1511 ? s/f7
1523 ? s/f7
1512 $ hg add
1524 $ hg add
1513 adding f5
1525 adding f5
1514 $ hg st -S
1526 $ hg st -S
1515 A f5
1527 A f5
1516 ? s/f6
1528 ? s/f6
1517 ? s/f7
1529 ? s/f7
1518 $ hg ci -R s -Am2
1530 $ hg ci -R s -Am2
1519 adding f6
1531 adding f6
1520 adding f7
1532 adding f7
1521 $ hg ci -m3
1533 $ hg ci -m3
1522 Adding without a path or pattern with -S also adds files in subrepos
1534 Adding without a path or pattern with -S also adds files in subrepos
1523 $ echo c8 > f8
1535 $ echo c8 > f8
1524 $ echo c9 > s/f9
1536 $ echo c9 > s/f9
1525 $ echo c10 > s/f10
1537 $ echo c10 > s/f10
1526 $ hg st -S
1538 $ hg st -S
1527 ? f8
1539 ? f8
1528 ? s/f10
1540 ? s/f10
1529 ? s/f9
1541 ? s/f9
1530 $ hg add -S
1542 $ hg add -S
1531 adding f8
1543 adding f8
1532 adding s/f10 (glob)
1544 adding s/f10 (glob)
1533 adding s/f9 (glob)
1545 adding s/f9 (glob)
1534 $ hg st -S
1546 $ hg st -S
1535 A f8
1547 A f8
1536 A s/f10
1548 A s/f10
1537 A s/f9
1549 A s/f9
1538 $ hg ci -R s -m3
1550 $ hg ci -R s -m3
1539 $ hg ci -m4
1551 $ hg ci -m4
1540 Adding with a pattern silently ignores subrepos
1552 Adding with a pattern silently ignores subrepos
1541 $ echo c11 > fm11
1553 $ echo c11 > fm11
1542 $ echo c12 > fn12
1554 $ echo c12 > fn12
1543 $ echo c13 > s/fm13
1555 $ echo c13 > s/fm13
1544 $ echo c14 > s/fn14
1556 $ echo c14 > s/fn14
1545 $ hg st -S
1557 $ hg st -S
1546 ? fm11
1558 ? fm11
1547 ? fn12
1559 ? fn12
1548 ? s/fm13
1560 ? s/fm13
1549 ? s/fn14
1561 ? s/fn14
1550 $ hg add 'glob:**fm*'
1562 $ hg add 'glob:**fm*'
1551 adding fm11
1563 adding fm11
1552 $ hg st -S
1564 $ hg st -S
1553 A fm11
1565 A fm11
1554 ? fn12
1566 ? fn12
1555 ? s/fm13
1567 ? s/fm13
1556 ? s/fn14
1568 ? s/fn14
1557 $ hg ci -R s -Am4
1569 $ hg ci -R s -Am4
1558 adding fm13
1570 adding fm13
1559 adding fn14
1571 adding fn14
1560 $ hg ci -Am5
1572 $ hg ci -Am5
1561 adding fn12
1573 adding fn12
1562 Adding with a pattern with -S also adds matches in subrepos
1574 Adding with a pattern with -S also adds matches in subrepos
1563 $ echo c15 > fm15
1575 $ echo c15 > fm15
1564 $ echo c16 > fn16
1576 $ echo c16 > fn16
1565 $ echo c17 > s/fm17
1577 $ echo c17 > s/fm17
1566 $ echo c18 > s/fn18
1578 $ echo c18 > s/fn18
1567 $ hg st -S
1579 $ hg st -S
1568 ? fm15
1580 ? fm15
1569 ? fn16
1581 ? fn16
1570 ? s/fm17
1582 ? s/fm17
1571 ? s/fn18
1583 ? s/fn18
1572 $ hg add -S 'glob:**fm*'
1584 $ hg add -S 'glob:**fm*'
1573 adding fm15
1585 adding fm15
1574 adding s/fm17 (glob)
1586 adding s/fm17 (glob)
1575 $ hg st -S
1587 $ hg st -S
1576 A fm15
1588 A fm15
1577 A s/fm17
1589 A s/fm17
1578 ? fn16
1590 ? fn16
1579 ? s/fn18
1591 ? s/fn18
1580 $ hg ci -R s -Am5
1592 $ hg ci -R s -Am5
1581 adding fn18
1593 adding fn18
1582 $ hg ci -Am6
1594 $ hg ci -Am6
1583 adding fn16
1595 adding fn16
1584
1596
1585 Test behavior of forget for explicit path in subrepo:
1597 Test behavior of forget for explicit path in subrepo:
1586 Forgetting an explicit path in a subrepo untracks the file
1598 Forgetting an explicit path in a subrepo untracks the file
1587 $ echo c19 > s/f19
1599 $ echo c19 > s/f19
1588 $ hg add s/f19
1600 $ hg add s/f19
1589 $ hg st -S
1601 $ hg st -S
1590 A s/f19
1602 A s/f19
1591 $ hg forget s/f19
1603 $ hg forget s/f19
1592 $ hg st -S
1604 $ hg st -S
1593 ? s/f19
1605 ? s/f19
1594 $ rm s/f19
1606 $ rm s/f19
1595 $ cd ..
1607 $ cd ..
1596
1608
1597 Courtesy phases synchronisation to publishing server does not block the push
1609 Courtesy phases synchronisation to publishing server does not block the push
1598 (issue3781)
1610 (issue3781)
1599
1611
1600 $ cp -R main issue3781
1612 $ cp -R main issue3781
1601 $ cp -R main issue3781-dest
1613 $ cp -R main issue3781-dest
1602 $ cd issue3781-dest/s
1614 $ cd issue3781-dest/s
1603 $ hg phase tip # show we have draft changeset
1615 $ hg phase tip # show we have draft changeset
1604 5: draft
1616 5: draft
1605 $ chmod a-w .hg/store/phaseroots # prevent phase push
1617 $ chmod a-w .hg/store/phaseroots # prevent phase push
1606 $ cd ../../issue3781
1618 $ cd ../../issue3781
1607 $ cat >> .hg/hgrc << EOF
1619 $ cat >> .hg/hgrc << EOF
1608 > [paths]
1620 > [paths]
1609 > default=../issue3781-dest/
1621 > default=../issue3781-dest/
1610 > EOF
1622 > EOF
1611 $ hg push --config devel.legacy.exchange=bundle1
1623 $ hg push --config devel.legacy.exchange=bundle1
1612 pushing to $TESTTMP/issue3781-dest (glob)
1624 pushing to $TESTTMP/issue3781-dest (glob)
1613 pushing subrepo s to $TESTTMP/issue3781-dest/s
1625 pushing subrepo s to $TESTTMP/issue3781-dest/s
1614 searching for changes
1626 searching for changes
1615 no changes found
1627 no changes found
1616 searching for changes
1628 searching for changes
1617 no changes found
1629 no changes found
1618 [1]
1630 [1]
1619 # clean the push cache
1631 # clean the push cache
1620 $ rm s/.hg/cache/storehash/*
1632 $ rm s/.hg/cache/storehash/*
1621 $ hg push # bundle2+
1633 $ hg push # bundle2+
1622 pushing to $TESTTMP/issue3781-dest (glob)
1634 pushing to $TESTTMP/issue3781-dest (glob)
1623 pushing subrepo s to $TESTTMP/issue3781-dest/s
1635 pushing subrepo s to $TESTTMP/issue3781-dest/s
1624 searching for changes
1636 searching for changes
1625 no changes found
1637 no changes found
1626 searching for changes
1638 searching for changes
1627 no changes found
1639 no changes found
1628 [1]
1640 [1]
1629 $ cd ..
1641 $ cd ..
1630
1642
1631 Test phase choice for newly created commit with "phases.subrepochecks"
1643 Test phase choice for newly created commit with "phases.subrepochecks"
1632 configuration
1644 configuration
1633
1645
1634 $ cd t
1646 $ cd t
1635 $ hg update -q -r 12
1647 $ hg update -q -r 12
1636
1648
1637 $ cat >> s/ss/.hg/hgrc <<EOF
1649 $ cat >> s/ss/.hg/hgrc <<EOF
1638 > [phases]
1650 > [phases]
1639 > new-commit = secret
1651 > new-commit = secret
1640 > EOF
1652 > EOF
1641 $ cat >> s/.hg/hgrc <<EOF
1653 $ cat >> s/.hg/hgrc <<EOF
1642 > [phases]
1654 > [phases]
1643 > new-commit = draft
1655 > new-commit = draft
1644 > EOF
1656 > EOF
1645 $ echo phasecheck1 >> s/ss/a
1657 $ echo phasecheck1 >> s/ss/a
1646 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1658 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1647 committing subrepository ss
1659 committing subrepository ss
1648 transaction abort!
1660 transaction abort!
1649 rollback completed
1661 rollback completed
1650 abort: can't commit in draft phase conflicting secret from subrepository ss
1662 abort: can't commit in draft phase conflicting secret from subrepository ss
1651 [255]
1663 [255]
1652 $ echo phasecheck2 >> s/ss/a
1664 $ echo phasecheck2 >> s/ss/a
1653 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1665 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1654 committing subrepository ss
1666 committing subrepository ss
1655 $ hg -R s/ss phase tip
1667 $ hg -R s/ss phase tip
1656 3: secret
1668 3: secret
1657 $ hg -R s phase tip
1669 $ hg -R s phase tip
1658 6: draft
1670 6: draft
1659 $ echo phasecheck3 >> s/ss/a
1671 $ echo phasecheck3 >> s/ss/a
1660 $ hg -R s commit -S -m phasecheck3
1672 $ hg -R s commit -S -m phasecheck3
1661 committing subrepository ss
1673 committing subrepository ss
1662 warning: changes are committed in secret phase from subrepository ss
1674 warning: changes are committed in secret phase from subrepository ss
1663 $ hg -R s/ss phase tip
1675 $ hg -R s/ss phase tip
1664 4: secret
1676 4: secret
1665 $ hg -R s phase tip
1677 $ hg -R s phase tip
1666 7: secret
1678 7: secret
1667
1679
1668 $ cat >> t/.hg/hgrc <<EOF
1680 $ cat >> t/.hg/hgrc <<EOF
1669 > [phases]
1681 > [phases]
1670 > new-commit = draft
1682 > new-commit = draft
1671 > EOF
1683 > EOF
1672 $ cat >> .hg/hgrc <<EOF
1684 $ cat >> .hg/hgrc <<EOF
1673 > [phases]
1685 > [phases]
1674 > new-commit = public
1686 > new-commit = public
1675 > EOF
1687 > EOF
1676 $ echo phasecheck4 >> s/ss/a
1688 $ echo phasecheck4 >> s/ss/a
1677 $ echo phasecheck4 >> t/t
1689 $ echo phasecheck4 >> t/t
1678 $ hg commit -S -m phasecheck4
1690 $ hg commit -S -m phasecheck4
1679 committing subrepository s
1691 committing subrepository s
1680 committing subrepository s/ss (glob)
1692 committing subrepository s/ss (glob)
1681 warning: changes are committed in secret phase from subrepository ss
1693 warning: changes are committed in secret phase from subrepository ss
1682 committing subrepository t
1694 committing subrepository t
1683 warning: changes are committed in secret phase from subrepository s
1695 warning: changes are committed in secret phase from subrepository s
1684 created new head
1696 created new head
1685 $ hg -R s/ss phase tip
1697 $ hg -R s/ss phase tip
1686 5: secret
1698 5: secret
1687 $ hg -R s phase tip
1699 $ hg -R s phase tip
1688 8: secret
1700 8: secret
1689 $ hg -R t phase tip
1701 $ hg -R t phase tip
1690 6: draft
1702 6: draft
1691 $ hg phase tip
1703 $ hg phase tip
1692 15: secret
1704 15: secret
1693
1705
1694 $ cd ..
1706 $ cd ..
1695
1707
1696
1708
1697 Test that commit --secret works on both repo and subrepo (issue4182)
1709 Test that commit --secret works on both repo and subrepo (issue4182)
1698
1710
1699 $ cd main
1711 $ cd main
1700 $ echo secret >> b
1712 $ echo secret >> b
1701 $ echo secret >> s/b
1713 $ echo secret >> s/b
1702 $ hg commit --secret --subrepo -m "secret"
1714 $ hg commit --secret --subrepo -m "secret"
1703 committing subrepository s
1715 committing subrepository s
1704 $ hg phase -r .
1716 $ hg phase -r .
1705 6: secret
1717 6: secret
1706 $ cd s
1718 $ cd s
1707 $ hg phase -r .
1719 $ hg phase -r .
1708 6: secret
1720 6: secret
1709 $ cd ../../
1721 $ cd ../../
1710
1722
1711 Test "subrepos" template keyword
1723 Test "subrepos" template keyword
1712
1724
1713 $ cd t
1725 $ cd t
1714 $ hg update -q 15
1726 $ hg update -q 15
1715 $ cat > .hgsub <<EOF
1727 $ cat > .hgsub <<EOF
1716 > s = s
1728 > s = s
1717 > EOF
1729 > EOF
1718 $ hg commit -m "16"
1730 $ hg commit -m "16"
1719 warning: changes are committed in secret phase from subrepository s
1731 warning: changes are committed in secret phase from subrepository s
1720
1732
1721 (addition of ".hgsub" itself)
1733 (addition of ".hgsub" itself)
1722
1734
1723 $ hg diff --nodates -c 1 .hgsubstate
1735 $ hg diff --nodates -c 1 .hgsubstate
1724 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1736 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1725 --- /dev/null
1737 --- /dev/null
1726 +++ b/.hgsubstate
1738 +++ b/.hgsubstate
1727 @@ -0,0 +1,1 @@
1739 @@ -0,0 +1,1 @@
1728 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1740 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1729 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1741 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1730 f7b1eb17ad24 000000000000
1742 f7b1eb17ad24 000000000000
1731 s
1743 s
1732
1744
1733 (modification of existing entry)
1745 (modification of existing entry)
1734
1746
1735 $ hg diff --nodates -c 2 .hgsubstate
1747 $ hg diff --nodates -c 2 .hgsubstate
1736 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1748 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1737 --- a/.hgsubstate
1749 --- a/.hgsubstate
1738 +++ b/.hgsubstate
1750 +++ b/.hgsubstate
1739 @@ -1,1 +1,1 @@
1751 @@ -1,1 +1,1 @@
1740 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1752 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1741 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1753 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1742 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1754 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1743 7cf8cfea66e4 000000000000
1755 7cf8cfea66e4 000000000000
1744 s
1756 s
1745
1757
1746 (addition of entry)
1758 (addition of entry)
1747
1759
1748 $ hg diff --nodates -c 5 .hgsubstate
1760 $ hg diff --nodates -c 5 .hgsubstate
1749 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1761 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1750 --- a/.hgsubstate
1762 --- a/.hgsubstate
1751 +++ b/.hgsubstate
1763 +++ b/.hgsubstate
1752 @@ -1,1 +1,2 @@
1764 @@ -1,1 +1,2 @@
1753 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1765 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1754 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1766 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1755 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1767 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1756 7cf8cfea66e4 000000000000
1768 7cf8cfea66e4 000000000000
1757 t
1769 t
1758
1770
1759 (removal of existing entry)
1771 (removal of existing entry)
1760
1772
1761 $ hg diff --nodates -c 16 .hgsubstate
1773 $ hg diff --nodates -c 16 .hgsubstate
1762 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1774 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1763 --- a/.hgsubstate
1775 --- a/.hgsubstate
1764 +++ b/.hgsubstate
1776 +++ b/.hgsubstate
1765 @@ -1,2 +1,1 @@
1777 @@ -1,2 +1,1 @@
1766 0731af8ca9423976d3743119d0865097c07bdc1b s
1778 0731af8ca9423976d3743119d0865097c07bdc1b s
1767 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1779 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1768 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1780 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1769 8bec38d2bd0b 000000000000
1781 8bec38d2bd0b 000000000000
1770 t
1782 t
1771
1783
1772 (merging)
1784 (merging)
1773
1785
1774 $ hg diff --nodates -c 9 .hgsubstate
1786 $ hg diff --nodates -c 9 .hgsubstate
1775 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1787 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1776 --- a/.hgsubstate
1788 --- a/.hgsubstate
1777 +++ b/.hgsubstate
1789 +++ b/.hgsubstate
1778 @@ -1,1 +1,2 @@
1790 @@ -1,1 +1,2 @@
1779 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1791 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1780 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1792 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1781 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1793 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1782 f6affe3fbfaa 1f14a2e2d3ec
1794 f6affe3fbfaa 1f14a2e2d3ec
1783 t
1795 t
1784
1796
1785 (removal of ".hgsub" itself)
1797 (removal of ".hgsub" itself)
1786
1798
1787 $ hg diff --nodates -c 8 .hgsubstate
1799 $ hg diff --nodates -c 8 .hgsubstate
1788 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1800 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1789 --- a/.hgsubstate
1801 --- a/.hgsubstate
1790 +++ /dev/null
1802 +++ /dev/null
1791 @@ -1,2 +0,0 @@
1803 @@ -1,2 +0,0 @@
1792 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1804 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1793 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1805 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1794 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1806 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1795 f94576341bcf 000000000000
1807 f94576341bcf 000000000000
1796
1808
1797 Test that '[paths]' is configured correctly at subrepo creation
1809 Test that '[paths]' is configured correctly at subrepo creation
1798
1810
1799 $ cd $TESTTMP/tc
1811 $ cd $TESTTMP/tc
1800 $ cat > .hgsub <<EOF
1812 $ cat > .hgsub <<EOF
1801 > # to clear bogus subrepo path 'bogus=[boguspath'
1813 > # to clear bogus subrepo path 'bogus=[boguspath'
1802 > s = s
1814 > s = s
1803 > t = t
1815 > t = t
1804 > EOF
1816 > EOF
1805 $ hg update -q --clean null
1817 $ hg update -q --clean null
1806 $ rm -rf s t
1818 $ rm -rf s t
1807 $ cat >> .hg/hgrc <<EOF
1819 $ cat >> .hg/hgrc <<EOF
1808 > [paths]
1820 > [paths]
1809 > default-push = /foo/bar
1821 > default-push = /foo/bar
1810 > EOF
1822 > EOF
1811 $ hg update -q
1823 $ hg update -q
1812 $ cat s/.hg/hgrc
1824 $ cat s/.hg/hgrc
1813 [paths]
1825 [paths]
1814 default = $TESTTMP/t/s
1826 default = $TESTTMP/t/s
1815 default-push = /foo/bar/s
1827 default-push = /foo/bar/s
1816 $ cat s/ss/.hg/hgrc
1828 $ cat s/ss/.hg/hgrc
1817 [paths]
1829 [paths]
1818 default = $TESTTMP/t/s/ss
1830 default = $TESTTMP/t/s/ss
1819 default-push = /foo/bar/s/ss
1831 default-push = /foo/bar/s/ss
1820 $ cat t/.hg/hgrc
1832 $ cat t/.hg/hgrc
1821 [paths]
1833 [paths]
1822 default = $TESTTMP/t/t
1834 default = $TESTTMP/t/t
1823 default-push = /foo/bar/t
1835 default-push = /foo/bar/t
1824
1836
1825 $ cd $TESTTMP/t
1837 $ cd $TESTTMP/t
1826 $ hg up -qC 0
1838 $ hg up -qC 0
1827 $ echo 'bar' > bar.txt
1839 $ echo 'bar' > bar.txt
1828 $ hg ci -Am 'branch before subrepo add'
1840 $ hg ci -Am 'branch before subrepo add'
1829 adding bar.txt
1841 adding bar.txt
1830 created new head
1842 created new head
1831 $ hg merge -r "first(subrepo('s'))"
1843 $ hg merge -r "first(subrepo('s'))"
1832 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1844 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1833 (branch merge, don't forget to commit)
1845 (branch merge, don't forget to commit)
1834 $ hg status -S -X '.hgsub*'
1846 $ hg status -S -X '.hgsub*'
1835 A s/a
1847 A s/a
1836 ? s/b
1848 ? s/b
1837 ? s/c
1849 ? s/c
1838 ? s/f1
1850 ? s/f1
1839 $ hg status -S --rev 'p2()'
1851 $ hg status -S --rev 'p2()'
1840 A bar.txt
1852 A bar.txt
1841 ? s/b
1853 ? s/b
1842 ? s/c
1854 ? s/c
1843 ? s/f1
1855 ? s/f1
1844 $ hg diff -S -X '.hgsub*' --nodates
1856 $ hg diff -S -X '.hgsub*' --nodates
1845 diff -r 000000000000 s/a
1857 diff -r 000000000000 s/a
1846 --- /dev/null
1858 --- /dev/null
1847 +++ b/s/a
1859 +++ b/s/a
1848 @@ -0,0 +1,1 @@
1860 @@ -0,0 +1,1 @@
1849 +a
1861 +a
1850 $ hg diff -S --rev 'p2()' --nodates
1862 $ hg diff -S --rev 'p2()' --nodates
1851 diff -r 7cf8cfea66e4 bar.txt
1863 diff -r 7cf8cfea66e4 bar.txt
1852 --- /dev/null
1864 --- /dev/null
1853 +++ b/bar.txt
1865 +++ b/bar.txt
1854 @@ -0,0 +1,1 @@
1866 @@ -0,0 +1,1 @@
1855 +bar
1867 +bar
1856
1868
1857 $ cd ..
1869 $ cd ..
1858
1870
1859 test for ssh exploit 2017-07-25
1871 test for ssh exploit 2017-07-25
1860
1872
1861 $ cat >> $HGRCPATH << EOF
1873 $ cat >> $HGRCPATH << EOF
1862 > [ui]
1874 > [ui]
1863 > ssh = sh -c "read l; read l; read l"
1875 > ssh = sh -c "read l; read l; read l"
1864 > EOF
1876 > EOF
1865
1877
1866 $ hg init malicious-proxycommand
1878 $ hg init malicious-proxycommand
1867 $ cd malicious-proxycommand
1879 $ cd malicious-proxycommand
1868 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1880 $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub
1869 $ hg init s
1881 $ hg init s
1870 $ cd s
1882 $ cd s
1871 $ echo init > init
1883 $ echo init > init
1872 $ hg add
1884 $ hg add
1873 adding init
1885 adding init
1874 $ hg commit -m init
1886 $ hg commit -m init
1875 $ cd ..
1887 $ cd ..
1876 $ hg add .hgsub
1888 $ hg add .hgsub
1877 $ hg ci -m 'add subrepo'
1889 $ hg ci -m 'add subrepo'
1878 $ cd ..
1890 $ cd ..
1879 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1891 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1880 updating to branch default
1892 updating to branch default
1881 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1893 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1882 [255]
1894 [255]
1883
1895
1884 also check that a percent encoded '-' (%2D) doesn't work
1896 also check that a percent encoded '-' (%2D) doesn't work
1885
1897
1886 $ cd malicious-proxycommand
1898 $ cd malicious-proxycommand
1887 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1899 $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/path' > .hgsub
1888 $ hg ci -m 'change url to percent encoded'
1900 $ hg ci -m 'change url to percent encoded'
1889 $ cd ..
1901 $ cd ..
1890 $ rm -r malicious-proxycommand-clone
1902 $ rm -r malicious-proxycommand-clone
1891 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1903 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1892 updating to branch default
1904 updating to branch default
1893 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1905 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s")
1894 [255]
1906 [255]
1895
1907
1896 also check for a pipe
1908 also check for a pipe
1897
1909
1898 $ cd malicious-proxycommand
1910 $ cd malicious-proxycommand
1899 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1911 $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub
1900 $ hg ci -m 'change url to pipe'
1912 $ hg ci -m 'change url to pipe'
1901 $ cd ..
1913 $ cd ..
1902 $ rm -r malicious-proxycommand-clone
1914 $ rm -r malicious-proxycommand-clone
1903 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1915 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1904 updating to branch default
1916 updating to branch default
1905 abort: no suitable response from remote hg!
1917 abort: no suitable response from remote hg!
1906 [255]
1918 [255]
1907 $ [ ! -f owned ] || echo 'you got owned'
1919 $ [ ! -f owned ] || echo 'you got owned'
1908
1920
1909 also check that a percent encoded '|' (%7C) doesn't work
1921 also check that a percent encoded '|' (%7C) doesn't work
1910
1922
1911 $ cd malicious-proxycommand
1923 $ cd malicious-proxycommand
1912 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1924 $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub
1913 $ hg ci -m 'change url to percent encoded pipe'
1925 $ hg ci -m 'change url to percent encoded pipe'
1914 $ cd ..
1926 $ cd ..
1915 $ rm -r malicious-proxycommand-clone
1927 $ rm -r malicious-proxycommand-clone
1916 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1928 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1917 updating to branch default
1929 updating to branch default
1918 abort: no suitable response from remote hg!
1930 abort: no suitable response from remote hg!
1919 [255]
1931 [255]
1920 $ [ ! -f owned ] || echo 'you got owned'
1932 $ [ ! -f owned ] || echo 'you got owned'
1921
1933
1922 and bad usernames:
1934 and bad usernames:
1923 $ cd malicious-proxycommand
1935 $ cd malicious-proxycommand
1924 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1936 $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub
1925 $ hg ci -m 'owned username'
1937 $ hg ci -m 'owned username'
1926 $ cd ..
1938 $ cd ..
1927 $ rm -r malicious-proxycommand-clone
1939 $ rm -r malicious-proxycommand-clone
1928 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1940 $ hg clone malicious-proxycommand malicious-proxycommand-clone
1929 updating to branch default
1941 updating to branch default
1930 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1942 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s")
1931 [255]
1943 [255]
General Comments 0
You need to be logged in to leave comments. Login now