##// END OF EJS Templates
commit: abort if a subrepo is modified and ui.commitsubrepos=no...
Patrick Mezard -
r13411:d4de90a6 default
parent child Browse files
Show More
@@ -878,6 +878,11 b' User interface controls.'
878 be prompted to enter a username. If no username is entered, the
878 be prompted to enter a username. If no username is entered, the
879 default ``USER@HOST`` is used instead.
879 default ``USER@HOST`` is used instead.
880 Default is False.
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 ``debug``
886 ``debug``
882 Print debugging information. True or False. Default is False.
887 Print debugging information. True or False. Default is False.
883 ``editor``
888 ``editor``
@@ -78,7 +78,10 b' Interaction with Mercurial Commands'
78 :commit: commit creates a consistent snapshot of the state of the
78 :commit: commit creates a consistent snapshot of the state of the
79 entire project and its subrepositories. It does this by first
79 entire project and its subrepositories. It does this by first
80 attempting to commit all modified subrepositories, then recording
80 attempting to commit all modified subrepositories, then recording
81 their state and finally committing it in the parent repository.
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 :diff: diff does not recurse in subrepos unless -S/--subrepos is
86 :diff: diff does not recurse in subrepos unless -S/--subrepos is
84 specified. Changes are displayed as usual, on the subrepositories
87 specified. Changes are displayed as usual, on the subrepositories
@@ -933,6 +933,12 b' class localrepository(repo.repository):'
933 if '.hgsubstate' not in changes[0]:
933 if '.hgsubstate' not in changes[0]:
934 changes[0].insert(0, '.hgsubstate')
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 # make sure all explicit patterns are matched
942 # make sure all explicit patterns are matched
937 if not force and match.files():
943 if not force and match.files():
938 matched = set(changes[0] + changes[1] + changes[2])
944 matched = set(changes[0] + changes[1] + changes[2])
@@ -75,16 +75,19 b' add sub sub'
75 commit: (clean)
75 commit: (clean)
76 update: (current)
76 update: (current)
77
77
78 bump sub rev
78 bump sub rev (and check it is ignored by ui.commitsubrepos)
79
79
80 $ echo b > s/a
80 $ echo b > s/a
81 $ hg -R s ci -ms1
81 $ hg -R s ci -ms1
82 $ hg ci -m3
82 $ hg --config ui.commitsubrepos=no ci -m3
83 committing subrepository s
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 $ echo c > s/a
87 $ echo c > s/a
88 $ hg --config ui.commitsubrepos=no ci -m4
89 abort: uncommitted changes in subrepo s
90 [255]
88 $ hg ci -m4
91 $ hg ci -m4
89 committing subrepository s
92 committing subrepository s
90 $ hg tip -R s
93 $ hg tip -R s
General Comments 0
You need to be logged in to leave comments. Login now