Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 31388:b6a6df38a802
merge: check current wc branch for 'nothing to merge', not its p1
The working directory will usually be clean or very clean, and wc will usually
have the same branch as its parent. This change will thus usually not make any
difference and is done as a separate change to show that. It will be used in a
later change.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 12 Mar 2017 16:41:46 -0700 |
parents | 102d3a30582c |
children | 1b9b00aca8a3 |
comparison
equal
deleted
inserted
replaced
31387:2e48c776a874 | 31388:b6a6df38a802 |
---|---|
1542 if branchmerge: | 1542 if branchmerge: |
1543 if pas == [p2]: | 1543 if pas == [p2]: |
1544 raise error.Abort(_("merging with a working directory ancestor" | 1544 raise error.Abort(_("merging with a working directory ancestor" |
1545 " has no effect")) | 1545 " has no effect")) |
1546 elif pas == [p1]: | 1546 elif pas == [p1]: |
1547 if not mergeancestor and p1.branch() == p2.branch(): | 1547 if not mergeancestor and wc.branch() == p2.branch(): |
1548 raise error.Abort(_("nothing to merge"), | 1548 raise error.Abort(_("nothing to merge"), |
1549 hint=_("use 'hg update' " | 1549 hint=_("use 'hg update' " |
1550 "or check 'hg heads'")) | 1550 "or check 'hg heads'")) |
1551 if not force and (wc.files() or wc.deleted()): | 1551 if not force and (wc.files() or wc.deleted()): |
1552 raise error.Abort(_("uncommitted changes"), | 1552 raise error.Abort(_("uncommitted changes"), |