Commit e6b9e582 authored by Michal Čihař's avatar Michal Čihař

Properly try to update repo before doing merge

Issue #511
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 86a39844
...@@ -640,6 +640,11 @@ class HgRepository(Repository): ...@@ -640,6 +640,11 @@ class HgRepository(Repository):
if abort: if abort:
self.execute(['update', '--clean', '.']) self.execute(['update', '--clean', '.'])
else: else:
try:
# First try update
self.execute(['update'])
except RepositoryException as error:
# Fallback to merge
try: try:
self.execute(['merge', '--tool', 'internal:merge']) self.execute(['merge', '--tool', 'internal:merge'])
except RepositoryException as error: except RepositoryException as error:
...@@ -719,7 +724,7 @@ class HgRepository(Repository): ...@@ -719,7 +724,7 @@ class HgRepository(Repository):
(is missing some revisions). (is missing some revisions).
""" """
missing_revs = self.execute( missing_revs = self.execute(
['log', '--branch', 'tip', '--prune', 'default'] ['log', '--branch', 'tip', '--prune', '.']
) )
return missing_revs != '' return missing_revs != ''
......
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