##// END OF EJS Templates
subrepos: abort commit by default if a subrepo is dirty (BC)...
Martin Geisler -
r15321:e174353e stable
parent child Browse files
Show More
@@ -1143,7 +1143,7 b' def clone(ui, source, dest=None, **opts)'
1143 _('mark new/missing files as added/removed before committing')),
1143 _('mark new/missing files as added/removed before committing')),
1144 ('', 'close-branch', None,
1144 ('', 'close-branch', None,
1145 _('mark a branch as closed, hiding it from the branch list')),
1145 _('mark a branch as closed, hiding it from the branch list')),
1146 ] + walkopts + commitopts + commitopts2,
1146 ] + walkopts + commitopts + commitopts2 + subrepoopts,
1147 _('[OPTION]... [FILE]...'))
1147 _('[OPTION]... [FILE]...'))
1148 def commit(ui, repo, *pats, **opts):
1148 def commit(ui, repo, *pats, **opts):
1149 """commit the specified files or all outstanding changes
1149 """commit the specified files or all outstanding changes
@@ -1167,6 +1167,10 b' def commit(ui, repo, *pats, **opts):'
1167
1167
1168 Returns 0 on success, 1 if nothing changed.
1168 Returns 0 on success, 1 if nothing changed.
1169 """
1169 """
1170 if opts.get('subrepos'):
1171 # Let --subrepos on the command line overide config setting.
1172 ui.setconfig('ui', 'commitsubrepos', True)
1173
1170 extra = {}
1174 extra = {}
1171 if opts.get('close_branch'):
1175 if opts.get('close_branch'):
1172 if repo['.'].node() not in repo.branchheads():
1176 if repo['.'].node() not in repo.branchheads():
@@ -1010,7 +1010,7 b' User interface controls.'
1010 Whether to commit modified subrepositories when committing the
1010 Whether to commit modified subrepositories when committing the
1011 parent repository. If False and one subrepository has uncommitted
1011 parent repository. If False and one subrepository has uncommitted
1012 changes, abort the commit.
1012 changes, abort the commit.
1013 Default is True.
1013 Default is False.
1014
1014
1015 ``debug``
1015 ``debug``
1016 Print debugging information. True or False. Default is False.
1016 Print debugging information. True or False. Default is False.
@@ -1062,11 +1062,12 b' class localrepository(repo.repository):'
1062 '.hgsubstate' not in changes[0] + changes[1] + changes[2]):
1062 '.hgsubstate' not in changes[0] + changes[1] + changes[2]):
1063 changes[2].insert(0, '.hgsubstate')
1063 changes[2].insert(0, '.hgsubstate')
1064
1064
1065 if subs and not self.ui.configbool('ui', 'commitsubrepos', True):
1065 if subs and not self.ui.configbool('ui', 'commitsubrepos', False):
1066 changedsubs = [s for s in subs if wctx.sub(s).dirty(True)]
1066 changedsubs = [s for s in subs if wctx.sub(s).dirty(True)]
1067 if changedsubs:
1067 if changedsubs:
1068 raise util.Abort(_("uncommitted changes in subrepo %s")
1068 raise util.Abort(_("uncommitted changes in subrepo %s")
1069 % changedsubs[0])
1069 % changedsubs[0],
1070 hint=_("use --subrepos for recursive commit"))
1070
1071
1071 # make sure all explicit patterns are matched
1072 # make sure all explicit patterns are matched
1072 if not force and match.files():
1073 if not force and match.files():
@@ -191,7 +191,7 b' Show all commands + options'
191 add: include, exclude, subrepos, dry-run
191 add: include, exclude, subrepos, dry-run
192 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
192 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, include, exclude
193 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
193 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
194 commit: addremove, close-branch, include, exclude, message, logfile, date, user
194 commit: addremove, close-branch, include, exclude, message, logfile, date, user, subrepos
195 diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos
195 diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude, subrepos
196 export: output, switch-parent, rev, text, git, nodates
196 export: output, switch-parent, rev, text, git, nodates
197 forget: include, exclude
197 forget: include, exclude
@@ -1,3 +1,5 b''
1 $ echo "[ui]" >> $HGRCPATH
2 $ echo "commitsubrepos = Yes" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
3 $ echo "record=" >> $HGRCPATH
5 $ echo "record=" >> $HGRCPATH
@@ -64,6 +64,7 b' help record (record)'
64 -l --logfile FILE read commit message from file
64 -l --logfile FILE read commit message from file
65 -d --date DATE record the specified date as commit date
65 -d --date DATE record the specified date as commit date
66 -u --user USER record the specified user as committer
66 -u --user USER record the specified user as committer
67 -S --subrepos recurse into subrepositories
67 -w --ignore-all-space ignore white space when comparing lines
68 -w --ignore-all-space ignore white space when comparing lines
68 -b --ignore-space-change ignore changes in the amount of white space
69 -b --ignore-space-change ignore changes in the amount of white space
69 -B --ignore-blank-lines ignore changes whose lines are all blank
70 -B --ignore-blank-lines ignore changes whose lines are all blank
@@ -77,7 +77,7 b' debugsub output for main and sub1'
77 Modifying deeply nested 'sub2'
77 Modifying deeply nested 'sub2'
78
78
79 $ echo modified > cloned/sub1/sub2/sub2
79 $ echo modified > cloned/sub1/sub2/sub2
80 $ hg commit -m "deep nested modif should trigger a commit" -R cloned
80 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
81 committing subrepository sub1
81 committing subrepository sub1
82 committing subrepository sub1/sub2
82 committing subrepository sub1/sub2
83
83
@@ -103,7 +103,7 b' clone root, make local change'
103 $ echo ggg >> s/g
103 $ echo ggg >> s/g
104 $ hg status --subrepos
104 $ hg status --subrepos
105 M s/g
105 M s/g
106 $ hg commit -m ggg
106 $ hg commit --subrepos -m ggg
107 committing subrepository s
107 committing subrepository s
108 $ hg debugsub
108 $ hg debugsub
109 path s
109 path s
@@ -125,7 +125,7 b' clone root separately, make different lo'
125
125
126 $ hg status --subrepos
126 $ hg status --subrepos
127 A s/f
127 A s/f
128 $ hg commit -m f
128 $ hg commit --subrepos -m f
129 committing subrepository s
129 committing subrepository s
130 $ hg debugsub
130 $ hg debugsub
131 path s
131 path s
@@ -164,7 +164,7 b' user a pulls, merges, commits'
164 g
164 g
165 gg
165 gg
166 ggg
166 ggg
167 $ hg commit -m 'merge'
167 $ hg commit --subrepos -m 'merge'
168 committing subrepository s
168 committing subrepository s
169 $ hg status --subrepos --rev 1:5
169 $ hg status --subrepos --rev 1:5
170 M .hgsubstate
170 M .hgsubstate
@@ -294,7 +294,7 b' nested commit'
294 $ echo ffff >> inner/s/f
294 $ echo ffff >> inner/s/f
295 $ hg status --subrepos
295 $ hg status --subrepos
296 M inner/s/f
296 M inner/s/f
297 $ hg commit -m nested
297 $ hg commit --subrepos -m nested
298 committing subrepository inner
298 committing subrepository inner
299 committing subrepository inner/s
299 committing subrepository inner/s
300
300
@@ -325,7 +325,7 b" Don't crash if the subrepo is missing"
325 $ hg push -q
325 $ hg push -q
326 abort: subrepo s is missing
326 abort: subrepo s is missing
327 [255]
327 [255]
328 $ hg commit -qm missing
328 $ hg commit --subrepos -qm missing
329 abort: subrepo s is missing
329 abort: subrepo s is missing
330 [255]
330 [255]
331 $ hg update -C
331 $ hg update -C
@@ -58,7 +58,14 b' Test recursive diff without committing a'
58
58
59 Commits:
59 Commits:
60
60
61 $ hg commit -m 0-0-0
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepo foo
63 (use --subrepos for recursive commit)
64 [255]
65
66 The --subrepos flag overwrite the config setting:
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
62 committing subrepository foo
69 committing subrepository foo
63 committing subrepository foo/bar
70 committing subrepository foo/bar
64
71
@@ -177,7 +184,7 b' Status with relative path:'
177 Cleanup and final commit:
184 Cleanup and final commit:
178
185
179 $ rm -r dir
186 $ rm -r dir
180 $ hg commit -m 2-3-2
187 $ hg commit --subrepos -m 2-3-2
181 committing subrepository foo
188 committing subrepository foo
182 committing subrepository foo/bar
189 committing subrepository foo/bar
183
190
@@ -394,7 +401,7 b' Make nested change:'
394 y2
401 y2
395 y3
402 y3
396 +y4
403 +y4
397 $ hg commit -m 3-4-2
404 $ hg commit --subrepos -m 3-4-2
398 committing subrepository foo
405 committing subrepository foo
399 $ hg outgoing -S
406 $ hg outgoing -S
400 comparing with $TESTTMP/repo
407 comparing with $TESTTMP/repo
@@ -105,7 +105,7 b' change file in svn and hg, commit'
105 branch: default
105 branch: default
106 commit: 1 modified, 1 subrepos
106 commit: 1 modified, 1 subrepos
107 update: (current)
107 update: (current)
108 $ hg commit -m 'Message!'
108 $ hg commit --subrepos -m 'Message!'
109 committing subrepository s
109 committing subrepository s
110 Sending*s/alpha (glob)
110 Sending*s/alpha (glob)
111 Transmitting file data .
111 Transmitting file data .
@@ -171,7 +171,7 b' add a commit from svn'
171 this commit from hg will fail
171 this commit from hg will fail
172
172
173 $ echo zzz >> s/alpha
173 $ echo zzz >> s/alpha
174 $ hg ci -m 'amend alpha from hg'
174 $ hg ci --subrepos -m 'amend alpha from hg'
175 committing subrepository s
175 committing subrepository s
176 abort: svn: Commit failed (details follow):
176 abort: svn: Commit failed (details follow):
177 svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
177 svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
@@ -182,7 +182,7 b' this commit fails because of meta change'
182
182
183 $ svn propset svn:mime-type 'text/html' s/alpha
183 $ svn propset svn:mime-type 'text/html' s/alpha
184 property 'svn:mime-type' set on 's/alpha'
184 property 'svn:mime-type' set on 's/alpha'
185 $ hg ci -m 'amend alpha from hg'
185 $ hg ci --subrepos -m 'amend alpha from hg'
186 committing subrepository s
186 committing subrepository s
187 abort: svn: Commit failed (details follow):
187 abort: svn: Commit failed (details follow):
188 svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
188 svn: (Out of date)?.*/src/alpha.*(is out of date)? (re)
@@ -192,7 +192,7 b' this commit fails because of meta change'
192 this commit fails because of externals changes
192 this commit fails because of externals changes
193
193
194 $ echo zzz > s/externals/other
194 $ echo zzz > s/externals/other
195 $ hg ci -m 'amend externals from hg'
195 $ hg ci --subrepos -m 'amend externals from hg'
196 committing subrepository s
196 committing subrepository s
197 abort: cannot commit svn externals
197 abort: cannot commit svn externals
198 [255]
198 [255]
@@ -214,7 +214,7 b' this commit fails because of externals m'
214
214
215 $ svn propset svn:mime-type 'text/html' s/externals/other
215 $ svn propset svn:mime-type 'text/html' s/externals/other
216 property 'svn:mime-type' set on 's/externals/other'
216 property 'svn:mime-type' set on 's/externals/other'
217 $ hg ci -m 'amend externals from hg'
217 $ hg ci --subrepos -m 'amend externals from hg'
218 committing subrepository s
218 committing subrepository s
219 abort: cannot commit svn externals
219 abort: cannot commit svn externals
220 [255]
220 [255]
@@ -523,7 +523,7 b' This is surprising, but is also correct '
523 Point to a Subversion branch which has since been deleted and recreated
523 Point to a Subversion branch which has since been deleted and recreated
524 First, create that condition in the repository.
524 First, create that condition in the repository.
525
525
526 $ hg ci -m cleanup
526 $ hg ci --subrepos -m cleanup
527 committing subrepository obstruct
527 committing subrepository obstruct
528 Sending obstruct/other
528 Sending obstruct/other
529 Transmitting file data .
529 Transmitting file data .
@@ -1,3 +1,8 b''
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
1 $ rm -rf sub
6 $ rm -rf sub
2 $ mkdir sub
7 $ mkdir sub
3 $ cd sub
8 $ cd sub
@@ -107,6 +112,7 b' leave sub dirty (and check ui.commitsubr'
107 $ echo c > s/a
112 $ echo c > s/a
108 $ hg --config ui.commitsubrepos=no ci -m4
113 $ hg --config ui.commitsubrepos=no ci -m4
109 abort: uncommitted changes in subrepo s
114 abort: uncommitted changes in subrepo s
115 (use --subrepos for recursive commit)
110 [255]
116 [255]
111 $ hg ci -m4
117 $ hg ci -m4
112 committing subrepository s
118 committing subrepository s
General Comments 0
You need to be logged in to leave comments. Login now