diff --git a/hgext/fetch.py b/hgext/fetch.py --- a/hgext/fetch.py +++ b/hgext/fetch.py @@ -67,7 +67,7 @@ def fetch(ui, repo, source='default', ** util.removeauth(other.url()))) force_editor = opts.get('force_editor') or opts.get('edit') n = repo.commit(mod + add + rem, message, - opts['user'], opts['date'], + opts['user'], opts['date'], force=True, force_editor=force_editor) ui.status(_('new changeset %d:%s merges remote changes ' 'with local\n') % (repo.changelog.rev(n), diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -539,6 +539,9 @@ def commit(ui, repo, *pats, **opts): If a list of files is omitted, all changes reported by "hg status" will be committed. + If you are committing the result of a merge, do not provide any + file names or -I/-X filters. + If no commit message is specified, the configured editor is started to enter a message. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -781,6 +781,11 @@ class localrepository(repo.repository): 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) diff --git a/tests/test-glog b/tests/test-glog --- a/tests/test-glog +++ b/tests/test-glog @@ -82,7 +82,7 @@ commit() fi echo $rev > $rev hg add $rev - hg ci -d "$rev 0" -m "($rev) $msg" $rev + hg rawcommit -q -d "$rev 0" -m "($rev) $msg" $rev } echo "[extensions]" >> $HGRCPATH diff --git a/tests/test-glog.out b/tests/test-glog.out --- a/tests/test-glog.out +++ b/tests/test-glog.out @@ -1,11 +1,41 @@ % init % empty repo % building tree -created new head -created new head -created new head -created new head -created new head +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) +(the rawcommit command is deprecated) % glog -q @ 34:0eed7cd895e0 | diff --git a/tests/test-parentrevspec b/tests/test-parentrevspec --- a/tests/test-parentrevspec +++ b/tests/test-parentrevspec @@ -16,7 +16,7 @@ commit() echo >> foo - hg commit -d '0 0' -qAm "$msg" foo + hg commit -d '0 0' -qAm "$msg" } hg init repo