Catlard
Catlard

Reputation: 893

Can't close hg branches?

There are about five branches in my mercurial repo which refuse to close and get removed. I've been using SourceTree to close others with no problem. These "uncloseable" branches, when I try to close them, create commits as though they were being closed, but refuse to disappear from the sidebar on the left of the UI. Typing hg commit --close-branch in the terminal tells me the following:

Tinas-Air:funenglish catlard$ hg branch
3.0
Tinas-Air:funenglish catlard$ hg up -C 3.0
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Tinas-Air:funenglish catlard$ hg commit --close-branch -m no message
abort: message: No such file or directory
Tinas-Air:funenglish catlard$ hg commit --close-branch -m ' no message'
created new head

Then, when I list hg branches, it says:

Tinas-Air:funenglish catlard$ hg branches
FEAT-progress_module        6203:8c2addc535
FEAT-parents_area           6201c87b905e55e
FEAT-walkthrough            6199d70a6c28710
FEAT-teachers_area          619825e1cd7b0c1
master                      6190950f16d7910
8.2                         6188:5efdffeb62
3.0                         6153:60bd90da4c
build script                119:6e1aa3452e7
purchases refactoring       663:113aa89c24
FE11.2                      588:70077629fe
develop                     6192:1a91a3f03 (inactive)
FE11-android                5526:2ac6dff5023 (inactive)
FS11-android                5525:d2f25f5b5d5 (inactive)
FECH                        5480:0c4585de4029 (inactive)
FFN,FSN                     5278:52d0ba197af0 (inactive)
kindle-7.1                  1916:12ad96e086f3 (inactive)
811                         1338:57d84d1455be (inactive)

When I check "hg heads 3.0", it tells me:

Tinas-Air:funenglish catlard$ hg heads 3.0
changeset:   6212:202651aa75f3
branch:      3.0
tag:         tip
parent:      6211:e7966cda82da
parent:      6205:b8e081dc3436
user:        Simon Braunstein <[email protected]>
date:        Thu Nov 19 11:27:05 2015 +0800
summary:     Merge

So, there appears to be only one head/tip for the branch 3.0, but it still won't close. It appears to still be open. What can I do to close branches like "3.0"? Why did these ones, specifically, refuse to close? What am I missing? What can I do to fix it? This repo is important to my company, since it contains the history of all our changes SINCE THE BEGINNING.

Upvotes: 1

Views: 212

Answers (1)

Catlard
Catlard

Reputation: 893

Found the problem. Mercurial doesn't properly close a branch if you have a tag with the same name. So, once I deleted the tag 3.0, the branch 3.0 could be closed normally.

Upvotes: 2

Related Questions