Commit 946b80f5 authored by Michal Čihař's avatar Michal Čihař

Avoid having multiple heads with Mecrurial

In simple case of remote changes and local not commited changes,
Mercurial backend created multiple heads having troubles to recoved from
that later.
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 820462e7
...@@ -816,6 +816,13 @@ class HgRepository(Repository): ...@@ -816,6 +816,13 @@ class HgRepository(Repository):
try: try:
# First try update # First try update
self.execute(['update']) self.execute(['update'])
# Figure out if we did not create multiple heads
heads = self.execute(['heads', '-T', '{node}\n']).split()
if len(heads) > 1:
# Fall back to merge
raise RepositoryException(0, 'multiple heads', '')
except RepositoryException as error: except RepositoryException as error:
# Fallback to merge # Fallback to merge
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment