Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 6385:0d4e068e9e52
commit: when committing the results of a merge, it's all or nothing
Previously, it was possible to commit just one file from a merge, which
is essentially always the wrong thing to do. This fixes issue 1049.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 24 Mar 2008 15:36:56 -0700 |
parents | b2f1d97d10eb |
children | 12377957948d |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Mar 24 22:49:33 2008 +0100 +++ b/mercurial/localrepo.py Mon Mar 24 15:36:56 2008 -0700 @@ -781,6 +781,11 @@ if use_dirstate: p1, p2 = self.dirstate.parents() update_dirstate = True + + if (not force and p2 != nullid and + (files or match != util.always)): + raise util.Abort(_('cannot partially commit a merge ' + '(do not specify files or patterns)')) else: p1, p2 = p1, p2 or nullid update_dirstate = (self.dirstate.parents()[0] == p1)