comparison mercurial/localrepo.py @ 15321:e174353e8cda stable

subrepos: abort commit by default if a subrepo is dirty (BC) This changeset flips the default value of ui.commitsubrepos setting from True to False and adds a --subrepos flag to commit. The commit, status, and diff commands behave like this with regard to recusion and the ui.commitsubrepos setting: | recurses | recurses | by default | with --subrepos --------+---------------+---------------- commit: | commitsubrepo | True status: | False | True diff: | False | True By changing the default from True to False, the table becomes consistent in the two columns: * without --subrepos on the command line, commit will abort if a subrepo is dirty and status/diff wont show changes inside subrepos. * with --subrepos, all three commands will recurse. A --subrepos flag on the command line overrides the config settin.g
author Martin Geisler <mg@lazybytes.net>
date Fri, 21 Oct 2011 00:33:08 +0200
parents 7196ed7a1505
children c681e478c429
comparison
equal deleted inserted replaced
15320:681267a5f491 15321:e174353e8cda
1060 # clean up .hgsubstate when .hgsub is removed 1060 # clean up .hgsubstate when .hgsub is removed
1061 if ('.hgsubstate' in wctx and 1061 if ('.hgsubstate' in wctx and
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():
1073 matched = set(changes[0] + changes[1] + changes[2]) 1074 matched = set(changes[0] + changes[1] + changes[2])
1074 1075