Mercurial > hg
comparison mercurial/localrepo.py @ 10353:36b6b5ef7820
prepush: rename variables, refactor
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Sun, 07 Feb 2010 00:43:22 +0100 |
parents | 32197f7eceb3 |
children | 844d83da2da9 |
comparison
equal
deleted
inserted
replaced
10352:66d954e76ffb | 10353:36b6b5ef7820 |
---|---|
1556 # | 1556 # |
1557 # New named branches cannot be created without --force. | 1557 # New named branches cannot be created without --force. |
1558 | 1558 |
1559 if remote_heads != [nullid]: | 1559 if remote_heads != [nullid]: |
1560 if remote.capable('branchmap'): | 1560 if remote.capable('branchmap'): |
1561 localhds = {} | 1561 remotebrheads = remote.branchmap() |
1562 | |
1562 if not revs: | 1563 if not revs: |
1563 localhds = self.branchmap() | 1564 localbrheads = self.branchmap() |
1564 else: | 1565 else: |
1566 localbrheads = {} | |
1565 for n in heads: | 1567 for n in heads: |
1566 branch = self[n].branch() | 1568 branch = self[n].branch() |
1567 if branch in localhds: | 1569 localbrheads.setdefault(branch, []).append(n) |
1568 localhds[branch].append(n) | 1570 |
1569 else: | 1571 for branch, lheads in localbrheads.iteritems(): |
1570 localhds[branch] = [n] | 1572 rheads = remotebrheads.get(branch, []) |
1571 | |
1572 remotehds = remote.branchmap() | |
1573 | |
1574 for lh in localhds: | |
1575 if lh in remotehds: | |
1576 rheads = remotehds[lh] | |
1577 else: | |
1578 rheads = [] | |
1579 lheads = localhds[lh] | |
1580 if not checkbranch(lheads, rheads, update): | 1573 if not checkbranch(lheads, rheads, update): |
1581 return None, 0 | 1574 return None, 0 |
1582 else: | 1575 else: |
1583 if not checkbranch(heads, remote_heads, update): | 1576 if not checkbranch(heads, remote_heads, update): |
1584 return None, 0 | 1577 return None, 0 |