mergin/merginproject.py
def update_without_rebase(self, path, src, dest, basefile, temp_dir):
        """
        Update a versioned file without rebase.

        Apply the diff between local copy and server to both the local
        copy and its basefile.

        .. seealso:: self.update_with_rebase

        :param path: path to geodiff file
        :type path: str
        :param src: path to the server version of the file
        :type src: str
        :param dest: path to the local version of the file
        :type dest: str
        :param basefile: path to a file in meta dir
        :type basefile: str
        :param temp_dir: directory with downloaded files from server
        :type temp_dir: str
        """
        self.log.info("updating file without rebase: " + path)
        try:
            server_diff = self.fpath(f'{path}-server_diff', temp_dir)  # diff between server file and local basefile
            # TODO: it could happen that basefile does not exist.
            # It was either never created (e.g. when pushing without geodiff)
            # or it was deleted by mistake(?) by the user. We should detect that
            # when starting pull and download it as well
            self.geodiff.create_changeset(basefile, src, server_diff)
            self.geodiff.apply_changeset(dest, server_diff)
            self.geodiff.apply_changeset(basefile, server_diff)
            self.log.info("update successful")
        except (pygeodiff.GeoDiffLibError, pygeodiff.GeoDiffLibConflictError):
            self.log.warning("update failed! going to copy file")
            # something bad happened and we have failed to patch our local files - this should not happen if there
            # wasn't a schema change or something similar that geodiff can't handle.
            self.geodiff.make_copy_sqlite(src, dest)
            self.geodiff.make_copy_sqlite(src, basefile)

        Update a versioned file without rebase.

        Apply the diff between local copy and server to both the local
        copy and its basefile.

        .. seealso:: self.update_with_rebase

        :param path: path to geodiff file
        :type path: str
        :param src: path to the server version of the file
        :type src: str
        :param dest: path to the local version of the file
        :type dest: str
        :param basefile: path to a file in meta dir
        :type basefile: str
        :param temp_dir: directory with downloaded files from server
        :type temp_dir: str
        
Update a versioned file without rebase.
Apply the diff between local copy and server to both the local
copy and its basefile.


Update a versioned file without rebase . Apply the diff between local copy and server to both the local copy and its basefile .
def update_without_rebase(self, path, src, dest, basefile, temp_dir):
        self.log.info("updating file without rebase: " + path)
        try:
            server_diff = self.fpath(f'{path}-server_diff', temp_dir)  
            self.geodiff.create_changeset(basefile, src, server_diff)
            self.geodiff.apply_changeset(dest, server_diff)
            self.geodiff.apply_changeset(basefile, server_diff)
            self.log.info("update successful")
        except (pygeodiff.GeoDiffLibError, pygeodiff.GeoDiffLibConflictError):
            self.log.warning("update failed! going to copy file")
            self.geodiff.make_copy_sqlite(src, dest)
            self.geodiff.make_copy_sqlite(src, basefile)
def update_without_rebase ( self , path , src , dest , basefile , temp_dir ) : self . log . info ( "updating file without rebase: " + path ) try : server_diff = self . fpath ( f'{path}-server_diff' , temp_dir ) self . geodiff . create_changeset ( basefile , src , server_diff ) self . geodiff . apply_changeset ( dest , server_diff ) self . geodiff . apply_changeset ( basefile , server_diff ) self . log . info ( "update successful" ) except ( pygeodiff . GeoDiffLibError , pygeodiff . GeoDiffLibConflictError ) : self . log . warning ( "update failed! going to copy file" ) self . geodiff . make_copy_sqlite ( src , dest ) self . geodiff . make_copy_sqlite ( src , basefile )
Update a versioned file without rebase.
Update a versioned file without rebase .
"""
        Update a versioned file without rebase.

        Apply the diff between local copy and server to both the local
        copy and its basefile.

        .. seealso:: self.update_with_rebase

        :param path: path to geodiff file
        :type path: str
        :param src: path to the server version of the file
        :type src: str
        :param dest: path to the local version of the file
        :type dest: str
        :param basefile: path to a file in meta dir
        :type basefile: str
        :param temp_dir: directory with downloaded files from server
        :type temp_dir: str
        """ # diff between server file and local basefile # TODO: it could happen that basefile does not exist. # It was either never created (e.g. when pushing without geodiff) # or it was deleted by mistake(?) by the user. We should detect that # when starting pull and download it as well # something bad happened and we have failed to patch our local files - this should not happen if there # wasn't a schema change or something similar that geodiff can't handle.
self
path
path to geodiff file
path to geodiff file
src
path to the server version of the file
path to the server version of the file
dest
path to the local version of the file
path to the local version of the file
basefile
path to a file in meta dir
path to a file in meta dir
temp_dir
directory with downloaded files from server
directory with downloaded files from server