--- a/mercurial/commands.py Tue Jul 06 20:43:19 2010 +0200
+++ b/mercurial/commands.py Wed Jul 07 14:29:40 2010 +0200
@@ -803,7 +803,7 @@
if not opts.get('close_branch'):
for r in parents:
- if r.extra().get('close'):
+ if r.extra().get('close') and r.branch() == branch:
ui.status(_('reopening closed branch head %d\n') % r)
if ui.debugflag:
--- a/tests/test-merge-closedheads Tue Jul 06 20:43:19 2010 +0200
+++ b/tests/test-merge-closedheads Wed Jul 07 14:29:40 2010 +0200
@@ -48,4 +48,26 @@
hg merge
hgcommit -m 'merged heads'
+echo '% hg update -C 8'
+hg update -C 8
+echo '% hg branch some-branch'
+hg branch some-branch
+echo '% hg commit'
+hgcommit -m 'started some-branch'
+echo '% hg commit --close-branch'
+hgcommit --close-branch -m 'closed some-branch'
+
+echo '% hg update default'
+hg update default
+echo '% hg merge some-branch'
+hg merge some-branch
+echo '% hg commit (no reopening of some-branch)'
+hgcommit -m 'merge with closed branch'
+
+cat >> $HGRCPATH <<EOF
+[extensions]
+graphlog =
+EOF
+
+#hg glog
--- a/tests/test-merge-closedheads.out Tue Jul 06 20:43:19 2010 +0200
+++ b/tests/test-merge-closedheads.out Wed Jul 07 14:29:40 2010 +0200
@@ -16,3 +16,15 @@
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
+% hg update -C 8
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% hg branch some-branch
+marked working directory as branch some-branch
+% hg commit
+% hg commit --close-branch
+% hg update default
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% hg merge some-branch
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+% hg commit (no reopening of some-branch)