Show More
@@ -878,6 +878,11 b' User interface controls.' | |||
|
878 | 878 | be prompted to enter a username. If no username is entered, the |
|
879 | 879 | default ``USER@HOST`` is used instead. |
|
880 | 880 | Default is False. |
|
881 | ``commitsubrepos`` | |
|
882 | Whether to commit modified subrepositories when committing the | |
|
883 | parent repository. If False and one subrepository has uncommitted | |
|
884 | changes, abort the commit. | |
|
885 | Default is True. | |
|
881 | 886 | ``debug`` |
|
882 | 887 | Print debugging information. True or False. Default is False. |
|
883 | 888 | ``editor`` |
@@ -78,7 +78,10 b' Interaction with Mercurial Commands' | |||
|
78 | 78 | :commit: commit creates a consistent snapshot of the state of the |
|
79 | 79 | entire project and its subrepositories. It does this by first |
|
80 | 80 | attempting to commit all modified subrepositories, then recording |
|
81 |
their state and finally committing it in the parent |
|
|
81 | their state and finally committing it in the parent | |
|
82 | repository. Mercurial can be made to abort if any subrepository | |
|
83 | content is modified by setting "ui.commitsubrepos=no" in a | |
|
84 | configuration file (see :hg:`help config`). | |
|
82 | 85 | |
|
83 | 86 | :diff: diff does not recurse in subrepos unless -S/--subrepos is |
|
84 | 87 | specified. Changes are displayed as usual, on the subrepositories |
@@ -933,6 +933,12 b' class localrepository(repo.repository):' | |||
|
933 | 933 | if '.hgsubstate' not in changes[0]: |
|
934 | 934 | changes[0].insert(0, '.hgsubstate') |
|
935 | 935 | |
|
936 | if subs and not self.ui.configbool('ui', 'commitsubrepos', True): | |
|
937 | changedsubs = [s for s in subs if wctx.sub(s).dirty(True)] | |
|
938 | if changedsubs: | |
|
939 | raise util.Abort(_("uncommitted changes in subrepo %s") | |
|
940 | % changedsubs[0]) | |
|
941 | ||
|
936 | 942 | # make sure all explicit patterns are matched |
|
937 | 943 | if not force and match.files(): |
|
938 | 944 | matched = set(changes[0] + changes[1] + changes[2]) |
@@ -75,16 +75,19 b' add sub sub' | |||
|
75 | 75 | commit: (clean) |
|
76 | 76 | update: (current) |
|
77 | 77 | |
|
78 | bump sub rev | |
|
78 | bump sub rev (and check it is ignored by ui.commitsubrepos) | |
|
79 | 79 | |
|
80 | 80 | $ echo b > s/a |
|
81 | 81 | $ hg -R s ci -ms1 |
|
82 | $ hg ci -m3 | |
|
82 | $ hg --config ui.commitsubrepos=no ci -m3 | |
|
83 | 83 | committing subrepository s |
|
84 | 84 | |
|
85 | leave sub dirty | |
|
85 | leave sub dirty (and check ui.commitsubrepos=no aborts the commit) | |
|
86 | 86 | |
|
87 | 87 | $ echo c > s/a |
|
88 | $ hg --config ui.commitsubrepos=no ci -m4 | |
|
89 | abort: uncommitted changes in subrepo s | |
|
90 | [255] | |
|
88 | 91 | $ hg ci -m4 |
|
89 | 92 | committing subrepository s |
|
90 | 93 | $ hg tip -R s |
General Comments 0
You need to be logged in to leave comments.
Login now