Skip to content

Commit 6377fc0

Browse files
authored
Merge pull request #129 from lutraconsulting/unfinished-pull-conflicts
return list of conflict files when resolving unfinished pull
2 parents 2b33452 + d508fc6 commit 6377fc0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

mergin/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,10 @@ def resolve_unfinished_pull(self, directory):
841841
.. seealso:: self.has_unfinished_pull
842842
843843
:param directory: project's directory
844-
:type directory: String
844+
:type directory: str
845+
:returns: files where conflicts were found
846+
:rtype: list[str]
845847
"""
846848
mp = MerginProject(directory)
847-
mp.resolve_unfinished_pull(self.username())
849+
conflicts = mp.resolve_unfinished_pull(self.username())
850+
return conflicts

mergin/merginproject.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,14 @@ def resolve_unfinished_pull(self, user_name):
688688
server.
689689
690690
.. seealso:: self.has_unfinished_pull
691+
692+
:param user_name: name of the user
693+
:type user_name: str
694+
:returns: files where conflicts were found
695+
:rtype: list[str]
691696
"""
697+
conflicts = []
698+
692699
if not self.has_unfinished_pull():
693700
self.log.warning("no unfinished pulls found")
694701
return
@@ -712,6 +719,7 @@ def resolve_unfinished_pull(self, user_name):
712719
try:
713720
# conflicted copy
714721
conflict = self.create_conflicted_copy(dest, user_name)
722+
conflicts.append(conflict)
715723
# original file synced with server
716724
self.geodiff.make_copy_sqlite(src, basefile)
717725
self.geodiff.make_copy_sqlite(src, dest)
@@ -721,4 +729,4 @@ def resolve_unfinished_pull(self, user_name):
721729

722730
shutil.rmtree(self.unfinished_pull_dir)
723731
self.log.info("unfinished pull resolved successfuly!")
724-
return
732+
return conflicts

0 commit comments

Comments
 (0)