comparison mercurial/help/subrepos.txt @ 13411:d4de90a612f7

commit: abort if a subrepo is modified and ui.commitsubrepos=no The default behaviour is to commit subrepositories with uncommitted changes. In my experience this is usually undesirable: - Changes to dependencies are often debugging leftovers - Real changes should generally be applied on the source project directly, tested then committed. This is not always possible, subversion subrepos may include only a small part of the source project, without the tests. Setting ui.commitsubrepos=no will now abort commits containing such modified subrepositories like: $ hg --config ui.commitsubrepos=no ci -m msg abort: uncommitted changes in subrepo sub I ruled out the hook solution because it does not easily take --include/exclude options in account. Also, my main concern is whether this flag could cause problems with extensions. If there are legitimate reasons for callers to override this behaviour (I could not find any), they might either override at ui level, or we could add an argument to localrepo.commit() later. v2: - Renamed ui.commitsubs to ui.commitsubrepos - Mention the configuration entry in hg help subrepos
author Patrick Mezard <pmezard@gmail.com>
date Tue, 15 Feb 2011 22:25:48 +0100
parents db2ff771204d
children 15f15f3b405d
comparison
equal deleted inserted replaced
13410:1f2b2c33d386 13411:d4de90a612f7
76 -S/--subrepos is specified. 76 -S/--subrepos is specified.
77 77
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
85 elements. Subversion subrepositories are currently silently 88 elements. Subversion subrepositories are currently silently
86 ignored. 89 ignored.