Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 9954:d6a307719ccb stable
fix bug in prepush logic involving merge changesets
When creating new branches and merging them into existing ones, you would
sometimes be able to push some changesets (the existing branches) without using
--force, even when that creates a new head on the remote.
A test which triggers the error has been added.
author | Sune Foldager <cryo@cyanite.org> |
---|---|
date | Mon, 30 Nov 2009 14:58:52 +0100 |
parents | 0b999aec64e8 |
children | 7bcbdefcd93a 25e572394f5c |
comparison
equal
deleted
inserted
replaced
9952:5b149c88d9e8 | 9954:d6a307719ccb |
---|---|
1503 | 1503 |
1504 if warn: | 1504 if warn: |
1505 if not rheads: # new branch requires --force | 1505 if not rheads: # new branch requires --force |
1506 self.ui.warn(_("abort: push creates new" | 1506 self.ui.warn(_("abort: push creates new" |
1507 " remote branch '%s'!\n") % | 1507 " remote branch '%s'!\n") % |
1508 self[updatelb[0]].branch()) | 1508 self[lheads[0]].branch()) |
1509 else: | 1509 else: |
1510 self.ui.warn(_("abort: push creates new remote heads!\n")) | 1510 self.ui.warn(_("abort: push creates new remote heads!\n")) |
1511 | 1511 |
1512 self.ui.status(_("(did you forget to merge?" | 1512 self.ui.status(_("(did you forget to merge?" |
1513 " use push -f to force)\n")) | 1513 " use push -f to force)\n")) |
1546 if lh in remotehds: | 1546 if lh in remotehds: |
1547 rheads = remotehds[lh] | 1547 rheads = remotehds[lh] |
1548 else: | 1548 else: |
1549 rheads = [] | 1549 rheads = [] |
1550 lheads = localhds[lh] | 1550 lheads = localhds[lh] |
1551 updatelb = [upd for upd in update | 1551 if not checkbranch(lheads, rheads, update): |
1552 if self[upd].branch() == lh] | |
1553 if not updatelb: | |
1554 continue | |
1555 if not checkbranch(lheads, rheads, updatelb): | |
1556 return None, 0 | 1552 return None, 0 |
1557 else: | 1553 else: |
1558 if not checkbranch(heads, remote_heads, update): | 1554 if not checkbranch(heads, remote_heads, update): |
1559 return None, 0 | 1555 return None, 0 |
1560 | 1556 |