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
......@@ -641,13 +641,18 @@ class HgRepository(Repository):
self.execute(['update', '--clean', '.'])
else:
try:
self.execute(['merge', '--tool', 'internal:merge'])
# First try update
self.execute(['update'])
except RepositoryException as error:
if error.retcode == 255:
# Nothing to merge
return
raise
self.execute(['commit', '--message', 'Merge'])
# Fallback to merge
try:
self.execute(['merge', '--tool', 'internal:merge'])
except RepositoryException as error:
if error.retcode == 255:
# Nothing to merge
return
raise
self.execute(['commit', '--message', 'Merge'])
def needs_commit(self, filename=None):
"""
......@@ -719,7 +724,7 @@ class HgRepository(Repository):
(is missing some revisions).
"""
missing_revs = self.execute(
['log', '--branch', 'tip', '--prune', 'default']
['log', '--branch', 'tip', '--prune', '.']
)
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