Show More
@@ -1491,7 +1491,7 b' class localrepository(repo.repository):' | |||
|
1491 | 1491 | update, updated_heads = self.findoutgoing(remote, common, remote_heads) |
|
1492 | 1492 | msng_cl, bases, heads = self.changelog.nodesbetween(update, revs) |
|
1493 | 1493 | |
|
1494 | def checkbranch(lheads, rheads, updatelb): | |
|
1494 | def checkbranch(lheads, rheads, updatelb, branchname=None): | |
|
1495 | 1495 | ''' |
|
1496 | 1496 | check whether there are more local heads than remote heads on |
|
1497 | 1497 | a specific branch. |
@@ -1527,9 +1527,18 b' class localrepository(repo.repository):' | |||
|
1527 | 1527 | warn = 1 |
|
1528 | 1528 | |
|
1529 | 1529 | if warn: |
|
1530 | self.ui.warn(_("abort: push creates new remote heads!\n")) | |
|
1530 | if branchname is not None: | |
|
1531 | msg = _("abort: push creates new remote heads" | |
|
1532 | " on branch '%s'!\n") % branchname | |
|
1533 | else: | |
|
1534 | msg = _("abort: push creates new remote heads!\n") | |
|
1535 | self.ui.warn(msg) | |
|
1536 | if len(lheads) > len(rheads): | |
|
1531 | 1537 | self.ui.status(_("(did you forget to merge?" |
|
1532 | 1538 | " use push -f to force)\n")) |
|
1539 | else: | |
|
1540 | self.ui.status(_("(you should pull and merge or" | |
|
1541 | " use push -f to force)\n")) | |
|
1533 | 1542 | return False |
|
1534 | 1543 | return True |
|
1535 | 1544 | |
@@ -1570,7 +1579,7 b' class localrepository(repo.repository):' | |||
|
1570 | 1579 | for branch, lheads in localbrheads.iteritems(): |
|
1571 | 1580 | if branch in remotebrheads: |
|
1572 | 1581 | rheads = remotebrheads[branch] |
|
1573 | if not checkbranch(lheads, rheads, update): | |
|
1582 | if not checkbranch(lheads, rheads, update, branch): | |
|
1574 | 1583 | return None, 0 |
|
1575 | 1584 | else: |
|
1576 | 1585 | if not checkbranch(heads, remote_heads, update): |
@@ -2,8 +2,8 b' updating to branch default' | |||
|
2 | 2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
3 | 3 | pushing to ../a |
|
4 | 4 | searching for changes |
|
5 | abort: push creates new remote heads! | |
|
6 |
( |
|
|
5 | abort: push creates new remote heads on branch 'default'! | |
|
6 | (you should pull and merge or use push -f to force) | |
|
7 | 7 | pulling from ../a |
|
8 | 8 | searching for changes |
|
9 | 9 | adding changesets |
@@ -13,7 +13,7 b' added 1 changesets with 1 changes to 1 f' | |||
|
13 | 13 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
14 | 14 | pushing to ../a |
|
15 | 15 | searching for changes |
|
16 | abort: push creates new remote heads! | |
|
16 | abort: push creates new remote heads on branch 'default'! | |
|
17 | 17 | (did you forget to merge? use push -f to force) |
|
18 | 18 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
19 | 19 | (branch merge, don't forget to commit) |
@@ -35,7 +35,7 b' 0 files updated, 1 files merged, 0 files' | |||
|
35 | 35 | (branch merge, don't forget to commit) |
|
36 | 36 | pushing to ../c |
|
37 | 37 | searching for changes |
|
38 | abort: push creates new remote heads! | |
|
38 | abort: push creates new remote heads on branch 'default'! | |
|
39 | 39 | (did you forget to merge? use push -f to force) |
|
40 | 40 | 1 |
|
41 | 41 | pushing to ../c |
@@ -44,12 +44,12 b' no changes found' | |||
|
44 | 44 | 0 |
|
45 | 45 | pushing to ../c |
|
46 | 46 | searching for changes |
|
47 | abort: push creates new remote heads! | |
|
48 |
( |
|
|
47 | abort: push creates new remote heads on branch 'default'! | |
|
48 | (you should pull and merge or use push -f to force) | |
|
49 | 49 | 1 |
|
50 | 50 | pushing to ../c |
|
51 | 51 | searching for changes |
|
52 | abort: push creates new remote heads! | |
|
52 | abort: push creates new remote heads on branch 'default'! | |
|
53 | 53 | (did you forget to merge? use push -f to force) |
|
54 | 54 | 1 |
|
55 | 55 | pushing to ../c |
@@ -106,8 +106,8 b' 1' | |||
|
106 | 106 | % fail on multiple head push |
|
107 | 107 | pushing to ../f |
|
108 | 108 | searching for changes |
|
109 | abort: push creates new remote heads! | |
|
110 |
( |
|
|
109 | abort: push creates new remote heads on branch 'a'! | |
|
110 | (you should pull and merge or use push -f to force) | |
|
111 | 111 | 1 |
|
112 | 112 | % push replacement head on existing branches |
|
113 | 113 | pushing to ../f |
@@ -153,8 +153,8 b' adding c' | |||
|
153 | 153 | created new head |
|
154 | 154 | pushing to h |
|
155 | 155 | searching for changes |
|
156 | abort: push creates new remote heads! | |
|
157 |
( |
|
|
156 | abort: push creates new remote heads on branch 'default'! | |
|
157 | (you should pull and merge or use push -f to force) | |
|
158 | 158 | |
|
159 | 159 | % check prepush logic with merged branches |
|
160 | 160 | marked working directory as branch a |
@@ -167,6 +167,6 b' 1 files updated, 0 files merged, 0 files' | |||
|
167 | 167 | (branch merge, don't forget to commit) |
|
168 | 168 | pushing to j |
|
169 | 169 | searching for changes |
|
170 | abort: push creates new remote heads! | |
|
171 |
( |
|
|
170 | abort: push creates new remote heads on branch 'a'! | |
|
171 | (you should pull and merge or use push -f to force) | |
|
172 | 172 |
@@ -151,7 +151,7 b' adding file changes' | |||
|
151 | 151 | added 1 changesets with 1 changes to 1 files |
|
152 | 152 | % push -f |
|
153 | 153 | committing subrepository s |
|
154 | abort: push creates new remote heads! | |
|
154 | abort: push creates new remote heads on branch 'default'! | |
|
155 | 155 | pushing ...sub/t |
|
156 | 156 | pushing ...subrepo ss |
|
157 | 157 | searching for changes |
General Comments 0
You need to be logged in to leave comments.
Login now