Show More
@@ -1505,7 +1505,7 b' class localrepository(repo.repository):' | |||
|
1505 | 1505 | if not rheads: # new branch requires --force |
|
1506 | 1506 | self.ui.warn(_("abort: push creates new" |
|
1507 | 1507 | " remote branch '%s'!\n") % |
|
1508 |
self[ |
|
|
1508 | self[lheads[0]].branch()) | |
|
1509 | 1509 | else: |
|
1510 | 1510 | self.ui.warn(_("abort: push creates new remote heads!\n")) |
|
1511 | 1511 | |
@@ -1548,11 +1548,7 b' class localrepository(repo.repository):' | |||
|
1548 | 1548 | else: |
|
1549 | 1549 | rheads = [] |
|
1550 | 1550 | lheads = localhds[lh] |
|
1551 | updatelb = [upd for upd in update | |
|
1552 | if self[upd].branch() == lh] | |
|
1553 | if not updatelb: | |
|
1554 | continue | |
|
1555 | if not checkbranch(lheads, rheads, updatelb): | |
|
1551 | if not checkbranch(lheads, rheads, update): | |
|
1556 | 1552 | return None, 0 |
|
1557 | 1553 | else: |
|
1558 | 1554 | if not checkbranch(heads, remote_heads, update): |
@@ -140,4 +140,21 b' hg -R i ci -Am c' | |||
|
140 | 140 | hg -R i push h |
|
141 | 141 | echo |
|
142 | 142 | |
|
143 | echo % check prepush logic with merged branches | |
|
144 | hg init j | |
|
145 | hg -R j branch a | |
|
146 | echo init > j/foo | |
|
147 | hg -R j ci -Am init | |
|
148 | hg clone j k | |
|
149 | echo a1 > j/foo | |
|
150 | hg -R j ci -m a1 | |
|
151 | hg -R k branch b | |
|
152 | echo b > k/foo | |
|
153 | hg -R k ci -m b | |
|
154 | hg -R k up 0 | |
|
155 | hg -R k merge b | |
|
156 | hg -R k ci -m merge | |
|
157 | hg -R k push -r a j | |
|
158 | echo | |
|
159 | ||
|
143 | 160 | exit 0 |
@@ -140,3 +140,17 b' searching for changes' | |||
|
140 | 140 | abort: push creates new remote heads! |
|
141 | 141 | (did you forget to merge? use push -f to force) |
|
142 | 142 | |
|
143 | % check prepush logic with merged branches | |
|
144 | marked working directory as branch a | |
|
145 | adding foo | |
|
146 | updating to branch a | |
|
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
148 | marked working directory as branch b | |
|
149 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
150 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
151 | (branch merge, don't forget to commit) | |
|
152 | pushing to j | |
|
153 | searching for changes | |
|
154 | abort: push creates new remote heads! | |
|
155 | (did you forget to merge? use push -f to force) | |
|
156 |
General Comments 0
You need to be logged in to leave comments.
Login now