mergin/merginproject.py
def resolve_unfinished_pull(self, user_name):
        """
        Try to resolve unfinished pull.

        Unfinished pull means that a previous pull_project() call has
        failed in the final stage due to some files being in read-only
        mode. When a project has unfinished pull, it has to be resolved
        before allowing further pulls or pushes.

        Resolving unfinihed pull means creation of the conflicted copy
        and replacement of the original file by the new version from the
        server.

        .. seealso:: self.has_unfinished_pull

        :param user_name: name of the user
        :type user_name: str
        :returns: files where conflicts were found
        :rtype: list[str]
        """
        conflicts = []

        if not self.has_unfinished_pull():
            self.log.warning("no unfinished pulls found")
            return

        self.log.info("resolving unfinished pull")

        temp_dir = tempfile.mkdtemp(prefix="mergin-py-client-")

        for root, dirs, files in os.walk(self.unfinished_pull_dir):
            for file_name in files:
                src = os.path.join(root, file_name)
                dest = self.fpath(file_name)
                basefile = self.fpath_meta(file_name)

                self.log.info("trying to resolve unfinished pull for: " + file_name)

                # 'src' here is a server version of the file from unfinished
                # pull and 'dest' is a local version of the same file.
                # to resolve unfinished pull we create a conflicted copy and
                # replace local file with the changes from the server.
                try:
                    # conflicted copy
                    conflict = self.create_conflicted_copy(dest, user_name)
                    conflicts.append(conflict)
                    # original file synced with server
                    self.geodiff.make_copy_sqlite(src, basefile)
                    self.geodiff.make_copy_sqlite(src, dest)
                except pygeodiff.GeoDiffLibError as err:
                    self.log.error("unable to apply changes from previous unfinished pull!")
                    raise ClientError("Unable to resolve unfinished pull!")

        shutil.rmtree(self.unfinished_pull_dir)
        self.log.info("unfinished pull resolved successfuly!")
        return conflicts

        Try to resolve unfinished pull.

        Unfinished pull means that a previous pull_project() call has
        failed in the final stage due to some files being in read-only
        mode. When a project has unfinished pull, it has to be resolved
        before allowing further pulls or pushes.

        Resolving unfinihed pull means creation of the conflicted copy
        and replacement of the original file by the new version from the
        server.

        .. seealso:: self.has_unfinished_pull

        :param user_name: name of the user
        :type user_name: str
        :returns: files where conflicts were found
        :rtype: list[str]
        
Try to resolve unfinished pull.
Unfinished pull means that a previous pull_project() call has
failed in the final stage due to some files being in read-only
mode. When a project has unfinished pull, it has to be resolved
before allowing further pulls or pushes.

Resolving unfinihed pull means creation of the conflicted copy
and replacement of the original file by the new version from the
server.


Try to resolve unfinished pull . Unfinished pull means that a previous pull_project () call has failed in the final stage due to some files being in read - only mode . When a project has unfinished pull it has to be resolved before allowing further pulls or pushes . Resolving unfinihed pull means creation of the conflicted copy and replacement of the original file by the new version from the server .
def resolve_unfinished_pull(self, user_name):
        conflicts = []
        if not self.has_unfinished_pull():
            self.log.warning("no unfinished pulls found")
            return
        self.log.info("resolving unfinished pull")
        temp_dir = tempfile.mkdtemp(prefix="mergin-py-client-")
        for root, dirs, files in os.walk(self.unfinished_pull_dir):
            for file_name in files:
                src = os.path.join(root, file_name)
                dest = self.fpath(file_name)
                basefile = self.fpath_meta(file_name)
                self.log.info("trying to resolve unfinished pull for: " + file_name)
                try:
                    conflict = self.create_conflicted_copy(dest, user_name)
                    conflicts.append(conflict)
                    self.geodiff.make_copy_sqlite(src, basefile)
                    self.geodiff.make_copy_sqlite(src, dest)
                except pygeodiff.GeoDiffLibError as err:
                    self.log.error("unable to apply changes from previous unfinished pull!")
                    raise ClientError("Unable to resolve unfinished pull!")
        shutil.rmtree(self.unfinished_pull_dir)
        self.log.info("unfinished pull resolved successfuly!")
        return conflicts
def resolve_unfinished_pull ( self , user_name ) : conflicts = [ ] if not self . has_unfinished_pull ( ) : self . log . warning ( "no unfinished pulls found" ) return self . log . info ( "resolving unfinished pull" ) temp_dir = tempfile . mkdtemp ( prefix = "mergin-py-client-" ) for root , dirs , files in os . walk ( self . unfinished_pull_dir ) : for file_name in files : src = os . path . join ( root , file_name ) dest = self . fpath ( file_name ) basefile = self . fpath_meta ( file_name ) self . log . info ( "trying to resolve unfinished pull for: " + file_name ) try : conflict = self . create_conflicted_copy ( dest , user_name ) conflicts . append ( conflict ) self . geodiff . make_copy_sqlite ( src , basefile ) self . geodiff . make_copy_sqlite ( src , dest ) except pygeodiff . GeoDiffLibError as err : self . log . error ( "unable to apply changes from previous unfinished pull!" ) raise ClientError ( "Unable to resolve unfinished pull!" ) shutil . rmtree ( self . unfinished_pull_dir ) self . log . info ( "unfinished pull resolved successfuly!" ) return conflicts
Try to resolve unfinished pull.
Try to resolve unfinished pull .
"""
        Try to resolve unfinished pull.

        Unfinished pull means that a previous pull_project() call has
        failed in the final stage due to some files being in read-only
        mode. When a project has unfinished pull, it has to be resolved
        before allowing further pulls or pushes.

        Resolving unfinihed pull means creation of the conflicted copy
        and replacement of the original file by the new version from the
        server.

        .. seealso:: self.has_unfinished_pull

        :param user_name: name of the user
        :type user_name: str
        :returns: files where conflicts were found
        :rtype: list[str]
        """ # 'src' here is a server version of the file from unfinished # pull and 'dest' is a local version of the same file. # to resolve unfinished pull we create a conflicted copy and # replace local file with the changes from the server. # conflicted copy # original file synced with server
files where conflicts were found
files where conflicts were found
list[str]
self
user_name
name of the user
name of the user