diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -787,7 +787,7 @@ class localrepository(repo.repository): update_dirstate = True if (not force and p2 != nullid and - (match.files() or match.anypats())): + (match and (match.files() or match.anypats()))): raise util.Abort(_('cannot partially commit a merge ' '(do not specify files or patterns)')) else: diff --git a/tests/test-transplant b/tests/test-transplant --- a/tests/test-transplant +++ b/tests/test-transplant @@ -96,3 +96,21 @@ hg transplant 1 hg transplant --continue hg transplant 1:3 hg locate +cd .. + +# Test transplant --merge (issue 1111) +echo % test transplant merge +hg init t1111 +cd t1111 +echo a > a +hg ci -Am adda +echo b >> a +hg ci -m appendb +echo c >> a +hg ci -m appendc +hg up -C 0 +echo d >> a +hg ci -m appendd +echo % tranplant +hg transplant -m 1 +cd .. diff --git a/tests/test-transplant.out b/tests/test-transplant.out --- a/tests/test-transplant.out +++ b/tests/test-transplant.out @@ -129,3 +129,10 @@ 0282d5fbbe02 transplanted to 77418277ccb added bar foo +% test transplant merge +adding a +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +created new head +% tranplant +applying 42dc4432fd35 +1:42dc4432fd35 merged at a9f4acbac129