Show More
@@ -1372,10 +1372,10 b' class localrepository(object):' | |||||
1372 | if not force: |
|
1372 | if not force: | |
1373 | raise util.Abort( |
|
1373 | raise util.Abort( | |
1374 | _("commit with new subrepo %s excluded") % s) |
|
1374 | _("commit with new subrepo %s excluded") % s) | |
1375 |
|
|
1375 | dirtyreason = wctx.sub(s).dirtyreason(True) | |
|
1376 | if dirtyreason: | |||
1376 | if not self.ui.configbool('ui', 'commitsubrepos'): |
|
1377 | if not self.ui.configbool('ui', 'commitsubrepos'): | |
1377 | raise util.Abort( |
|
1378 | raise util.Abort(dirtyreason, | |
1378 | _("uncommitted changes in subrepo %s") % s, |
|
|||
1379 | hint=_("use --subrepos for recursive commit")) |
|
1379 | hint=_("use --subrepos for recursive commit")) | |
1380 | subs.append(s) |
|
1380 | subs.append(s) | |
1381 | commitsubs.add(s) |
|
1381 | commitsubs.add(s) |
@@ -390,6 +390,18 b' class abstractsubrepo(object):' | |||||
390 | """ |
|
390 | """ | |
391 | raise NotImplementedError |
|
391 | raise NotImplementedError | |
392 |
|
392 | |||
|
393 | def dirtyreason(self, ignoreupdate=False): | |||
|
394 | """return reason string if it is ``dirty()`` | |||
|
395 | ||||
|
396 | Returned string should have enough information for the message | |||
|
397 | of exception. | |||
|
398 | ||||
|
399 | This returns None, otherwise. | |||
|
400 | """ | |||
|
401 | if self.dirty(ignoreupdate=ignoreupdate): | |||
|
402 | return _("uncommitted changes in subrepository '%s'" | |||
|
403 | ) % subrelpath(self) | |||
|
404 | ||||
393 | def basestate(self): |
|
405 | def basestate(self): | |
394 | """current working directory base state, disregarding .hgsubstate |
|
406 | """current working directory base state, disregarding .hgsubstate | |
395 | state and working directory modifications""" |
|
407 | state and working directory modifications""" |
@@ -248,7 +248,7 b' verify that large files in subrepos hand' | |||||
248 | commit: 1 subrepos |
|
248 | commit: 1 subrepos | |
249 | update: (current) |
|
249 | update: (current) | |
250 | $ hg ci -m "this commit should fail without -S" |
|
250 | $ hg ci -m "this commit should fail without -S" | |
251 | abort: uncommitted changes in subrepo subrepo |
|
251 | abort: uncommitted changes in subrepository 'subrepo' | |
252 | (use --subrepos for recursive commit) |
|
252 | (use --subrepos for recursive commit) | |
253 | [255] |
|
253 | [255] | |
254 |
|
254 |
@@ -59,7 +59,7 b' Test recursive diff without committing a' | |||||
59 | Commits: |
|
59 | Commits: | |
60 |
|
60 | |||
61 | $ hg commit -m fails |
|
61 | $ hg commit -m fails | |
62 | abort: uncommitted changes in subrepo foo |
|
62 | abort: uncommitted changes in subrepository 'foo' | |
63 | (use --subrepos for recursive commit) |
|
63 | (use --subrepos for recursive commit) | |
64 | [255] |
|
64 | [255] | |
65 |
|
65 |
@@ -146,7 +146,7 b' leave sub dirty (and check ui.commitsubr' | |||||
146 |
|
146 | |||
147 | $ echo c > s/a |
|
147 | $ echo c > s/a | |
148 | $ hg --config ui.commitsubrepos=no ci -m4 |
|
148 | $ hg --config ui.commitsubrepos=no ci -m4 | |
149 | abort: uncommitted changes in subrepo s |
|
149 | abort: uncommitted changes in subrepository 's' | |
150 | (use --subrepos for recursive commit) |
|
150 | (use --subrepos for recursive commit) | |
151 | [255] |
|
151 | [255] | |
152 | $ hg id |
|
152 | $ hg id |
General Comments 0
You need to be logged in to leave comments.
Login now